Skip to content

Commit

Permalink
add example (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
JunNishimura committed Oct 16, 2024
1 parent 0c4900b commit f6e8f1b
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions examples/defun.jsop.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[
{
"defmacro": {
"name": "defun",
"keys": ["name", "params", "body"],
"body": {
"command": {
"symbol": "quote",
"args": {
"set": {
"var": ",name",
"val": {
"lambda": {
"params": ",params",
"body": ",body"
}
}
}
}
}
}
}
},
{
"defun": {
"name": "$add",
"params": ["$x", "$y"],
"body": {
"command": {
"symbol": "+",
"args": ["$x", "$y"]
}
}
}
},
{
"command": {
"symbol": "$add",
"args": [1, 2]
}
}
]

0 comments on commit f6e8f1b

Please sign in to comment.