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

Use a mock sentinel for MARK instead of a gensym #216

Merged
merged 1 commit into from
May 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/hissp/macros.lissp
Original file line number Diff line number Diff line change
Expand Up @@ -2039,9 +2039,9 @@ except ModuleNotFoundError:pass"
``@`` ROLL (default depth 2)
Pops (at depth) and pushes.
``]`` MARK (default depth 0)
Inserts a sentinel gensym for PACK (at depth).
Inserts a sentinel object for PACK (at depth).
``[`` PACK
Pops to the first sentinel and pushes as tuple.
Pops to the first MARK and pushes as tuple.
With depth, looks tuple up on the next element.
``*`` SPLAT
Pops (at depth) and pushes elements.
Expand Down Expand Up @@ -2244,12 +2244,14 @@ except ModuleNotFoundError:pass"
.#"&" `(.append ,'$#stack (,'XY#.#"X[-1-Y]" ,'$#stack ,(depth Y)))
.#"@" `(.append ,'$#stack (.pop ,'$#stack ,(op#sub -2 (depth Y))))
.#"[" `(.append ,'$#stack
(-<>> (tuple (iter ,'$#stack.pop ','$#\]))
(-<>> (tuple (iter ,'$#stack.pop
(getattr unittest.mock..sentinel
"hissp.]")))
,@(when Y `(op#itemgetter
(:<> (,'$#stack.pop))))))
.#"]" `(.insert ,'$#stack
(op#sub (len ,'$#stack) ,(depth Y))
','$#\])
(getattr unittest.mock..sentinel "hissp.]"))
.#"*" `(.extend ,'$#stack
(reversed (tuple (.pop ,'$#stack
,(op#sub -1 (depth Y))))))
Expand Down