Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Declarations not supported by x-let varients #1

Closed
AkashaP opened this issue May 24, 2022 · 0 comments
Closed

Declarations not supported by x-let varients #1

AkashaP opened this issue May 24, 2022 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@AkashaP
Copy link
Owner

AkashaP commented May 24, 2022

A problem i found whilst scouring Alexandria code. it causes this to fail:

(using either alexandria or if-letstar at commit #63c5cef797c887e7db9391be639ec19e35f4d69e or before)

(if-let* ((a :foo) (b :bar))
      (declare (type symbol a b))
      t
      nil)

fails at runtime because it tries to execute (declare (type symbol a b)) as the true path, and at compile-time because for example you can't put declare inside a progn block (common in macros) it has to be right after the bindings and such.

more examples of code that cant be done in various x-let varients when it seems reasonable the syntax can fit it otherwise:

(labels ((c () (print a) (print b)))
      (if-let* ((a :foo) (b (eq 1 1)))
        (declare (special a))
        (declare (special b))
        (declare (type symbol a b))
        (progn
          (print "true")
          (c))
        (progn
          (print "false")
          (c))))

@AkashaP AkashaP added the bug Something isn't working label May 24, 2022
@AkashaP AkashaP self-assigned this May 24, 2022
@AkashaP AkashaP pinned this issue May 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant