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

Extra "Bad define syntax" error when it is the only expression and the variable name is unused. #178

Open
Idorobots opened this issue Dec 25, 2023 · 1 comment

Comments

@Idorobots
Copy link
Owner

For this input:

(define foo 23)

It produced the following output:

test/sprtn/errors/unused.sprtn(1,0): Bad `define` syntax, not allowed in this context:
  1 |(define foo 23)
    |^^^^^^^^^^^^^^^

test/sprtn/errors/unused.sprtn(1,8): Unused variable `foo`, rename to `_` to avoid this error:
  1 |(define foo 23)
    |        ^^^

The first error is not warranted and indeed it disappears if the input is prepended by any other expression, despite the define remaining in the same scope.

@Idorobots
Copy link
Owner Author

This is done so that a scope needs to return a value, but at top level the resulting module should be the value. It should be laxed when #55 is implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant