shen-ruby 0.8.1 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/HISTORY.md +4 -0
- data/README.md +4 -4
- data/lib/shen_ruby/version.rb +1 -1
- data/shen/release/k_lambda/core.kl +63 -63
- data/shen/release/k_lambda/declarations.kl +59 -10
- data/shen/release/k_lambda/load.kl +15 -15
- data/shen/release/k_lambda/macros.kl +31 -29
- data/shen/release/k_lambda/prolog.kl +97 -97
- data/shen/release/k_lambda/reader.kl +79 -79
- data/shen/release/k_lambda/sequent.kl +60 -54
- data/shen/release/k_lambda/sys.kl +98 -98
- data/shen/release/k_lambda/t-star.kl +47 -47
- data/shen/release/k_lambda/toplevel.kl +21 -21
- data/shen/release/k_lambda/track.kl +25 -25
- data/shen/release/k_lambda/types.kl +4 -8
- data/shen/release/k_lambda/writer.kl +25 -25
- data/shen/release/k_lambda/yacc.kl +32 -26
- data/shen-ruby.gemspec +1 -1
- metadata +3 -3
@@ -61,27 +61,27 @@ port " (shen.app (value *port*) (cn " ported by " (shen.app (value *porters*) "
|
|
61
61
|
|
62
62
|
(defun shen.initialise_environment () (shen.multiple-set (cons shen.*call* (cons 0 (cons shen.*infs* (cons 0 (cons shen.*process-counter* (cons 0 (cons shen.*catch* (cons 0 ()))))))))))
|
63
63
|
|
64
|
-
(defun shen.multiple-set (
|
64
|
+
(defun shen.multiple-set (V2367) (cond ((= () V2367) ()) ((and (cons? V2367) (cons? (tl V2367))) (do (set (hd V2367) (hd (tl V2367))) (shen.multiple-set (tl (tl V2367))))) (true (shen.sys-error shen.multiple-set))))
|
65
65
|
|
66
|
-
(defun destroy (
|
66
|
+
(defun destroy (V2368) (declare V2368 symbol))
|
67
67
|
|
68
68
|
(set shen.*history* ())
|
69
69
|
|
70
70
|
(defun shen.read-evaluate-print () (let Lineread (shen.toplineread) (let History (value shen.*history*) (let NewLineread (shen.retrieve-from-history-if-needed Lineread History) (let NewHistory (shen.update_history NewLineread History) (let Parsed (fst NewLineread) (shen.toplevel Parsed)))))))
|
71
71
|
|
72
|
-
(defun shen.retrieve-from-history-if-needed (
|
72
|
+
(defun shen.retrieve-from-history-if-needed (V2378 V2379) (cond ((and (tuple? V2378) (and (cons? (snd V2378)) (element? (hd (snd V2378)) (cons (shen.space) (cons (shen.newline) ()))))) (shen.retrieve-from-history-if-needed (@p (fst V2378) (tl (snd V2378))) V2379)) ((and (tuple? V2378) (and (cons? (snd V2378)) (and (cons? (tl (snd V2378))) (and (= () (tl (tl (snd V2378)))) (and (cons? V2379) (and (= (hd (snd V2378)) (shen.exclamation)) (= (hd (tl (snd V2378))) (shen.exclamation)))))))) (let PastPrint (shen.prbytes (snd (hd V2379))) (hd V2379))) ((and (tuple? V2378) (and (cons? (snd V2378)) (= (hd (snd V2378)) (shen.exclamation)))) (let Key? (shen.make-key (tl (snd V2378)) V2379) (let Find (head (shen.find-past-inputs Key? V2379)) (let PastPrint (shen.prbytes (snd Find)) Find)))) ((and (tuple? V2378) (and (cons? (snd V2378)) (and (= () (tl (snd V2378))) (= (hd (snd V2378)) (shen.percent))))) (do (shen.print-past-inputs (lambda X true) (reverse V2379) 0) (abort))) ((and (tuple? V2378) (and (cons? (snd V2378)) (= (hd (snd V2378)) (shen.percent)))) (let Key? (shen.make-key (tl (snd V2378)) V2379) (let Pastprint (shen.print-past-inputs Key? (reverse V2379) 0) (abort)))) (true V2378)))
|
73
73
|
|
74
74
|
(defun shen.percent () 37)
|
75
75
|
|
76
76
|
(defun shen.exclamation () 33)
|
77
77
|
|
78
|
-
(defun shen.prbytes (
|
78
|
+
(defun shen.prbytes (V2380) (do (map (lambda Byte (pr (n->string Byte) (stoutput))) V2380) (nl 1)))
|
79
79
|
|
80
|
-
(defun shen.update_history (
|
80
|
+
(defun shen.update_history (V2381 V2382) (set shen.*history* (cons V2381 V2382)))
|
81
81
|
|
82
82
|
(defun shen.toplineread () (shen.toplineread_loop (read-byte (stinput)) ()))
|
83
83
|
|
84
|
-
(defun shen.toplineread_loop (
|
84
|
+
(defun shen.toplineread_loop (V2384 V2385) (cond ((= V2384 (shen.hat)) (simple-error "line read aborted")) ((element? V2384 (cons (shen.newline) (cons (shen.carriage-return) ()))) (let Line (compile (lambda X2365 (shen.<st_input> X2365)) V2385 (lambda E shen.nextline)) (if (or (= Line shen.nextline) (empty? Line)) (shen.toplineread_loop (read-byte (stinput)) (append V2385 (cons V2384 ()))) (@p Line V2385)))) (true (shen.toplineread_loop (read-byte (stinput)) (append V2385 (cons V2384 ()))))))
|
85
85
|
|
86
86
|
(defun shen.hat () 94)
|
87
87
|
|
@@ -89,7 +89,7 @@ port " (shen.app (value *port*) (cn " ported by " (shen.app (value *porters*) "
|
|
89
89
|
|
90
90
|
(defun shen.carriage-return () 13)
|
91
91
|
|
92
|
-
(defun tc (
|
92
|
+
(defun tc (V2390) (cond ((= + V2390) (set shen.*tc* true)) ((= - V2390) (set shen.*tc* false)) (true (simple-error "tc expects a + or -"))))
|
93
93
|
|
94
94
|
(defun shen.prompt () (if (value shen.*tc*) (shen.prhush (cn "
|
95
95
|
|
@@ -97,16 +97,16 @@ port " (shen.app (value *port*) (cn " ported by " (shen.app (value *porters*) "
|
|
97
97
|
|
98
98
|
(" (shen.app (length (value shen.*history*)) "-) " shen.a)) (stoutput))))
|
99
99
|
|
100
|
-
(defun shen.toplevel (
|
100
|
+
(defun shen.toplevel (V2391) (shen.toplevel_evaluate V2391 (value shen.*tc*)))
|
101
101
|
|
102
|
-
(defun shen.find-past-inputs (
|
102
|
+
(defun shen.find-past-inputs (V2392 V2393) (let F (shen.find V2392 V2393) (if (empty? F) (simple-error "input not found
|
103
103
|
") F)))
|
104
104
|
|
105
|
-
(defun shen.make-key (
|
105
|
+
(defun shen.make-key (V2394 V2395) (let Atom (hd (compile (lambda X2366 (shen.<st_input> X2366)) V2394 (lambda E (if (cons? E) (simple-error (cn "parse error here: " (shen.app E "
|
106
106
|
" shen.s))) (simple-error "parse error
|
107
|
-
"))))) (if (integer? Atom) (lambda X (= X (nth (+ Atom 1) (reverse
|
107
|
+
"))))) (if (integer? Atom) (lambda X (= X (nth (+ Atom 1) (reverse V2395)))) (lambda X (shen.prefix? V2394 (shen.trim-gubbins (snd X)))))))
|
108
108
|
|
109
|
-
(defun shen.trim-gubbins (
|
109
|
+
(defun shen.trim-gubbins (V2396) (cond ((and (cons? V2396) (= (hd V2396) (shen.space))) (shen.trim-gubbins (tl V2396))) ((and (cons? V2396) (= (hd V2396) (shen.newline))) (shen.trim-gubbins (tl V2396))) ((and (cons? V2396) (= (hd V2396) (shen.carriage-return))) (shen.trim-gubbins (tl V2396))) ((and (cons? V2396) (= (hd V2396) (shen.tab))) (shen.trim-gubbins (tl V2396))) ((and (cons? V2396) (= (hd V2396) (shen.left-round))) (shen.trim-gubbins (tl V2396))) (true V2396)))
|
110
110
|
|
111
111
|
(defun shen.space () 32)
|
112
112
|
|
@@ -114,22 +114,22 @@ port " (shen.app (value *port*) (cn " ported by " (shen.app (value *porters*) "
|
|
114
114
|
|
115
115
|
(defun shen.left-round () 40)
|
116
116
|
|
117
|
-
(defun shen.find (
|
117
|
+
(defun shen.find (V2403 V2404) (cond ((= () V2404) ()) ((and (cons? V2404) (V2403 (hd V2404))) (cons (hd V2404) (shen.find V2403 (tl V2404)))) ((cons? V2404) (shen.find V2403 (tl V2404))) (true (shen.sys-error shen.find))))
|
118
118
|
|
119
|
-
(defun shen.prefix? (
|
119
|
+
(defun shen.prefix? (V2415 V2416) (cond ((= () V2415) true) ((and (cons? V2415) (and (cons? V2416) (= (hd V2416) (hd V2415)))) (shen.prefix? (tl V2415) (tl V2416))) (true false)))
|
120
120
|
|
121
|
-
(defun shen.print-past-inputs (
|
121
|
+
(defun shen.print-past-inputs (V2426 V2427 V2428) (cond ((= () V2427) _) ((and (cons? V2427) (not (V2426 (hd V2427)))) (shen.print-past-inputs V2426 (tl V2427) (+ V2428 1))) ((and (cons? V2427) (tuple? (hd V2427))) (do (shen.prhush (shen.app V2428 ". " shen.a) (stoutput)) (do (shen.prbytes (snd (hd V2427))) (shen.print-past-inputs V2426 (tl V2427) (+ V2428 1))))) (true (shen.sys-error shen.print-past-inputs))))
|
122
122
|
|
123
|
-
(defun shen.toplevel_evaluate (
|
123
|
+
(defun shen.toplevel_evaluate (V2429 V2430) (cond ((and (cons? V2429) (and (cons? (tl V2429)) (and (= : (hd (tl V2429))) (and (cons? (tl (tl V2429))) (and (= () (tl (tl (tl V2429)))) (= true V2430)))))) (shen.typecheck-and-evaluate (hd V2429) (hd (tl (tl V2429))))) ((and (cons? V2429) (cons? (tl V2429))) (do (shen.toplevel_evaluate (cons (hd V2429) ()) V2430) (do (nl 1) (shen.toplevel_evaluate (tl V2429) V2430)))) ((and (cons? V2429) (and (= () (tl V2429)) (= true V2430))) (shen.typecheck-and-evaluate (hd V2429) (gensym A))) ((and (cons? V2429) (and (= () (tl V2429)) (= false V2430))) (let Eval (shen.eval-without-macros (hd V2429)) (print Eval))) (true (shen.sys-error shen.toplevel_evaluate))))
|
124
124
|
|
125
|
-
(defun shen.typecheck-and-evaluate (
|
126
|
-
") (let Eval (shen.eval-without-macros
|
125
|
+
(defun shen.typecheck-and-evaluate (V2431 V2432) (let Typecheck (shen.typecheck V2431 V2432) (if (= Typecheck false) (simple-error "type error
|
126
|
+
") (let Eval (shen.eval-without-macros V2431) (let Type (shen.pretty-type Typecheck) (shen.prhush (shen.app Eval (cn " : " (shen.app Type "" shen.r)) shen.s) (stoutput)))))))
|
127
127
|
|
128
|
-
(defun shen.pretty-type (
|
128
|
+
(defun shen.pretty-type (V2433) (shen.mult_subst (value shen.*alphabet*) (shen.extract-pvars V2433) V2433))
|
129
129
|
|
130
|
-
(defun shen.extract-pvars (
|
130
|
+
(defun shen.extract-pvars (V2438) (cond ((shen.pvar? V2438) (cons V2438 ())) ((cons? V2438) (union (shen.extract-pvars (hd V2438)) (shen.extract-pvars (tl V2438)))) (true ())))
|
131
131
|
|
132
|
-
(defun shen.mult_subst (
|
132
|
+
(defun shen.mult_subst (V2443 V2444 V2445) (cond ((= () V2443) V2445) ((= () V2444) V2445) ((and (cons? V2443) (cons? V2444)) (shen.mult_subst (tl V2443) (tl V2444) (subst (hd V2443) (hd V2444) V2445))) (true (shen.sys-error shen.mult_subst))))
|
133
133
|
|
134
134
|
|
135
135
|
|
@@ -47,57 +47,57 @@
|
|
47
47
|
* explains this license in full. *
|
48
48
|
* *
|
49
49
|
*****************************************************************************************
|
50
|
-
"(defun shen.f_error (
|
51
|
-
" shen.a)) (stoutput)) (do (if (and (not (shen.tracked?
|
50
|
+
"(defun shen.f_error (V2115) (do (shen.prhush (cn "partial function " (shen.app V2115 ";
|
51
|
+
" shen.a)) (stoutput)) (do (if (and (not (shen.tracked? V2115)) (y-or-n? (cn "track " (shen.app V2115 "? " shen.a)))) (shen.track-function (ps V2115)) shen.ok) (simple-error "aborted"))))
|
52
52
|
|
53
|
-
(defun shen.tracked? (
|
53
|
+
(defun shen.tracked? (V2116) (element? V2116 (value shen.*tracking*)))
|
54
54
|
|
55
|
-
(defun track (
|
55
|
+
(defun track (V2117) (let Source (ps V2117) (shen.track-function Source)))
|
56
56
|
|
57
|
-
(defun shen.track-function (
|
57
|
+
(defun shen.track-function (V2118) (cond ((and (cons? V2118) (and (= defun (hd V2118)) (and (cons? (tl V2118)) (and (cons? (tl (tl V2118))) (and (cons? (tl (tl (tl V2118)))) (= () (tl (tl (tl (tl V2118)))))))))) (let KL (cons defun (cons (hd (tl V2118)) (cons (hd (tl (tl V2118))) (cons (shen.insert-tracking-code (hd (tl V2118)) (hd (tl (tl V2118))) (hd (tl (tl (tl V2118))))) ())))) (let Ob (eval KL) (let Tr (set shen.*tracking* (cons Ob (value shen.*tracking*))) Ob)))) (true (shen.sys-error shen.track-function))))
|
58
58
|
|
59
|
-
(defun shen.insert-tracking-code (
|
59
|
+
(defun shen.insert-tracking-code (V2119 V2120 V2121) (cons do (cons (cons set (cons shen.*call* (cons (cons + (cons (cons value (cons shen.*call* ())) (cons 1 ()))) ()))) (cons (cons do (cons (cons shen.input-track (cons (cons value (cons shen.*call* ())) (cons V2119 (cons (shen.cons_form V2120) ())))) (cons (cons do (cons (cons shen.terpri-or-read-char ()) (cons (cons let (cons Result (cons V2121 (cons (cons do (cons (cons shen.output-track (cons (cons value (cons shen.*call* ())) (cons V2119 (cons Result ())))) (cons (cons do (cons (cons set (cons shen.*call* (cons (cons - (cons (cons value (cons shen.*call* ())) (cons 1 ()))) ()))) (cons (cons do (cons (cons shen.terpri-or-read-char ()) (cons Result ()))) ()))) ()))) ())))) ()))) ()))) ()))))
|
60
60
|
|
61
61
|
(set shen.*step* false)
|
62
62
|
|
63
|
-
(defun step (
|
63
|
+
(defun step (V2126) (cond ((= + V2126) (set shen.*step* true)) ((= - V2126) (set shen.*step* false)) (true (simple-error "step expects a + or a -.
|
64
64
|
"))))
|
65
65
|
|
66
|
-
(defun spy (
|
66
|
+
(defun spy (V2131) (cond ((= + V2131) (set shen.*spy* true)) ((= - V2131) (set shen.*spy* false)) (true (simple-error "spy expects a + or a -.
|
67
67
|
"))))
|
68
68
|
|
69
69
|
(defun shen.terpri-or-read-char () (if (value shen.*step*) (shen.check-byte (read-byte (value *stinput*))) (nl 1)))
|
70
70
|
|
71
|
-
(defun shen.check-byte (
|
71
|
+
(defun shen.check-byte (V2136) (cond ((= V2136 (shen.hat)) (simple-error "aborted")) (true true)))
|
72
72
|
|
73
|
-
(defun shen.input-track (
|
74
|
-
" (shen.app (shen.spaces
|
75
|
-
" (shen.app (shen.spaces
|
73
|
+
(defun shen.input-track (V2137 V2138 V2139) (do (shen.prhush (cn "
|
74
|
+
" (shen.app (shen.spaces V2137) (cn "<" (shen.app V2137 (cn "> Inputs to " (shen.app V2138 (cn "
|
75
|
+
" (shen.app (shen.spaces V2137) "" shen.a)) shen.a)) shen.a)) shen.a)) (stoutput)) (shen.recursively-print V2139)))
|
76
76
|
|
77
|
-
(defun shen.recursively-print (
|
77
|
+
(defun shen.recursively-print (V2140) (cond ((= () V2140) (shen.prhush " ==>" (stoutput))) ((cons? V2140) (do (print (hd V2140)) (do (shen.prhush ", " (stoutput)) (shen.recursively-print (tl V2140))))) (true (shen.sys-error shen.recursively-print))))
|
78
78
|
|
79
|
-
(defun shen.spaces (
|
79
|
+
(defun shen.spaces (V2141) (cond ((= 0 V2141) "") (true (cn " " (shen.spaces (- V2141 1))))))
|
80
80
|
|
81
|
-
(defun shen.output-track (
|
82
|
-
" (shen.app (shen.spaces
|
83
|
-
" (shen.app (shen.spaces
|
81
|
+
(defun shen.output-track (V2142 V2143 V2144) (shen.prhush (cn "
|
82
|
+
" (shen.app (shen.spaces V2142) (cn "<" (shen.app V2142 (cn "> Output from " (shen.app V2143 (cn "
|
83
|
+
" (shen.app (shen.spaces V2142) (cn "==> " (shen.app V2144 "" shen.s)) shen.a)) shen.a)) shen.a)) shen.a)) (stoutput)))
|
84
84
|
|
85
|
-
(defun untrack (
|
85
|
+
(defun untrack (V2145) (eval (ps V2145)))
|
86
86
|
|
87
|
-
(defun profile (
|
87
|
+
(defun profile (V2146) (shen.profile-help (ps V2146)))
|
88
88
|
|
89
|
-
(defun shen.profile-help (
|
89
|
+
(defun shen.profile-help (V2151) (cond ((and (cons? V2151) (and (= defun (hd V2151)) (and (cons? (tl V2151)) (and (cons? (tl (tl V2151))) (and (cons? (tl (tl (tl V2151)))) (= () (tl (tl (tl (tl V2151)))))))))) (let G (gensym shen.f) (let Profile (cons defun (cons (hd (tl V2151)) (cons (hd (tl (tl V2151))) (cons (shen.profile-func (hd (tl V2151)) (hd (tl (tl V2151))) (cons G (hd (tl (tl V2151))))) ())))) (let Def (cons defun (cons G (cons (hd (tl (tl V2151))) (cons (subst G (hd (tl V2151)) (hd (tl (tl (tl V2151))))) ())))) (let CompileProfile (shen.eval-without-macros Profile) (let CompileG (shen.eval-without-macros Def) (hd (tl V2151)))))))) (true (simple-error "Cannot profile.
|
90
90
|
"))))
|
91
91
|
|
92
|
-
(defun unprofile (
|
92
|
+
(defun unprofile (V2152) (untrack V2152))
|
93
93
|
|
94
|
-
(defun shen.profile-func (
|
94
|
+
(defun shen.profile-func (V2153 V2154 V2155) (cons let (cons Start (cons (cons get-time (cons run ())) (cons (cons let (cons Result (cons V2155 (cons (cons let (cons Finish (cons (cons - (cons (cons get-time (cons run ())) (cons Start ()))) (cons (cons let (cons Record (cons (cons shen.put-profile (cons V2153 (cons (cons + (cons (cons shen.get-profile (cons V2153 ())) (cons Finish ()))) ()))) (cons Result ())))) ())))) ())))) ())))))
|
95
95
|
|
96
|
-
(defun profile-results (
|
96
|
+
(defun profile-results (V2156) (let Results (shen.get-profile V2156) (let Initialise (shen.put-profile V2156 0) (@p V2156 Results))))
|
97
97
|
|
98
|
-
(defun shen.get-profile (
|
98
|
+
(defun shen.get-profile (V2157) (trap-error (get V2157 profile (value *property-vector*)) (lambda E 0)))
|
99
99
|
|
100
|
-
(defun shen.put-profile (
|
100
|
+
(defun shen.put-profile (V2158 V2159) (put V2158 profile V2159 (value *property-vector*)))
|
101
101
|
|
102
102
|
|
103
103
|
|
@@ -47,18 +47,14 @@
|
|
47
47
|
* explains this license in full. *
|
48
48
|
* *
|
49
49
|
*****************************************************************************************
|
50
|
-
"(defun declare (
|
50
|
+
"(defun declare (V2161 V2162) (let Record (set shen.*signedfuncs* (cons (cons V2161 V2162) (value shen.*signedfuncs*))) (let Variancy (trap-error (shen.variancy-test V2161 V2162) (lambda E shen.skip)) (let Type (shen.rcons_form (shen.demodulate V2162)) (let F* (concat shen.type-signature-of- V2161) (let Parameters (shen.parameters 1) (let Clause (cons (cons F* (cons X ())) (cons :- (cons (cons (cons unify! (cons X (cons Type ()))) ()) ()))) (let AUM_instruction (shen.aum Clause Parameters) (let Code (shen.aum_to_shen AUM_instruction) (let ShenDef (cons define (cons F* (append Parameters (append (cons ProcessN (cons Continuation ())) (cons -> (cons Code ())))))) (let Eval (shen.eval-without-macros ShenDef) V2161)))))))))))
|
51
51
|
|
52
|
-
(defun shen.demodulate (
|
52
|
+
(defun shen.demodulate (V2163) (trap-error (let Demod (shen.walk (lambda X2160 (shen.demod X2160)) V2163) (if (= Demod V2163) V2163 (shen.demodulate Demod))) (lambda E V2163)))
|
53
53
|
|
54
|
-
(defun shen.
|
55
|
-
|
56
|
-
(defun shen.demod-atom (V2118) (let Val (assoc V2118 (value shen.*synonyms*)) (if (empty? Val) V2118 (tl Val))))
|
57
|
-
|
58
|
-
(defun shen.variancy-test (V2119 V2120) (let TypeF (shen.typecheck V2119 B) (let Check (if (= symbol TypeF) shen.skip (if (shen.variant? TypeF V2120) shen.skip (shen.prhush (cn "warning: changing the type of " (shen.app V2119 " may create errors
|
54
|
+
(defun shen.variancy-test (V2164 V2165) (let TypeF (shen.typecheck V2164 B) (let Check (if (= symbol TypeF) shen.skip (if (shen.variant? TypeF V2165) shen.skip (shen.prhush (cn "warning: changing the type of " (shen.app V2164 " may create errors
|
59
55
|
" shen.a)) (stoutput)))) shen.skip)))
|
60
56
|
|
61
|
-
(defun shen.variant? (
|
57
|
+
(defun shen.variant? (V2174 V2175) (cond ((= V2175 V2174) true) ((and (cons? V2174) (and (cons? V2175) (= (hd V2175) (hd V2174)))) (shen.variant? (tl V2174) (tl V2175))) ((and (cons? V2174) (and (cons? V2175) (and (shen.pvar? (hd V2174)) (variable? (hd V2175))))) (shen.variant? (subst shen.a (hd V2174) (tl V2174)) (subst shen.a (hd V2175) (tl V2175)))) ((and (cons? V2174) (and (cons? (hd V2174)) (and (cons? V2175) (cons? (hd V2175))))) (shen.variant? (append (hd V2174) (tl V2174)) (append (hd V2175) (tl V2175)))) (true false)))
|
62
58
|
|
63
59
|
(declare absvector? (cons A (cons --> (cons boolean ()))))
|
64
60
|
|
@@ -47,59 +47,59 @@
|
|
47
47
|
* explains this license in full. *
|
48
48
|
* *
|
49
49
|
*****************************************************************************************
|
50
|
-
"(defun pr (
|
50
|
+
"(defun pr (V2287 V2288) (trap-error (shen.prh V2287 V2288 0) (lambda E V2287)))
|
51
51
|
|
52
|
-
(defun shen.prh (
|
52
|
+
(defun shen.prh (V2289 V2290 V2291) (shen.prh V2289 V2290 (shen.write-char-and-inc V2289 V2290 V2291)))
|
53
53
|
|
54
|
-
(defun shen.write-char-and-inc (
|
54
|
+
(defun shen.write-char-and-inc (V2292 V2293 V2294) (do (write-byte (string->n (pos V2292 V2294)) V2293) (+ V2294 1)))
|
55
55
|
|
56
|
-
(defun print (
|
56
|
+
(defun print (V2295) (let String (shen.insert V2295 "~S") (let Print (shen.prhush String (stoutput)) V2295)))
|
57
57
|
|
58
|
-
(defun shen.prhush (
|
58
|
+
(defun shen.prhush (V2296 V2297) (if (value *hush*) V2296 (pr V2296 V2297)))
|
59
59
|
|
60
|
-
(defun shen.mkstr (
|
60
|
+
(defun shen.mkstr (V2298 V2299) (cond ((string? V2298) (shen.mkstr-l (shen.proc-nl V2298) V2299)) (true (shen.mkstr-r (cons shen.proc-nl (cons V2298 ())) V2299))))
|
61
61
|
|
62
|
-
(defun shen.mkstr-l (
|
62
|
+
(defun shen.mkstr-l (V2300 V2301) (cond ((= () V2301) V2300) ((cons? V2301) (shen.mkstr-l (shen.insert-l (hd V2301) V2300) (tl V2301))) (true (shen.sys-error shen.mkstr-l))))
|
63
63
|
|
64
|
-
(defun shen.insert-l (
|
64
|
+
(defun shen.insert-l (V2304 V2305) (cond ((= "" V2305) "") ((and (shen.+string? V2305) (and (= "~" (pos V2305 0)) (and (shen.+string? (tlstr V2305)) (= "A" (pos (tlstr V2305) 0))))) (cons shen.app (cons V2304 (cons (tlstr (tlstr V2305)) (cons shen.a ()))))) ((and (shen.+string? V2305) (and (= "~" (pos V2305 0)) (and (shen.+string? (tlstr V2305)) (= "R" (pos (tlstr V2305) 0))))) (cons shen.app (cons V2304 (cons (tlstr (tlstr V2305)) (cons shen.r ()))))) ((and (shen.+string? V2305) (and (= "~" (pos V2305 0)) (and (shen.+string? (tlstr V2305)) (= "S" (pos (tlstr V2305) 0))))) (cons shen.app (cons V2304 (cons (tlstr (tlstr V2305)) (cons shen.s ()))))) ((shen.+string? V2305) (shen.factor-cn (cons cn (cons (pos V2305 0) (cons (shen.insert-l V2304 (tlstr V2305)) ()))))) ((and (cons? V2305) (and (= cn (hd V2305)) (and (cons? (tl V2305)) (and (cons? (tl (tl V2305))) (= () (tl (tl (tl V2305)))))))) (cons cn (cons (hd (tl V2305)) (cons (shen.insert-l V2304 (hd (tl (tl V2305)))) ())))) ((and (cons? V2305) (and (= shen.app (hd V2305)) (and (cons? (tl V2305)) (and (cons? (tl (tl V2305))) (and (cons? (tl (tl (tl V2305)))) (= () (tl (tl (tl (tl V2305)))))))))) (cons shen.app (cons (hd (tl V2305)) (cons (shen.insert-l V2304 (hd (tl (tl V2305)))) (tl (tl (tl V2305))))))) (true (shen.sys-error shen.insert-l))))
|
65
65
|
|
66
|
-
(defun shen.factor-cn (
|
66
|
+
(defun shen.factor-cn (V2306) (cond ((and (cons? V2306) (and (= cn (hd V2306)) (and (cons? (tl V2306)) (and (cons? (tl (tl V2306))) (and (cons? (hd (tl (tl V2306)))) (and (= cn (hd (hd (tl (tl V2306))))) (and (cons? (tl (hd (tl (tl V2306))))) (and (cons? (tl (tl (hd (tl (tl V2306)))))) (and (= () (tl (tl (tl (hd (tl (tl V2306))))))) (and (= () (tl (tl (tl V2306)))) (and (string? (hd (tl V2306))) (string? (hd (tl (hd (tl (tl V2306))))))))))))))))) (cons cn (cons (cn (hd (tl V2306)) (hd (tl (hd (tl (tl V2306)))))) (tl (tl (hd (tl (tl V2306)))))))) (true V2306)))
|
67
67
|
|
68
|
-
(defun shen.proc-nl (
|
68
|
+
(defun shen.proc-nl (V2307) (cond ((= "" V2307) "") ((and (shen.+string? V2307) (and (= "~" (pos V2307 0)) (and (shen.+string? (tlstr V2307)) (= "%" (pos (tlstr V2307) 0))))) (cn (n->string 10) (shen.proc-nl (tlstr (tlstr V2307))))) ((shen.+string? V2307) (cn (pos V2307 0) (shen.proc-nl (tlstr V2307)))) (true (shen.sys-error shen.proc-nl))))
|
69
69
|
|
70
|
-
(defun shen.mkstr-r (
|
70
|
+
(defun shen.mkstr-r (V2308 V2309) (cond ((= () V2309) V2308) ((cons? V2309) (shen.mkstr-r (cons shen.insert (cons (hd V2309) (cons V2308 ()))) (tl V2309))) (true (shen.sys-error shen.mkstr-r))))
|
71
71
|
|
72
|
-
(defun shen.insert (
|
72
|
+
(defun shen.insert (V2310 V2311) (shen.insert-h V2310 V2311 ""))
|
73
73
|
|
74
|
-
(defun shen.insert-h (
|
74
|
+
(defun shen.insert-h (V2314 V2315 V2316) (cond ((= "" V2315) V2316) ((and (shen.+string? V2315) (and (= "~" (pos V2315 0)) (and (shen.+string? (tlstr V2315)) (= "A" (pos (tlstr V2315) 0))))) (cn V2316 (shen.app V2314 (tlstr (tlstr V2315)) shen.a))) ((and (shen.+string? V2315) (and (= "~" (pos V2315 0)) (and (shen.+string? (tlstr V2315)) (= "R" (pos (tlstr V2315) 0))))) (cn V2316 (shen.app V2314 (tlstr (tlstr V2315)) shen.r))) ((and (shen.+string? V2315) (and (= "~" (pos V2315 0)) (and (shen.+string? (tlstr V2315)) (= "S" (pos (tlstr V2315) 0))))) (cn V2316 (shen.app V2314 (tlstr (tlstr V2315)) shen.s))) ((shen.+string? V2315) (shen.insert-h V2314 (tlstr V2315) (cn V2316 (pos V2315 0)))) (true (shen.sys-error shen.insert-h))))
|
75
75
|
|
76
|
-
(defun shen.app (
|
76
|
+
(defun shen.app (V2317 V2318 V2319) (cn (shen.arg->str V2317 V2319) V2318))
|
77
77
|
|
78
|
-
(defun shen.arg->str (
|
78
|
+
(defun shen.arg->str (V2325 V2326) (cond ((= V2325 (fail)) "...") ((shen.list? V2325) (shen.list->str V2325 V2326)) ((string? V2325) (shen.str->str V2325 V2326)) ((absvector? V2325) (shen.vector->str V2325 V2326)) (true (shen.atom->str V2325))))
|
79
79
|
|
80
|
-
(defun shen.list->str (
|
80
|
+
(defun shen.list->str (V2327 V2328) (cond ((= shen.r V2328) (@s "(" (@s (shen.iter-list V2327 shen.r (shen.maxseq)) ")"))) (true (@s "[" (@s (shen.iter-list V2327 V2328 (shen.maxseq)) "]")))))
|
81
81
|
|
82
82
|
(defun shen.maxseq () (value *maximum-print-sequence-size*))
|
83
83
|
|
84
|
-
(defun shen.iter-list (
|
84
|
+
(defun shen.iter-list (V2339 V2340 V2341) (cond ((= () V2339) "") ((= 0 V2341) "... etc") ((and (cons? V2339) (= () (tl V2339))) (shen.arg->str (hd V2339) V2340)) ((cons? V2339) (@s (shen.arg->str (hd V2339) V2340) (@s " " (shen.iter-list (tl V2339) V2340 (- V2341 1))))) (true (@s "|" (@s " " (shen.arg->str V2339 V2340))))))
|
85
85
|
|
86
|
-
(defun shen.str->str (
|
86
|
+
(defun shen.str->str (V2346 V2347) (cond ((= shen.a V2347) V2346) (true (@s (n->string 34) (@s V2346 (n->string 34))))))
|
87
87
|
|
88
|
-
(defun shen.vector->str (
|
88
|
+
(defun shen.vector->str (V2348 V2349) (if (shen.print-vector? V2348) ((<-address V2348 0) V2348) (if (vector? V2348) (@s "<" (@s (shen.iter-vector V2348 1 V2349 (shen.maxseq)) ">")) (@s "<" (@s "<" (@s (shen.iter-vector V2348 0 V2349 (shen.maxseq)) ">>"))))))
|
89
89
|
|
90
|
-
(defun shen.print-vector? (
|
90
|
+
(defun shen.print-vector? (V2350) (let Zero (<-address V2350 0) (if (= Zero shen.tuple) true (if (= Zero shen.pvar) true (if (not (number? Zero)) (shen.fbound? Zero) false)))))
|
91
91
|
|
92
|
-
(defun shen.fbound? (
|
92
|
+
(defun shen.fbound? (V2351) (trap-error (do (ps V2351) true) (lambda E false)))
|
93
93
|
|
94
|
-
(defun shen.tuple (
|
94
|
+
(defun shen.tuple (V2352) (cn "(@p " (shen.app (<-address V2352 1) (cn " " (shen.app (<-address V2352 2) ")" shen.s)) shen.s)))
|
95
95
|
|
96
|
-
(defun shen.iter-vector (
|
96
|
+
(defun shen.iter-vector (V2359 V2360 V2361 V2362) (cond ((= 0 V2362) "... etc") (true (let Item (trap-error (<-address V2359 V2360) (lambda E shen.out-of-bounds)) (let Next (trap-error (<-address V2359 (+ V2360 1)) (lambda E shen.out-of-bounds)) (if (= Item shen.out-of-bounds) "" (if (= Next shen.out-of-bounds) (shen.arg->str Item V2361) (@s (shen.arg->str Item V2361) (@s " " (shen.iter-vector V2359 (+ V2360 1) V2361 (- V2362 1)))))))))))
|
97
97
|
|
98
|
-
(defun shen.atom->str (
|
98
|
+
(defun shen.atom->str (V2363) (trap-error (str V2363) (lambda E (shen.funexstring))))
|
99
99
|
|
100
100
|
(defun shen.funexstring () (@s "" (@s "f" (@s "u" (@s "n" (@s "e" (@s (shen.arg->str (gensym (intern "x")) shen.a) "")))))))
|
101
101
|
|
102
|
-
(defun shen.list? (
|
102
|
+
(defun shen.list? (V2364) (or (empty? V2364) (cons? V2364)))
|
103
103
|
|
104
104
|
|
105
105
|
|
@@ -47,61 +47,67 @@
|
|
47
47
|
* explains this license in full. *
|
48
48
|
* *
|
49
49
|
*****************************************************************************************
|
50
|
-
"(defun shen.yacc (
|
50
|
+
"(defun shen.yacc (V2180) (cond ((and (cons? V2180) (and (= defcc (hd V2180)) (and (cons? (tl V2180)) (and (cons? (tl (tl V2180))) (and (= { (hd (tl (tl V2180)))) (and (cons? (tl (tl (tl V2180)))) (and (cons? (tl (tl (tl (tl V2180))))) (and (= ==> (hd (tl (tl (tl (tl V2180)))))) (and (cons? (tl (tl (tl (tl (tl V2180)))))) (and (cons? (tl (tl (tl (tl (tl (tl V2180))))))) (= } (hd (tl (tl (tl (tl (tl (tl V2180)))))))))))))))))) (shen.yacc (cons defcc (cons (hd (tl V2180)) (tl (tl (tl (tl (tl (tl (tl V2180))))))))))) ((and (cons? V2180) (and (= defcc (hd V2180)) (cons? (tl V2180)))) (shen.yacc->shen (hd (tl V2180)) (tl (tl V2180)))) (true (shen.sys-error shen.yacc))))
|
51
51
|
|
52
|
-
(defun shen.yacc->shen (
|
52
|
+
(defun shen.yacc->shen (V2181 V2182) (let CCRules (shen.split_cc_rules true V2182 ()) (let CCBody (map (lambda X2178 (shen.cc_body X2178)) CCRules) (let YaccCases (shen.yacc_cases CCBody) (cons define (cons V2181 (cons Stream (cons -> (cons (shen.kill-code YaccCases) ())))))))))
|
53
53
|
|
54
|
-
(defun shen.
|
54
|
+
(defun shen.kill-code (V2183) (cond ((> (occurrences kill V2183) 0) (cons trap-error (cons V2183 (cons (cons lambda (cons E (cons (cons shen.analyse-kill (cons E ())) ()))) ())))) (true V2183)))
|
55
55
|
|
56
|
-
(defun
|
56
|
+
(defun kill () (simple-error "yacc kill"))
|
57
57
|
|
58
|
-
(defun shen.
|
58
|
+
(defun shen.analyse-kill (V2184) (let String (error-to-string V2184) (if (= String "yacc kill") (fail) V2184)))
|
59
|
+
|
60
|
+
(defun shen.split_cc_rules (V2187 V2188 V2189) (cond ((and (= () V2188) (= () V2189)) ()) ((= () V2188) (cons (shen.split_cc_rule V2187 (reverse V2189) ()) ())) ((and (cons? V2188) (= ; (hd V2188))) (cons (shen.split_cc_rule V2187 (reverse V2189) ()) (shen.split_cc_rules V2187 (tl V2188) ()))) ((cons? V2188) (shen.split_cc_rules V2187 (tl V2188) (cons (hd V2188) V2189))) (true (shen.sys-error shen.split_cc_rules))))
|
61
|
+
|
62
|
+
(defun shen.split_cc_rule (V2194 V2195 V2196) (cond ((and (cons? V2195) (and (= := (hd V2195)) (and (cons? (tl V2195)) (= () (tl (tl V2195)))))) (cons (reverse V2196) (tl V2195))) ((and (cons? V2195) (and (= := (hd V2195)) (and (cons? (tl V2195)) (and (cons? (tl (tl V2195))) (and (= where (hd (tl (tl V2195)))) (and (cons? (tl (tl (tl V2195)))) (= () (tl (tl (tl (tl V2195))))))))))) (cons (reverse V2196) (cons (cons where (cons (hd (tl (tl (tl V2195)))) (cons (hd (tl V2195)) ()))) ()))) ((= () V2195) (do (shen.semantic-completion-warning V2194 V2196) (shen.split_cc_rule V2194 (cons := (cons (shen.default_semantics (reverse V2196)) ())) V2196))) ((cons? V2195) (shen.split_cc_rule V2194 (tl V2195) (cons (hd V2195) V2196))) (true (shen.sys-error shen.split_cc_rule))))
|
63
|
+
|
64
|
+
(defun shen.semantic-completion-warning (V2205 V2206) (cond ((= true V2205) (do (shen.prhush "warning: " (stoutput)) (do (map (lambda X (shen.prhush (shen.app X " " shen.a) (stoutput))) (reverse V2206)) (shen.prhush "has no semantics.
|
59
65
|
" (stoutput))))) (true shen.skip)))
|
60
66
|
|
61
|
-
(defun shen.default_semantics (
|
67
|
+
(defun shen.default_semantics (V2207) (cond ((= () V2207) ()) ((and (cons? V2207) (and (= () (tl V2207)) (shen.grammar_symbol? (hd V2207)))) (hd V2207)) ((and (cons? V2207) (shen.grammar_symbol? (hd V2207))) (cons append (cons (hd V2207) (cons (shen.default_semantics (tl V2207)) ())))) ((cons? V2207) (cons cons (cons (hd V2207) (cons (shen.default_semantics (tl V2207)) ())))) (true (shen.sys-error shen.default_semantics))))
|
62
68
|
|
63
|
-
(defun shen.grammar_symbol? (
|
69
|
+
(defun shen.grammar_symbol? (V2208) (and (symbol? V2208) (let Cs (shen.strip-pathname (explode V2208)) (and (= (hd Cs) "<") (= (hd (reverse Cs)) ">")))))
|
64
70
|
|
65
|
-
(defun shen.yacc_cases (
|
71
|
+
(defun shen.yacc_cases (V2209) (cond ((and (cons? V2209) (= () (tl V2209))) (hd V2209)) ((cons? V2209) (let P YaccParse (cons let (cons P (cons (hd V2209) (cons (cons if (cons (cons = (cons P (cons (cons fail ()) ()))) (cons (shen.yacc_cases (tl V2209)) (cons P ())))) ())))))) (true (shen.sys-error shen.yacc_cases))))
|
66
72
|
|
67
|
-
(defun shen.cc_body (
|
73
|
+
(defun shen.cc_body (V2210) (cond ((and (cons? V2210) (and (cons? (tl V2210)) (= () (tl (tl V2210))))) (shen.syntax (hd V2210) Stream (hd (tl V2210)))) (true (shen.sys-error shen.cc_body))))
|
68
74
|
|
69
|
-
(defun shen.syntax (
|
75
|
+
(defun shen.syntax (V2211 V2212 V2213) (cond ((and (= () V2211) (and (cons? V2213) (and (= where (hd V2213)) (and (cons? (tl V2213)) (and (cons? (tl (tl V2213))) (= () (tl (tl (tl V2213))))))))) (cons if (cons (shen.semantics (hd (tl V2213))) (cons (cons shen.pair (cons (cons hd (cons V2212 ())) (cons (shen.semantics (hd (tl (tl V2213)))) ()))) (cons (cons fail ()) ()))))) ((= () V2211) (cons shen.pair (cons (cons hd (cons V2212 ())) (cons (shen.semantics V2213) ())))) ((cons? V2211) (if (shen.grammar_symbol? (hd V2211)) (shen.recursive_descent V2211 V2212 V2213) (if (variable? (hd V2211)) (shen.variable-match V2211 V2212 V2213) (if (shen.jump_stream? (hd V2211)) (shen.jump_stream V2211 V2212 V2213) (if (shen.terminal? (hd V2211)) (shen.check_stream V2211 V2212 V2213) (if (cons? (hd V2211)) (shen.list-stream (shen.decons (hd V2211)) (tl V2211) V2212 V2213) (simple-error (shen.app (hd V2211) " is not legal syntax
|
70
76
|
" shen.a)))))))) (true (shen.sys-error shen.syntax))))
|
71
77
|
|
72
|
-
(defun shen.list-stream (
|
78
|
+
(defun shen.list-stream (V2214 V2215 V2216 V2217) (let Test (cons and (cons (cons cons? (cons (cons hd (cons V2216 ())) ())) (cons (cons cons? (cons (cons hd (cons (cons hd (cons V2216 ())) ())) ())) ()))) (let Placeholder (gensym shen.place) (let RunOn (shen.syntax V2215 (cons shen.pair (cons (cons tl (cons (cons hd (cons V2216 ())) ())) (cons (cons hd (cons (cons tl (cons V2216 ())) ())) ()))) V2217) (let Action (shen.insert-runon RunOn Placeholder (shen.syntax V2214 (cons shen.pair (cons (cons hd (cons (cons hd (cons V2216 ())) ())) (cons (cons hd (cons (cons tl (cons V2216 ())) ())) ()))) Placeholder)) (cons if (cons Test (cons Action (cons (cons fail ()) ())))))))))
|
73
79
|
|
74
|
-
(defun shen.decons (
|
80
|
+
(defun shen.decons (V2218) (cond ((and (cons? V2218) (and (= cons (hd V2218)) (and (cons? (tl V2218)) (and (cons? (tl (tl V2218))) (and (= () (hd (tl (tl V2218)))) (= () (tl (tl (tl V2218))))))))) (cons (hd (tl V2218)) ())) ((and (cons? V2218) (and (= cons (hd V2218)) (and (cons? (tl V2218)) (and (cons? (tl (tl V2218))) (= () (tl (tl (tl V2218)))))))) (cons (hd (tl V2218)) (shen.decons (hd (tl (tl V2218)))))) (true V2218)))
|
75
81
|
|
76
|
-
(defun shen.insert-runon (
|
82
|
+
(defun shen.insert-runon (V2229 V2230 V2231) (cond ((and (cons? V2231) (and (= shen.pair (hd V2231)) (and (cons? (tl V2231)) (and (cons? (tl (tl V2231))) (and (= () (tl (tl (tl V2231)))) (= (hd (tl (tl V2231))) V2230)))))) V2229) ((cons? V2231) (map (lambda Z (shen.insert-runon V2229 V2230 Z)) V2231)) (true V2231)))
|
77
83
|
|
78
|
-
(defun shen.strip-pathname (
|
84
|
+
(defun shen.strip-pathname (V2237) (cond ((not (element? "." V2237)) V2237) ((cons? V2237) (shen.strip-pathname (tl V2237))) (true (shen.sys-error shen.strip-pathname))))
|
79
85
|
|
80
|
-
(defun shen.recursive_descent (
|
86
|
+
(defun shen.recursive_descent (V2238 V2239 V2240) (cond ((cons? V2238) (let Test (cons (hd V2238) (cons V2239 ())) (let Action (shen.syntax (tl V2238) (concat Parse_ (hd V2238)) V2240) (let Else (cons fail ()) (cons let (cons (concat Parse_ (hd V2238)) (cons Test (cons (cons if (cons (cons not (cons (cons = (cons (cons fail ()) (cons (concat Parse_ (hd V2238)) ()))) ())) (cons Action (cons Else ())))) ())))))))) (true (shen.sys-error shen.recursive_descent))))
|
81
87
|
|
82
|
-
(defun shen.variable-match (
|
88
|
+
(defun shen.variable-match (V2241 V2242 V2243) (cond ((cons? V2241) (let Test (cons cons? (cons (cons hd (cons V2242 ())) ())) (let Action (cons let (cons (concat Parse_ (hd V2241)) (cons (cons hd (cons (cons hd (cons V2242 ())) ())) (cons (shen.syntax (tl V2241) (cons shen.pair (cons (cons tl (cons (cons hd (cons V2242 ())) ())) (cons (cons shen.hdtl (cons V2242 ())) ()))) V2243) ())))) (let Else (cons fail ()) (cons if (cons Test (cons Action (cons Else ())))))))) (true (shen.sys-error shen.variable-match))))
|
83
89
|
|
84
|
-
(defun shen.terminal? (
|
90
|
+
(defun shen.terminal? (V2252) (cond ((cons? V2252) false) ((variable? V2252) false) (true true)))
|
85
91
|
|
86
|
-
(defun shen.jump_stream? (
|
92
|
+
(defun shen.jump_stream? (V2257) (cond ((= V2257 _) true) (true false)))
|
87
93
|
|
88
|
-
(defun shen.check_stream (
|
94
|
+
(defun shen.check_stream (V2258 V2259 V2260) (cond ((cons? V2258) (let Test (cons and (cons (cons cons? (cons (cons hd (cons V2259 ())) ())) (cons (cons = (cons (hd V2258) (cons (cons hd (cons (cons hd (cons V2259 ())) ())) ()))) ()))) (let Action (shen.syntax (tl V2258) (cons shen.pair (cons (cons tl (cons (cons hd (cons V2259 ())) ())) (cons (cons shen.hdtl (cons V2259 ())) ()))) V2260) (let Else (cons fail ()) (cons if (cons Test (cons Action (cons Else ())))))))) (true (shen.sys-error shen.check_stream))))
|
89
95
|
|
90
|
-
(defun shen.jump_stream (
|
96
|
+
(defun shen.jump_stream (V2261 V2262 V2263) (cond ((cons? V2261) (let Test (cons cons? (cons (cons hd (cons V2262 ())) ())) (let Action (shen.syntax (tl V2261) (cons shen.pair (cons (cons tl (cons (cons hd (cons V2262 ())) ())) (cons (cons shen.hdtl (cons V2262 ())) ()))) V2263) (let Else (cons fail ()) (cons if (cons Test (cons Action (cons Else ())))))))) (true (shen.sys-error shen.jump_stream))))
|
91
97
|
|
92
|
-
(defun shen.semantics (
|
98
|
+
(defun shen.semantics (V2264) (cond ((= () V2264) ()) ((shen.grammar_symbol? V2264) (cons shen.hdtl (cons (concat Parse_ V2264) ()))) ((variable? V2264) (concat Parse_ V2264)) ((cons? V2264) (map (lambda X2179 (shen.semantics X2179)) V2264)) (true V2264)))
|
93
99
|
|
94
|
-
(defun shen.snd-or-fail (
|
100
|
+
(defun shen.snd-or-fail (V2271) (cond ((and (cons? V2271) (and (cons? (tl V2271)) (= () (tl (tl V2271))))) (hd (tl V2271))) (true (fail))))
|
95
101
|
|
96
102
|
(defun fail () shen.fail!)
|
97
103
|
|
98
|
-
(defun shen.pair (
|
104
|
+
(defun shen.pair (V2272 V2273) (cons V2272 (cons V2273 ())))
|
99
105
|
|
100
|
-
(defun shen.hdtl (
|
106
|
+
(defun shen.hdtl (V2274) (hd (tl V2274)))
|
101
107
|
|
102
|
-
(defun <!> (
|
108
|
+
(defun <!> (V2281) (cond ((and (cons? V2281) (and (cons? (tl V2281)) (= () (tl (tl V2281))))) (cons () (cons (hd V2281) ()))) (true (fail))))
|
103
109
|
|
104
|
-
(defun <e> (
|
110
|
+
(defun <e> (V2286) (cond ((and (cons? V2286) (and (cons? (tl V2286)) (= () (tl (tl V2286))))) (cons (hd V2286) (cons () ()))) (true (shen.sys-error <e>))))
|
105
111
|
|
106
112
|
|
107
113
|
|
data/shen-ruby.gemspec
CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.email = ["greg@sourcematters.org"]
|
13
13
|
s.homepage = "https://github.com/gregspurrier/shen-ruby"
|
14
14
|
s.summary = %q{ShenRuby is a Ruby port of the Shen programming language}
|
15
|
-
s.description = %q{ShenRuby is a port of the Shen programming language to Ruby. It currently supports Shen version
|
15
|
+
s.description = %q{ShenRuby is a port of the Shen programming language to Ruby. It currently supports Shen version 15.}
|
16
16
|
|
17
17
|
s.required_ruby_version = ">= 1.9.3"
|
18
18
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shen-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Greg Spurrier
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-02-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: '2.12'
|
28
28
|
description: ShenRuby is a port of the Shen programming language to Ruby. It currently
|
29
|
-
supports Shen version
|
29
|
+
supports Shen version 15.
|
30
30
|
email:
|
31
31
|
- greg@sourcematters.org
|
32
32
|
executables:
|