https://github.com/rogerkeays/racket-dollar
Example #lang for racket that uses $ for unquote.
https://github.com/rogerkeays/racket-dollar
racket racket-lang racket-language
Last synced: 4 months ago
JSON representation
Example #lang for racket that uses $ for unquote.
- Host: GitHub
- URL: https://github.com/rogerkeays/racket-dollar
- Owner: rogerkeays
- License: mit
- Created: 2021-02-06T13:35:30.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-03-09T15:30:22.000Z (over 5 years ago)
- Last Synced: 2024-10-01T00:14:54.390Z (over 1 year ago)
- Topics: racket, racket-lang, racket-language
- Language: Racket
- Homepage: https://rogerkeays.com
- Size: 3.91 KB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dollar
An example #lang extension for racket that uses $ for unquote.
> (define x 1)
> `($x 2)
'(1 2)
> `(1 $(+ 1 1))
'(1 2)
## Try It Yourself
This package is available from the racket package catalog, so you can install it using raco:
$ raco pkg install dollar
Now create a test script and run it:
$ echo '#lang dollar racket
(define x 1)
`($x 2)' > test.rkt
$ racket test.rkt
'(1 2)
You can also use racket/base, or any other language that supports the , (unquote) syntax.
## Under The Hood
This language extension is essentially a single file, lang/reader.rkt, which implements the minimum three procedures required for a language: read, read-syntax and get-info. Check the source code for more details.
## Related Resources
For more solutions to your life's problems, [visit the author's website](https://rogerkeays.com)