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)))
|
(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`.
|
See the docs: `raco docs cur`.
|
||||||
|
|
||||||
Going further
|
Going further
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
#lang s-exp syntax/module-reader
|
#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
|
;; Olly: The OTT-Like LibrarY
|
||||||
;; TODO: Automagically create a parser from bnf grammar
|
;; TODO: Automagically create a parser from bnf grammar
|
||||||
(require
|
(require
|
||||||
|
@ -6,7 +6,7 @@
|
||||||
"stdlib/nat.rkt"
|
"stdlib/nat.rkt"
|
||||||
;; TODO: "real-"? More like "curnel-"
|
;; TODO: "real-"? More like "curnel-"
|
||||||
(only-in
|
(only-in
|
||||||
"cur.rkt"
|
"main.rkt"
|
||||||
[#%app real-app]
|
[#%app real-app]
|
||||||
[elim real-elim]
|
[elim real-elim]
|
||||||
[Π real-forall]
|
[Π real-forall]
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#lang s-exp "../cur.rkt"
|
#lang s-exp "../main.rkt"
|
||||||
(require "sugar.rkt")
|
(require "sugar.rkt")
|
||||||
(provide Bool true false if not and or)
|
(provide Bool true false if not and or)
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#lang s-exp "../cur.rkt"
|
#lang s-exp "../main.rkt"
|
||||||
(require
|
(require
|
||||||
"nat.rkt"
|
"nat.rkt"
|
||||||
"maybe.rkt"
|
"maybe.rkt"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#lang s-exp "../cur.rkt"
|
#lang s-exp "../main.rkt"
|
||||||
(require "sugar.rkt")
|
(require "sugar.rkt")
|
||||||
(provide Maybe none some some/i)
|
(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")
|
(require "sugar.rkt" "bool.rkt")
|
||||||
;; TODO: override (all-defined-out) to enable exporting all these
|
;; TODO: override (all-defined-out) to enable exporting all these
|
||||||
;; properly.
|
;; properly.
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#lang s-exp "../cur.rkt"
|
#lang s-exp "../main.rkt"
|
||||||
(require "sugar.rkt")
|
(require "sugar.rkt")
|
||||||
;; TODO: Handle multiple provide forms properly
|
;; TODO: Handle multiple provide forms properly
|
||||||
;; TODO: Handle (all-defined-out) properly
|
;; TODO: Handle (all-defined-out) properly
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#lang s-exp "../cur.rkt"
|
#lang s-exp "../main.rkt"
|
||||||
(provide
|
(provide
|
||||||
->
|
->
|
||||||
lambda
|
lambda
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
query-type)
|
query-type)
|
||||||
|
|
||||||
(require
|
(require
|
||||||
(only-in "../cur.rkt"
|
(only-in "../main.rkt"
|
||||||
[elim real-elim]
|
[elim real-elim]
|
||||||
[#%app real-app]
|
[#%app real-app]
|
||||||
[λ real-lambda]
|
[λ real-lambda]
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#lang s-exp "../../cur.rkt"
|
#lang s-exp "../../main.rkt"
|
||||||
(require
|
(require
|
||||||
(for-syntax racket/syntax))
|
(for-syntax racket/syntax))
|
||||||
(provide
|
(provide
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#lang s-exp "../../cur.rkt"
|
#lang s-exp "../../main.rkt"
|
||||||
(require
|
(require
|
||||||
"base.rkt"
|
"base.rkt"
|
||||||
(prefix-in basic: "standard.rkt")
|
(prefix-in basic: "standard.rkt")
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#lang s-exp "../../cur.rkt"
|
#lang s-exp "../../main.rkt"
|
||||||
(require
|
(require
|
||||||
"base.rkt"
|
"base.rkt"
|
||||||
(for-syntax racket/syntax))
|
(for-syntax racket/syntax))
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#lang s-exp "../cur.rkt"
|
#lang s-exp "../main.rkt"
|
||||||
(require
|
(require
|
||||||
"nat.rkt"
|
"nat.rkt"
|
||||||
"bool.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
|
#lang info
|
||||||
(define collection 'multi)
|
(define collection 'multi)
|
||||||
(define deps '())
|
(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 update-implies '("cur-lib"))
|
||||||
(define pkg-desc "Tests for \"cur\".")
|
(define pkg-desc "Tests for \"cur\".")
|
||||||
(define pkg-authors '(wilbowma))
|
(define pkg-authors '(wilbowma))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user