diff options
author | David Robillard <d@drobilla.net> | 2012-12-23 05:31:15 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-12-23 05:31:15 +0000 |
commit | 67319bf0410196787c753225f46057bc7c94beec (patch) | |
tree | 572e8f8989a903fde8be784de5dddbaa1938ecfe /test | |
parent | 0375a20786f1e6eba9d128889f700b22d447021c (diff) | |
download | resp-67319bf0410196787c753225f46057bc7c94beec.tar.gz resp-67319bf0410196787c753225f46057bc7c94beec.tar.bz2 resp-67319bf0410196787c753225f46057bc7c94beec.zip |
Move towards standard Scheme syntax.
git-svn-id: http://svn.drobilla.net/resp/trunk@442 ad02d1e2-f140-0410-9f75-f8b11f17cedd
Diffstat (limited to 'test')
-rw-r--r-- | test/ack.scm (renamed from test/ack.resp) | 2 | ||||
-rw-r--r-- | test/closure.resp | 6 | ||||
-rw-r--r-- | test/closure.scm | 6 | ||||
-rw-r--r-- | test/def.resp | 8 | ||||
-rw-r--r-- | test/def.scm | 8 | ||||
-rw-r--r-- | test/deffn.resp | 3 | ||||
-rw-r--r-- | test/deffn.scm | 3 | ||||
-rw-r--r-- | test/fac.resp | 7 | ||||
-rw-r--r-- | test/fac.scm | 7 | ||||
-rw-r--r-- | test/inlinefn.resp | 1 | ||||
-rw-r--r-- | test/inlinefn.scm | 1 | ||||
-rw-r--r-- | test/let-over-fn.resp | 7 | ||||
-rw-r--r-- | test/let-over-fn.scm | 7 | ||||
-rw-r--r-- | test/let.scm (renamed from test/let.resp) | 2 | ||||
-rw-r--r-- | test/match.scm (renamed from test/match.resp) | 4 | ||||
-rw-r--r-- | test/nest.scm (renamed from test/nest.resp) | 4 | ||||
-rw-r--r-- | test/poly.scm (renamed from test/poly.resp) | 2 | ||||
-rw-r--r-- | test/quote.scm (renamed from test/quote.resp) | 4 | ||||
-rw-r--r-- | test/string.resp | 4 | ||||
-rw-r--r-- | test/string.scm | 4 | ||||
-rw-r--r-- | test/tup.scm (renamed from test/tup.resp) | 2 |
21 files changed, 46 insertions, 46 deletions
diff --git a/test/ack.resp b/test/ack.scm index 76fb397..b996bf6 100644 --- a/test/ack.resp +++ b/test/ack.scm @@ -1,4 +1,4 @@ -(def (ack m n) +(define (ack m n) (if (= 0 m) (+ n 1) (= 0 n) (ack (- m 1) 1) (ack (- m 1) (ack m (- n 1))))) diff --git a/test/closure.resp b/test/closure.resp deleted file mode 100644 index 8dad1c1..0000000 --- a/test/closure.resp +++ /dev/null @@ -1,6 +0,0 @@ -(def (multiplier factor) - (fn (x) (* (+ x 0) factor))) - -(def doubler (multiplier 2)) - -(doubler 3) diff --git a/test/closure.scm b/test/closure.scm new file mode 100644 index 0000000..baaaead --- /dev/null +++ b/test/closure.scm @@ -0,0 +1,6 @@ +(define (multiplier factor) + (lambda (x) (* (+ x 0) factor))) + +(define doubler (multiplier 2)) + +(doubler 3) diff --git a/test/def.resp b/test/def.resp deleted file mode 100644 index 52605b0..0000000 --- a/test/def.resp +++ /dev/null @@ -1,8 +0,0 @@ -(def foo - (fn (x) - (def y x) - (def z (+ x 1)) - z)) - -(foo 3) - diff --git a/test/def.scm b/test/def.scm new file mode 100644 index 0000000..6730b9d --- /dev/null +++ b/test/def.scm @@ -0,0 +1,8 @@ +(define foo + (lambda (x) + (define y x) + (define z (+ x 1)) + z)) + +(foo 3) + diff --git a/test/deffn.resp b/test/deffn.resp deleted file mode 100644 index c413ecd..0000000 --- a/test/deffn.resp +++ /dev/null @@ -1,3 +0,0 @@ -(def f (fn (x) (+ x 1))) - -(f 2) diff --git a/test/deffn.scm b/test/deffn.scm new file mode 100644 index 0000000..3550a39 --- /dev/null +++ b/test/deffn.scm @@ -0,0 +1,3 @@ +(define f (lambda (x) (+ x 1))) + +(f 2) diff --git a/test/fac.resp b/test/fac.resp deleted file mode 100644 index 0fb687c..0000000 --- a/test/fac.resp +++ /dev/null @@ -1,7 +0,0 @@ -; Factorial -(def (fac n) - (if (= 0 n) 1 - (* n (fac (- n 1))))) - -(fac 6) - diff --git a/test/fac.scm b/test/fac.scm new file mode 100644 index 0000000..0ed384d --- /dev/null +++ b/test/fac.scm @@ -0,0 +1,7 @@ +; Factorial +(define (fac n) + (if (= 0 n) 1 + (* n (fac (- n 1))))) + +(fac 6) + diff --git a/test/inlinefn.resp b/test/inlinefn.resp deleted file mode 100644 index 2f055bd..0000000 --- a/test/inlinefn.resp +++ /dev/null @@ -1 +0,0 @@ -((fn (x) (+ x 1)) 1) diff --git a/test/inlinefn.scm b/test/inlinefn.scm new file mode 100644 index 0000000..d5073e8 --- /dev/null +++ b/test/inlinefn.scm @@ -0,0 +1 @@ +((lambda (x) (+ x 1)) 1) diff --git a/test/let-over-fn.resp b/test/let-over-fn.resp deleted file mode 100644 index be3131f..0000000 --- a/test/let-over-fn.resp +++ /dev/null @@ -1,7 +0,0 @@ -(def inc - (let (x 1) - (fn (y) (+ x y)))) - -(inc 1) - -
\ No newline at end of file diff --git a/test/let-over-fn.scm b/test/let-over-fn.scm new file mode 100644 index 0000000..5fc3b78 --- /dev/null +++ b/test/let-over-fn.scm @@ -0,0 +1,7 @@ +(define inc + (let (x 1) + (lambda (y) (+ x y)))) + +(inc 1) + +
\ No newline at end of file diff --git a/test/let.resp b/test/let.scm index 49623a6..67858b6 100644 --- a/test/let.resp +++ b/test/let.scm @@ -1,4 +1,4 @@ -(def one 1) +(define one 1) (let (two (+ one 1) three (+ one 2)) diff --git a/test/match.resp b/test/match.scm index 0df0568..db19be1 100644 --- a/test/match.resp +++ b/test/match.scm @@ -4,11 +4,11 @@ (Rectangle Float Float)) ; Return the area of s -(def (area s) +(define (area s) (match s (Rectangle w h) (* w h) (Circle r) (* 3.14159 r))) -(def s (Rectangle 3.0 4.0)) +(define s (Rectangle 3.0 4.0)) (area s)
\ No newline at end of file diff --git a/test/nest.resp b/test/nest.scm index c15c453..dac0f96 100644 --- a/test/nest.resp +++ b/test/nest.scm @@ -1,5 +1,5 @@ -(def (f x) - (def (g y) +(define (f x) + (define (g y) (* y 2)) (g (+ x 1))) diff --git a/test/poly.resp b/test/poly.scm index 1857fdf..d642a0d 100644 --- a/test/poly.resp +++ b/test/poly.scm @@ -1,4 +1,4 @@ -(def (eq x y) (= x y)) +(define (eq x y) (= x y)) (eq 1 2) (eq 1 1) diff --git a/test/quote.resp b/test/quote.scm index 638e81b..4895d2e 100644 --- a/test/quote.resp +++ b/test/quote.scm @@ -5,9 +5,9 @@ (Empty)) -(def list (quote (2 a b c))) +(define list (quote (2 a b c))) -(def (len l) +(define (len l) (match l (Symbol s) 1 diff --git a/test/string.resp b/test/string.resp deleted file mode 100644 index ff980a9..0000000 --- a/test/string.resp +++ /dev/null @@ -1,4 +0,0 @@ -(def greeting "Hello, world!") - -greeting - diff --git a/test/string.scm b/test/string.scm new file mode 100644 index 0000000..1e1e81e --- /dev/null +++ b/test/string.scm @@ -0,0 +1,4 @@ +(define greeting "Hello, world!") + +greeting + diff --git a/test/tup.resp b/test/tup.scm index e856f81..502db54 100644 --- a/test/tup.resp +++ b/test/tup.scm @@ -1,4 +1,4 @@ -(def t (Tup 1 2 3 4 5)) +(define t (Tup 1 2 3 4 5)) (. t 0) (. t 1) (. t 2) |