{"size": 1348, "ext": "scrbl", "max_stars_repo_path": "sweet-exp/sweet-exp/sweet.scrbl", "max_stars_repo_name": "Kalimehtar/sweet-racket", "max_stars_repo_stars_event_min_datetime": "2015-01-02T13:52:20.000Z", "max_stars_repo_stars_event_max_datetime": "2021-09-15T20:34:52.000Z", "max_issues_repo_path": "sweet-exp/sweet-exp/sweet.scrbl", "max_issues_repo_name": "t0mpr1c3/sweet-racket", "max_issues_repo_issues_event_min_datetime": "2015-01-30T22:11:22.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-21T19:22:22.000Z", "max_forks_repo_path": "sweet-exp/sweet-exp/sweet.scrbl", "max_forks_repo_name": "t0mpr1c3/sweet-racket", "max_forks_repo_forks_event_min_datetime": "2015-02-01T22:24:32.000Z", "max_forks_repo_forks_event_max_datetime": "2021-10-14T15:50:35.000Z"}
{"max_stars_count": 39, "max_issues_count": 33, "max_forks_count": 12, "avg_line_length": 24.0714285714, "max_line_length": 71, "alphanum_fraction": 0.7299703264}
#lang scribble/doc

@(require scribble/manual
          (for-label racket/base sweet-exp))

@title{Sweet: an alternative to s-expressions}
@author[(author+email "Asumu Takikawa" "asumu@racket-lang.org")]

This manual describes the sweet package, a Racket port of the
@hyperlink["http://www.dwheeler.com/readable/"]{sweet reader}
by David Wheeler. This packages provides the sweet
reader as a language mixin, similar to the @racketmodname[at-exp]
or @racketmodname[s-exp] modules.

@defmodulelang[sweet-exp]

To use sweet expressions, supply a @racketfont{#lang}
line like the following:

@codeblock|{
  #lang sweet-exp racket

  printf("Hello")
}|

The third parameter on the @racketfont{#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[racket], @racket[typed/racket], or others.

For example:

@codeblock|{
  #lang sweet-exp typed/racket

  define: fact([n : Integer]) : Integer
    if zero?(n)
       1
       {n * fact{n - 1}}
}|

Or alternatively:

@codeblock|{
  #lang sweet-exp lazy

  define 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.
