Fix define-pyfun macro in compiled mode#13
Conversation
The macro would expand to a direct reference to the hash-table-ref/default and hash-table-set! procedures rather than the identifiers for those procedures. This works in the interpreter because it is a bit lax when intermixing expansion code with evaluated code, but when compiling code that uses the macro, it breaks with this error: Syntax error: illegal atomic form #<procedure> Fixes issue iraikov#12
The names "args" and "kwargs" were left as bare symbols, which meant the expansion could unhygienically take these identifiers from the surrounding code. Similarly, the core macro "receive" was not renamed.
|
I think it might be wise to rewrite these as implicit renaming macros - there's a lot of renames that can be easily forgotten. I started by rewriting these as |
|
Thanks Peter, I will definitely consider the implicit renaming route. These macros are quite complicated and I was never quite happy with them.
|
|
Closed in favor of #14 |
The macro would expand to a direct reference to the hash-table-ref/default and hash-table-set! procedures rather than the identifiers for those procedures. This works in the interpreter because it is a bit lax when intermixing expansion code with evaluated code, but when compiling code that uses the macro, it breaks with this error:
Syntax error: illegal atomic form
Fixes issue #12