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

Wrong error messages when invoking macro #243

Closed
Tracked by #43
jcubic opened this issue Mar 19, 2023 · 0 comments
Closed
Tracked by #43

Wrong error messages when invoking macro #243

jcubic opened this issue Mar 19, 2023 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@jcubic
Copy link
Collaborator

jcubic commented Mar 19, 2023

Example code:

(define-syntax foo
  (syntax-rules ()
    ((_ var1 ... var2)
     (begin
       (print var1)
       ...
       (print var2)))))

(foo)

the macro foo expects at least 1 argument. But it throws an error:

TypeError: code.length is not a function in macro: (() ((_ body1 ... body2) (begin (print body1) ... (print body2))))
    at traverse (file:///home/kuba/projects/jcubic/scheme/lips/src/lips.js:3573:41)
    at traverse (file:///home/kuba/projects/jcubic/scheme/lips/src/lips.js:3745:17)
    at extract_patterns (file:///home/kuba/projects/jcubic/scheme/lips/src/lips.js:3761:9)
    at Environment.<anonymous> (file:///home/kuba/projects/jcubic/scheme/lips/src/lips.js:7969:36)
    at Syntax.invoke (file:///home/kuba/projects/jcubic/scheme/lips/src/lips.js:3474:24)
    at evaluate_syntax (file:///home/kuba/projects/jcubic/scheme/lips/src/lips.js:9833:23)
    at evaluate (file:///home/kuba/projects/jcubic/scheme/lips/src/lips.js:9979:22)
    at exec_lambda (file:///home/kuba/projects/jcubic/scheme/lips/src/lips.js:10032:27)
    at async run (file:///home/kuba/projects/jcubic/scheme/lips/bin/lips.js:69:16)
[1]: (foo)
@jcubic jcubic added the bug Something isn't working label Mar 19, 2023
@jcubic jcubic added this to the 1.0 milestone Jan 8, 2024
jcubic added a commit that referenced this issue Jan 18, 2024
@jcubic jcubic closed this as completed Jan 18, 2024
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