Skip to content

time macro fails to expand with macroexpand-all when nested #1143

Closed
@ikappaki

Description

Hi,

the basilisp.core/time macro uses a straight start let binding referenced in a try-catch block and as such is susceptible to errors when expanded by macroexpand-all (see #1142)

To reproduce

  • In the REPL create use time in a new macro definition and try to expand it with macroexpand-all, an error is thrown complaining about the start binding:
basilisp.user=> (require '[basilisp.walk :refer [macroexpand-all]])
nil
basilisp.user=> (defmacro abc [] `(time 5))
#'basilisp.user/abc
basilisp.user=> (macroexpand-all '(abc))

  exception: <class 'basilisp.lang.compiler.exception.CompilerException'>
      phase: :analyzing
    message: unable to resolve symbol 'basilisp.core/start' in this context
       form: basilisp.core/start
   location: <Macroexpand>:NO_SOURCE_LINE

I believe the intention here was to use an auto-gensym all along.

Patch to follow.

Thanks

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions