-
Notifications
You must be signed in to change notification settings - Fork 0
/
recess.scm
40 lines (31 loc) · 821 Bytes
/
recess.scm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
;; -*- mode: scheme; geiser-scheme-implementation: guile -*-
;;;; Recess
(load "./j-bob/j-bob-lang.scm")
(load "./j-bob/j-bob.scm")
(J-Bob/step (prelude)
'(car (cons 'ham '(cheese)))
'())
;;=> (car (cons (quote ham) (quote (cheese))))
(J-Bob/step (prelude)
'(car (cons 'ham '(cheese)))
'((() (car/cons 'ham '(cheese)))))
;;=> (quote ham)
(J-Bob/step (prelude)
'(equal 'flapjack (atom (cons a b)))
'(((2) (atom/cons a b))
(() (equal 'flapjack 'nil))))
;;=> (quote nil)
(J-Bob/step (prelude)
'(atom (cdr (cons (car (cons p q)) '())))
'(((1 1 1) (car/cons p q))
((1) (cdr/cons p '()))
(() (atom '()))))
;;=> (quote t)
(J-Bob/step (prelude)
'(if a c c)
'())
;;=> (if a c c)
(J-Bob/step (prelude)
'(if a c c)
'((() (if-same a c))))
;;=> c