Conversation
Implemented the `define-macro` special form, providing Common Lisp-style unhygienic macros. - Added `analyzeDefineMacro` to `src/core/interpreter/analyzers/core_forms.js`. - Created `src/core/scheme/define-macro.sld`. - Updated `repl.js` and `web/main.js` to import `(scheme define-macro)` by default. - Added support for both `(define-macro (name . args) body)` and `(define-macro name transformer)` syntax. - Updated `CHANGES.md`. Co-authored-by: mark-friedman <1743690+mark-friedman@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Removed extraneous explanations related to macro call processing.
src/core/scheme/define-macro.sld
Outdated
| ;; This library exports the define-macro special form. | ||
| ;; It is loaded by default in the REPL environment. | ||
|
|
||
| (define-library (scheme define-macro) |
There was a problem hiding this comment.
@jules
define-macro should be in the (scheme-js define-macro) library since it's not in standard Scheme.
There was a problem hiding this comment.
Good catch! I've moved the library definition to the scheme-js namespace since it's an extension, and also moved the file to src/extras/scheme/define-macro.sld to match the project's organization for non-standard libraries.
- Changed library name to `(scheme-js define-macro)` - Moved file to `src/extras/scheme/define-macro.sld` - Updated all imports in `repl.js`, `web/main.js`, and `tests/run_scheme_tests_lib.js` Co-authored-by: mark-friedman <1743690+mark-friedman@users.noreply.github.com>
Restored the original `CHANGES.md` and appended the `define-macro` walkthrough to the end of the file instead of overwriting it. Co-authored-by: mark-friedman <1743690+mark-friedman@users.noreply.github.com>
Added the date to the `define-macro` walkthrough heading in `CHANGES.md` to match the style of other entries. Co-authored-by: mark-friedman <1743690+mark-friedman@users.noreply.github.com>
Implemented the
define-macrospecial form, providing Common Lisp-style unhygienic macros.Changes:
Core Implementation:
analyzeDefineMacrotosrc/core/interpreter/analyzers/core_forms.js.define-macrotoSYNTAX_KEYWORDSandSPECIAL_FORMSinsrc/core/interpreter/library_registry.js.Library Support:
src/core/scheme/define-macro.sld, exportingdefine-macro.repl.jsandweb/main.jsto automatically import(scheme define-macro)into the initial environment.tests/run_scheme_tests_lib.jsto load and import(scheme define-macro)for test files.Testing:
tests/functional/test_defmacro.scmcovering basic usage, return values, and explicit transformer syntax.tests/test_manifest.js.Test Results:
PR created automatically by Jules for task 433352381041054241 started by @mark-friedman