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

Ignore next form (#_) only works for the next form #1207

Open
pfeodrippe opened this issue Feb 7, 2025 · 1 comment
Open

Ignore next form (#_) only works for the next form #1207

pfeodrippe opened this issue Feb 7, 2025 · 1 comment
Labels
component:reader Issue pertaining to Basilisp reader module issue-type:bug Something isn't working

Comments

@pfeodrippe
Copy link

In JVM/CLJS (others) clojure, we can use N #_ in sequence to ignore the next N forms, while for basilisp I have an error (at least when using it from a let as the error seems to be related to the macroexpansion).

;; This explodes.
(let [#_ #_ _ (bpy.ops.ed/undo_push)
      a 3])

;; This is fine
(let [#_ _ #_ (bpy.ops.ed/undo_push)
      a 3])

Error

 exception: <class 'basilisp.lang.exception.ExceptionInfo'> from <class 'basilisp.lang.compiler.exception.CompilerException'>
      phase: :macroexpansion
    message: error occurred during macroexpansion: Invalid destructuring argument type {:type :other}
       form: (let [(bpy.ops.ed/undo_push) a 3])
   location: /Users/pfeodrippe/dev/vybe/basilisp/src/vybe/basilisp/bake.lpy:54-55
    context:

 50   |       (set! bpy.context.view_layer.objects/active o)))
 51   | 
 52   | 
 53   | 
 54 > |   (let [#_ #_ _ (bpy.ops.ed/undo_push)
 55 > |         a 3])
 56   | 
@pfeodrippe
Copy link
Author

It also doesn't work for a map

{#_ #_:a 3
 :b 5}
 exception: <class 'ValueError'> from <class 'basilisp.lang.reader.SyntaxError'>
    message: Unexpected char '}'; expected map value: not enough values to unpack (expected 2, got 1)
       line: 42:8

@chrisrink10 chrisrink10 added issue-type:bug Something isn't working component:reader Issue pertaining to Basilisp reader module labels Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:reader Issue pertaining to Basilisp reader module issue-type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants