https://github.com/takikawa/sweet-racket
A port of sweet expressions to Racket
https://github.com/takikawa/sweet-racket
racket
Last synced: 28 days ago
JSON representation
A port of sweet expressions to Racket
- Host: GitHub
- URL: https://github.com/takikawa/sweet-racket
- Owner: takikawa
- License: other
- Created: 2011-07-20T19:32:14.000Z (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2023-03-07T02:10:54.000Z (about 2 years ago)
- Last Synced: 2025-03-17T19:54:34.808Z (about 1 month ago)
- Topics: racket
- Language: Racket
- Homepage: http://pkg-build.racket-lang.org/doc/sweet/index.html
- Size: 99.6 KB
- Stars: 47
- Watchers: 3
- Forks: 10
- Open Issues: 9
-
Metadata Files:
- Readme: README.markdown
- License: LICENSE
Awesome Lists containing this project
README
Sweet expressions for Racket
============================This package provides a port of the [sweet
expression](http://readable.sourceforge.net/) reader, originally written by
David Wheeler, to [Racket](http://www.racket-lang.org).To use the package, you have several options.
* With Racket 5.3.2 or later, you can install the package using `raco pkg`:
- `raco pkg install sweet-exp`
- set your language to `#lang sweet-exp `* You can also use Planet 2 package management manually:
- `git clone git://github.com/takikawa/sweet-racket.git`
- `raco pkg install sweet-racket/sweet-exp-lib/`* With Racket 5.3.1 and earlier, you can use the
[Planet package](http://planet.racket-lang.org/display.ss?package=sweet.plt&owner=asumu).
- set your language to `#lang planet asumu/sweet `Note: the check syntax tool does work with this language, but
it may fail to activate when you first install it from PLaneT.
Changing the #lang line and then trying again should cause the
check syntax button to appear.This package is released under the MIT license under the
same terms as the original implementation.* * *
The following is an excerpt from the Scribble manual for this package. The
package provides the sweet reader as a language mixin, similar to the `at-exp`
or `s-exp` modules.```racket
#lang sweet-exp
```To use sweet expressions, supply a `#lang` line like the following:
```racket
#lang sweet-exp racketprintf("Hello")
```The third parameter on the `#lang` line is the base language used by the
language mixin. The resulting language will use the bindings from the
base language, but support sweet expression syntax. You can provide any
language here such as `racket`, `typed/racket`, or others.For example:
```racket
#lang sweet-exp typed/racketdefine: fact([n : Integer]) : Integer
if zero?(n)
1
{n * fact{n - 1}}
```Or alternatively:
```racket
#lang sweet-exp lazydefine fibs
cons 0 cons(1 map(+ fibs cdr(fibs)))displayln list-ref(fibs 8)
```Known issues: quasi-quotation combined with grouping does not behave
according to the specification.