Added support for sweet-expressions
* Moved cur.rkt to main.rkt, which fixes some reader issues * Added sweet-expression tests * Added notes about sweet-expressions to README * Added sweet-exp as dependency to tests
This commit is contained in:
parent
4f272dc507
commit
b8ca2ad9dc
16
README.md
16
README.md
|
@ -52,6 +52,22 @@ Try entering the following in the interaction area:
|
|||
(sub1 (s (s z)))
|
||||
```
|
||||
|
||||
Don't like parenthesis? Use Cur with sweet-expressions:
|
||||
```racket
|
||||
#lang sweet-exp
|
||||
require
|
||||
cur/stdlib/bool
|
||||
cur/stdlib/nat
|
||||
|
||||
if true
|
||||
false
|
||||
true
|
||||
|
||||
define + plus
|
||||
|
||||
{z + s(z)}
|
||||
```
|
||||
|
||||
See the docs: `raco docs cur`.
|
||||
|
||||
Going further
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
#lang s-exp syntax/module-reader
|
||||
cur/cur
|
||||
cur
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#lang s-exp "cur.rkt"
|
||||
#lang s-exp "main.rkt"
|
||||
;; Olly: The OTT-Like LibrarY
|
||||
;; TODO: Automagically create a parser from bnf grammar
|
||||
(require
|
||||
|
@ -6,7 +6,7 @@
|
|||
"stdlib/nat.rkt"
|
||||
;; TODO: "real-"? More like "curnel-"
|
||||
(only-in
|
||||
"cur.rkt"
|
||||
"main.rkt"
|
||||
[#%app real-app]
|
||||
[elim real-elim]
|
||||
[Π real-forall]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#lang s-exp "../cur.rkt"
|
||||
#lang s-exp "../main.rkt"
|
||||
(require "sugar.rkt")
|
||||
(provide Bool true false if not and or)
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#lang s-exp "../cur.rkt"
|
||||
#lang s-exp "../main.rkt"
|
||||
(require
|
||||
"nat.rkt"
|
||||
"maybe.rkt"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#lang s-exp "../cur.rkt"
|
||||
#lang s-exp "../main.rkt"
|
||||
(require "sugar.rkt")
|
||||
(provide Maybe none some some/i)
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#lang s-exp "../cur.rkt"
|
||||
#lang s-exp "../main.rkt"
|
||||
(require "sugar.rkt" "bool.rkt")
|
||||
;; TODO: override (all-defined-out) to enable exporting all these
|
||||
;; properly.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#lang s-exp "../cur.rkt"
|
||||
#lang s-exp "../main.rkt"
|
||||
(require "sugar.rkt")
|
||||
;; TODO: Handle multiple provide forms properly
|
||||
;; TODO: Handle (all-defined-out) properly
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#lang s-exp "../cur.rkt"
|
||||
#lang s-exp "../main.rkt"
|
||||
(provide
|
||||
->
|
||||
lambda
|
||||
|
@ -27,7 +27,7 @@
|
|||
query-type)
|
||||
|
||||
(require
|
||||
(only-in "../cur.rkt"
|
||||
(only-in "../main.rkt"
|
||||
[elim real-elim]
|
||||
[#%app real-app]
|
||||
[λ real-lambda]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#lang s-exp "../../cur.rkt"
|
||||
#lang s-exp "../../main.rkt"
|
||||
(require
|
||||
(for-syntax racket/syntax))
|
||||
(provide
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#lang s-exp "../../cur.rkt"
|
||||
#lang s-exp "../../main.rkt"
|
||||
(require
|
||||
"base.rkt"
|
||||
(prefix-in basic: "standard.rkt")
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#lang s-exp "../../cur.rkt"
|
||||
#lang s-exp "../../main.rkt"
|
||||
(require
|
||||
"base.rkt"
|
||||
(for-syntax racket/syntax))
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#lang s-exp "../cur.rkt"
|
||||
#lang s-exp "../main.rkt"
|
||||
(require
|
||||
"nat.rkt"
|
||||
"bool.rkt"
|
||||
|
|
16
cur-test/cur/tests/sweet-exp.rkt
Normal file
16
cur-test/cur/tests/sweet-exp.rkt
Normal file
|
@ -0,0 +1,16 @@
|
|||
#lang sweet-exp cur
|
||||
require
|
||||
cur/stdlib/sugar
|
||||
cur/stdlib/bool
|
||||
cur/stdlib/nat
|
||||
rackunit
|
||||
|
||||
check-equal?
|
||||
if true false true
|
||||
false
|
||||
|
||||
define + plus
|
||||
|
||||
check-equal?
|
||||
{z + s(z)}
|
||||
s(z)
|
|
@ -1,7 +1,7 @@
|
|||
#lang info
|
||||
(define collection 'multi)
|
||||
(define deps '())
|
||||
(define build-deps '("base" "rackunit-lib" ("cur-lib" #:version "0.2")))
|
||||
(define build-deps '("base" "rackunit-lib" ("cur-lib" #:version "0.2") "sweet-exp"))
|
||||
(define update-implies '("cur-lib"))
|
||||
(define pkg-desc "Tests for \"cur\".")
|
||||
(define pkg-authors '(wilbowma))
|
||||
|
|
Loading…
Reference in New Issue
Block a user