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

add cirru-quote variant for better meta programming #183

Merged
merged 3 commits into from Jul 20, 2022
Merged

Conversation

tiye
Copy link
Member

@tiye tiye commented Jul 18, 2022

Since Cirru is a syntax for various DSLs, there are many cases we want to embed Cirru inside Calcit code to program other DSLs. To make it convenient and more performance, CirruQuote variant is added into core.

New APIs:

  • cirru-quote which is a special form are symbol reading phase,
  • parse-cirru-list, which is previously parse-cirru that returns list, so it's breaking change,
  • parse-cirru, which returns CalcitCirruQuote variant.
  • &cirru-quote:to-list, which converts CalcitCirruQuote into Calcit list.

This is designed to simplify calcit-calx and calcit-wasmtime, and will probably break docs site.

@tiye tiye requested a review from a team July 18, 2022 14:30
@tiye
Copy link
Member Author

tiye commented Jul 18, 2022

also noticed, cirru-quote takes effect at reader phase, which means before quote takes effect:

=>> cr -e 'println $ quote $ cirru-quote 1'
(&cirru-quote 1)

which makes it tricky to create quoted data that contains cirru-quote:

=>> cr -e 'println $ quasiquote $ a (~ (turn-symbol "|cirru-quote")) b'
([] 'a 'cirru-quote 'b)

and quote inside Cirru EDN is a different story.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants