mitranim / mitranim/jisp

Macros and hoisting-embedding

Open
#22 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
JavaScript
Stars
132
Forks
9
PR merge metrics
No merged PRs in 30d

Description

Right now, there’s a difference between macros and global functions in the way they are hoisted and embedded. Functions respect the file’s scope and allow the user to override them: if a function is reassigned in the top scope before being referenced by name, it’s not embedded. Macros don’t allow themselves to be overridden and are embedded even if “reassigned” (referenced like (= myMacro ‘stuff’)).

We need to allow the user to reassign and reuse macro names in a similar way as with global functions. If a macro’s name is reassigned before a macro call, the macro should be blacklisted and ignored for the duration of this particular call of the compile function or this REPL session.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the compile function and the REPL session handling, then trace how global functions and macros are hoisted and embedded. Compare reassignment before a call, including the issue's (= myMacro ‘stuff’) example. Done means reassigned macro names are ignored for that compile call or REPL session, while unreassigned macros retain their current behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.