shen-ruby 0.14.0 → 0.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/HISTORY.md +6 -3
- data/README.md +10 -7
- data/bin/shen-ruby +21 -0
- data/bin/shen_ruby +21 -0
- data/lib/shen_ruby/converters.rb +2 -4
- data/lib/shen_ruby/shen.rb +1 -1
- data/lib/shen_ruby/version.rb +1 -1
- data/shen/release/klambda/core.kl +67 -63
- data/shen/release/klambda/declarations.kl +92 -84
- data/shen/release/klambda/load.kl +15 -15
- data/shen/release/klambda/macros.kl +34 -33
- data/shen/release/klambda/prolog.kl +96 -98
- data/shen/release/klambda/reader.kl +83 -83
- data/shen/release/klambda/sequent.kl +55 -55
- data/shen/release/klambda/sys.kl +106 -101
- data/shen/release/klambda/t-star.kl +41 -41
- data/shen/release/klambda/toplevel.kl +21 -21
- data/shen/release/klambda/track.kl +25 -25
- data/shen/release/klambda/types.kl +6 -4
- data/shen/release/klambda/writer.kl +25 -25
- data/shen/release/klambda/yacc.kl +28 -28
- data/shen-ruby.gemspec +3 -3
- metadata +9 -5
@@ -36,27 +36,27 @@ port " (shen.app (value *port*) (cn " ported by " (shen.app (value *porters*) "
|
|
36
36
|
|
37
37
|
(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 ()))))))))))
|
38
38
|
|
39
|
-
(defun shen.multiple-set (
|
39
|
+
(defun shen.multiple-set (V18411) (cond ((= () V18411) ()) ((and (cons? V18411) (cons? (tl V18411))) (do (set (hd V18411) (hd (tl V18411))) (shen.multiple-set (tl (tl V18411))))) (true (shen.f_error shen.multiple-set))))
|
40
40
|
|
41
|
-
(defun destroy (
|
41
|
+
(defun destroy (V18413) (declare V18413 symbol))
|
42
42
|
|
43
43
|
(set shen.*history* ())
|
44
44
|
|
45
45
|
(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)))))))
|
46
46
|
|
47
|
-
(defun shen.retrieve-from-history-if-needed (
|
47
|
+
(defun shen.retrieve-from-history-if-needed (V18425 V18426) (cond ((and (tuple? V18425) (and (cons? (snd V18425)) (element? (hd (snd V18425)) (cons (shen.space) (cons (shen.newline) ()))))) (shen.retrieve-from-history-if-needed (@p (fst V18425) (tl (snd V18425))) V18426)) ((and (tuple? V18425) (and (cons? (snd V18425)) (and (cons? (tl (snd V18425))) (and (= () (tl (tl (snd V18425)))) (and (cons? V18426) (and (= (hd (snd V18425)) (shen.exclamation)) (= (hd (tl (snd V18425))) (shen.exclamation)))))))) (let PastPrint (shen.prbytes (snd (hd V18426))) (hd V18426))) ((and (tuple? V18425) (and (cons? (snd V18425)) (= (hd (snd V18425)) (shen.exclamation)))) (let Key? (shen.make-key (tl (snd V18425)) V18426) (let Find (head (shen.find-past-inputs Key? V18426)) (let PastPrint (shen.prbytes (snd Find)) Find)))) ((and (tuple? V18425) (and (cons? (snd V18425)) (and (= () (tl (snd V18425))) (= (hd (snd V18425)) (shen.percent))))) (do (shen.print-past-inputs (lambda X true) (reverse V18426) 0) (abort))) ((and (tuple? V18425) (and (cons? (snd V18425)) (= (hd (snd V18425)) (shen.percent)))) (let Key? (shen.make-key (tl (snd V18425)) V18426) (let Pastprint (shen.print-past-inputs Key? (reverse V18426) 0) (abort)))) (true V18425)))
|
48
48
|
|
49
49
|
(defun shen.percent () 37)
|
50
50
|
|
51
51
|
(defun shen.exclamation () 33)
|
52
52
|
|
53
|
-
(defun shen.prbytes (
|
53
|
+
(defun shen.prbytes (V18428) (do (map (lambda Byte (pr (n->string Byte) (stoutput))) V18428) (nl 1)))
|
54
54
|
|
55
|
-
(defun shen.update_history (
|
55
|
+
(defun shen.update_history (V18431 V18432) (set shen.*history* (cons V18431 V18432)))
|
56
56
|
|
57
57
|
(defun shen.toplineread () (shen.toplineread_loop (read-byte (stinput)) ()))
|
58
58
|
|
59
|
-
(defun shen.toplineread_loop (
|
59
|
+
(defun shen.toplineread_loop (V18436 V18437) (cond ((= V18436 (shen.hat)) (simple-error "line read aborted")) ((element? V18436 (cons (shen.newline) (cons (shen.carriage-return) ()))) (let Line (compile (lambda X (shen.<st_input> X)) V18437 (lambda E shen.nextline)) (let It (shen.record-it V18437) (if (or (= Line shen.nextline) (empty? Line)) (shen.toplineread_loop (read-byte (stinput)) (append V18437 (cons V18436 ()))) (@p Line V18437))))) (true (shen.toplineread_loop (read-byte (stinput)) (append V18437 (cons V18436 ()))))))
|
60
60
|
|
61
61
|
(defun shen.hat () 94)
|
62
62
|
|
@@ -64,7 +64,7 @@ port " (shen.app (value *port*) (cn " ported by " (shen.app (value *porters*) "
|
|
64
64
|
|
65
65
|
(defun shen.carriage-return () 13)
|
66
66
|
|
67
|
-
(defun tc (
|
67
|
+
(defun tc (V18443) (cond ((= + V18443) (set shen.*tc* true)) ((= - V18443) (set shen.*tc* false)) (true (simple-error "tc expects a + or -"))))
|
68
68
|
|
69
69
|
(defun shen.prompt () (if (value shen.*tc*) (shen.prhush (cn "
|
70
70
|
|
@@ -72,16 +72,16 @@ port " (shen.app (value *port*) (cn " ported by " (shen.app (value *porters*) "
|
|
72
72
|
|
73
73
|
(" (shen.app (length (value shen.*history*)) "-) " shen.a)) (stoutput))))
|
74
74
|
|
75
|
-
(defun shen.toplevel (
|
75
|
+
(defun shen.toplevel (V18445) (shen.toplevel_evaluate V18445 (value shen.*tc*)))
|
76
76
|
|
77
|
-
(defun shen.find-past-inputs (
|
77
|
+
(defun shen.find-past-inputs (V18448 V18449) (let F (shen.find V18448 V18449) (if (empty? F) (simple-error "input not found
|
78
78
|
") F)))
|
79
79
|
|
80
|
-
(defun shen.make-key (
|
80
|
+
(defun shen.make-key (V18452 V18453) (let Atom (hd (compile (lambda X (shen.<st_input> X)) V18452 (lambda E (if (cons? E) (simple-error (cn "parse error here: " (shen.app E "
|
81
81
|
" shen.s))) (simple-error "parse error
|
82
|
-
"))))) (if (integer? Atom) (lambda X (= X (nth (+ Atom 1) (reverse
|
82
|
+
"))))) (if (integer? Atom) (lambda X (= X (nth (+ Atom 1) (reverse V18453)))) (lambda X (shen.prefix? V18452 (shen.trim-gubbins (snd X)))))))
|
83
83
|
|
84
|
-
(defun shen.trim-gubbins (
|
84
|
+
(defun shen.trim-gubbins (V18455) (cond ((and (cons? V18455) (= (hd V18455) (shen.space))) (shen.trim-gubbins (tl V18455))) ((and (cons? V18455) (= (hd V18455) (shen.newline))) (shen.trim-gubbins (tl V18455))) ((and (cons? V18455) (= (hd V18455) (shen.carriage-return))) (shen.trim-gubbins (tl V18455))) ((and (cons? V18455) (= (hd V18455) (shen.tab))) (shen.trim-gubbins (tl V18455))) ((and (cons? V18455) (= (hd V18455) (shen.left-round))) (shen.trim-gubbins (tl V18455))) (true V18455)))
|
85
85
|
|
86
86
|
(defun shen.space () 32)
|
87
87
|
|
@@ -89,22 +89,22 @@ port " (shen.app (value *port*) (cn " ported by " (shen.app (value *porters*) "
|
|
89
89
|
|
90
90
|
(defun shen.left-round () 40)
|
91
91
|
|
92
|
-
(defun shen.find (
|
92
|
+
(defun shen.find (V18464 V18465) (cond ((= () V18465) ()) ((and (cons? V18465) (V18464 (hd V18465))) (cons (hd V18465) (shen.find V18464 (tl V18465)))) ((cons? V18465) (shen.find V18464 (tl V18465))) (true (shen.f_error shen.find))))
|
93
93
|
|
94
|
-
(defun shen.prefix? (
|
94
|
+
(defun shen.prefix? (V18479 V18480) (cond ((= () V18479) true) ((and (cons? V18479) (and (cons? V18480) (= (hd V18480) (hd V18479)))) (shen.prefix? (tl V18479) (tl V18480))) (true false)))
|
95
95
|
|
96
|
-
(defun shen.print-past-inputs (
|
96
|
+
(defun shen.print-past-inputs (V18492 V18493 V18494) (cond ((= () V18493) _) ((and (cons? V18493) (not (V18492 (hd V18493)))) (shen.print-past-inputs V18492 (tl V18493) (+ V18494 1))) ((and (cons? V18493) (tuple? (hd V18493))) (do (shen.prhush (shen.app V18494 ". " shen.a) (stoutput)) (do (shen.prbytes (snd (hd V18493))) (shen.print-past-inputs V18492 (tl V18493) (+ V18494 1))))) (true (shen.f_error shen.print-past-inputs))))
|
97
97
|
|
98
|
-
(defun shen.toplevel_evaluate (
|
98
|
+
(defun shen.toplevel_evaluate (V18497 V18498) (cond ((and (cons? V18497) (and (cons? (tl V18497)) (and (= : (hd (tl V18497))) (and (cons? (tl (tl V18497))) (and (= () (tl (tl (tl V18497)))) (= true V18498)))))) (shen.typecheck-and-evaluate (hd V18497) (hd (tl (tl V18497))))) ((and (cons? V18497) (cons? (tl V18497))) (do (shen.toplevel_evaluate (cons (hd V18497) ()) V18498) (do (nl 1) (shen.toplevel_evaluate (tl V18497) V18498)))) ((and (cons? V18497) (and (= () (tl V18497)) (= true V18498))) (shen.typecheck-and-evaluate (hd V18497) (gensym A))) ((and (cons? V18497) (and (= () (tl V18497)) (= false V18498))) (let Eval (shen.eval-without-macros (hd V18497)) (print Eval))) (true (shen.f_error shen.toplevel_evaluate))))
|
99
99
|
|
100
|
-
(defun shen.typecheck-and-evaluate (
|
101
|
-
") (let Eval (shen.eval-without-macros
|
100
|
+
(defun shen.typecheck-and-evaluate (V18501 V18502) (let Typecheck (shen.typecheck V18501 V18502) (if (= Typecheck false) (simple-error "type error
|
101
|
+
") (let Eval (shen.eval-without-macros V18501) (let Type (shen.pretty-type Typecheck) (shen.prhush (shen.app Eval (cn " : " (shen.app Type "" shen.r)) shen.s) (stoutput)))))))
|
102
102
|
|
103
|
-
(defun shen.pretty-type (
|
103
|
+
(defun shen.pretty-type (V18504) (shen.mult_subst (value shen.*alphabet*) (shen.extract-pvars V18504) V18504))
|
104
104
|
|
105
|
-
(defun shen.extract-pvars (
|
105
|
+
(defun shen.extract-pvars (V18510) (cond ((shen.pvar? V18510) (cons V18510 ())) ((cons? V18510) (union (shen.extract-pvars (hd V18510)) (shen.extract-pvars (tl V18510)))) (true ())))
|
106
106
|
|
107
|
-
(defun shen.mult_subst (
|
107
|
+
(defun shen.mult_subst (V18518 V18519 V18520) (cond ((= () V18518) V18520) ((= () V18519) V18520) ((and (cons? V18518) (cons? V18519)) (shen.mult_subst (tl V18518) (tl V18519) (subst (hd V18518) (hd V18519) V18520))) (true (shen.f_error shen.mult_subst))))
|
108
108
|
|
109
109
|
|
110
110
|
|
@@ -23,57 +23,57 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
23
23
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
24
24
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
25
25
|
|
26
|
-
(defun shen.f_error (
|
27
|
-
" shen.a)) (stoutput)) (do (if (and (not (shen.tracked?
|
26
|
+
(defun shen.f_error (V18522) (do (shen.prhush (cn "partial function " (shen.app V18522 ";
|
27
|
+
" shen.a)) (stoutput)) (do (if (and (not (shen.tracked? V18522)) (y-or-n? (cn "track " (shen.app V18522 "? " shen.a)))) (shen.track-function (ps V18522)) shen.ok) (simple-error "aborted"))))
|
28
28
|
|
29
|
-
(defun shen.tracked? (
|
29
|
+
(defun shen.tracked? (V18524) (element? V18524 (value shen.*tracking*)))
|
30
30
|
|
31
|
-
(defun track (
|
31
|
+
(defun track (V18526) (let Source (ps V18526) (shen.track-function Source)))
|
32
32
|
|
33
|
-
(defun shen.track-function (
|
33
|
+
(defun shen.track-function (V18528) (cond ((and (cons? V18528) (and (= defun (hd V18528)) (and (cons? (tl V18528)) (and (cons? (tl (tl V18528))) (and (cons? (tl (tl (tl V18528)))) (= () (tl (tl (tl (tl V18528)))))))))) (let KL (cons defun (cons (hd (tl V18528)) (cons (hd (tl (tl V18528))) (cons (shen.insert-tracking-code (hd (tl V18528)) (hd (tl (tl V18528))) (hd (tl (tl (tl V18528))))) ())))) (let Ob (eval-kl KL) (let Tr (set shen.*tracking* (cons Ob (value shen.*tracking*))) Ob)))) (true (shen.f_error shen.track-function))))
|
34
34
|
|
35
|
-
(defun shen.insert-tracking-code (
|
35
|
+
(defun shen.insert-tracking-code (V18532 V18533 V18534) (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 V18532 (cons (shen.cons_form V18533) ())))) (cons (cons do (cons (cons shen.terpri-or-read-char ()) (cons (cons let (cons Result (cons V18534 (cons (cons do (cons (cons shen.output-track (cons (cons value (cons shen.*call* ())) (cons V18532 (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 ()))) ()))) ()))) ())))) ()))) ()))) ()))))
|
36
36
|
|
37
37
|
(set shen.*step* false)
|
38
38
|
|
39
|
-
(defun step (
|
39
|
+
(defun step (V18540) (cond ((= + V18540) (set shen.*step* true)) ((= - V18540) (set shen.*step* false)) (true (simple-error "step expects a + or a -.
|
40
40
|
"))))
|
41
41
|
|
42
|
-
(defun spy (
|
42
|
+
(defun spy (V18546) (cond ((= + V18546) (set shen.*spy* true)) ((= - V18546) (set shen.*spy* false)) (true (simple-error "spy expects a + or a -.
|
43
43
|
"))))
|
44
44
|
|
45
45
|
(defun shen.terpri-or-read-char () (if (value shen.*step*) (shen.check-byte (read-byte (value *stinput*))) (nl 1)))
|
46
46
|
|
47
|
-
(defun shen.check-byte (
|
47
|
+
(defun shen.check-byte (V18552) (cond ((= V18552 (shen.hat)) (simple-error "aborted")) (true true)))
|
48
48
|
|
49
|
-
(defun shen.input-track (
|
50
|
-
" (shen.app (shen.spaces
|
51
|
-
" (shen.app (shen.spaces
|
49
|
+
(defun shen.input-track (V18556 V18557 V18558) (do (shen.prhush (cn "
|
50
|
+
" (shen.app (shen.spaces V18556) (cn "<" (shen.app V18556 (cn "> Inputs to " (shen.app V18557 (cn "
|
51
|
+
" (shen.app (shen.spaces V18556) "" shen.a)) shen.a)) shen.a)) shen.a)) (stoutput)) (shen.recursively-print V18558)))
|
52
52
|
|
53
|
-
(defun shen.recursively-print (
|
53
|
+
(defun shen.recursively-print (V18560) (cond ((= () V18560) (shen.prhush " ==>" (stoutput))) ((cons? V18560) (do (print (hd V18560)) (do (shen.prhush ", " (stoutput)) (shen.recursively-print (tl V18560))))) (true (shen.f_error shen.recursively-print))))
|
54
54
|
|
55
|
-
(defun shen.spaces (
|
55
|
+
(defun shen.spaces (V18562) (cond ((= 0 V18562) "") (true (cn " " (shen.spaces (- V18562 1))))))
|
56
56
|
|
57
|
-
(defun shen.output-track (
|
58
|
-
" (shen.app (shen.spaces
|
59
|
-
" (shen.app (shen.spaces
|
57
|
+
(defun shen.output-track (V18566 V18567 V18568) (shen.prhush (cn "
|
58
|
+
" (shen.app (shen.spaces V18566) (cn "<" (shen.app V18566 (cn "> Output from " (shen.app V18567 (cn "
|
59
|
+
" (shen.app (shen.spaces V18566) (cn "==> " (shen.app V18568 "" shen.s)) shen.a)) shen.a)) shen.a)) shen.a)) (stoutput)))
|
60
60
|
|
61
|
-
(defun untrack (
|
61
|
+
(defun untrack (V18570) (eval (ps V18570)))
|
62
62
|
|
63
|
-
(defun profile (
|
63
|
+
(defun profile (V18572) (shen.profile-help (ps V18572)))
|
64
64
|
|
65
|
-
(defun shen.profile-help (
|
65
|
+
(defun shen.profile-help (V18578) (cond ((and (cons? V18578) (and (= defun (hd V18578)) (and (cons? (tl V18578)) (and (cons? (tl (tl V18578))) (and (cons? (tl (tl (tl V18578)))) (= () (tl (tl (tl (tl V18578)))))))))) (let G (gensym shen.f) (let Profile (cons defun (cons (hd (tl V18578)) (cons (hd (tl (tl V18578))) (cons (shen.profile-func (hd (tl V18578)) (hd (tl (tl V18578))) (cons G (hd (tl (tl V18578))))) ())))) (let Def (cons defun (cons G (cons (hd (tl (tl V18578))) (cons (subst G (hd (tl V18578)) (hd (tl (tl (tl V18578))))) ())))) (let CompileProfile (shen.eval-without-macros Profile) (let CompileG (shen.eval-without-macros Def) (hd (tl V18578)))))))) (true (simple-error "Cannot profile.
|
66
66
|
"))))
|
67
67
|
|
68
|
-
(defun unprofile (
|
68
|
+
(defun unprofile (V18580) (untrack V18580))
|
69
69
|
|
70
|
-
(defun shen.profile-func (
|
70
|
+
(defun shen.profile-func (V18584 V18585 V18586) (cons let (cons Start (cons (cons get-time (cons run ())) (cons (cons let (cons Result (cons V18586 (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 V18584 (cons (cons + (cons (cons shen.get-profile (cons V18584 ())) (cons Finish ()))) ()))) (cons Result ())))) ())))) ())))) ())))))
|
71
71
|
|
72
|
-
(defun profile-results (
|
72
|
+
(defun profile-results (V18588) (let Results (shen.get-profile V18588) (let Initialise (shen.put-profile V18588 0) (@p V18588 Results))))
|
73
73
|
|
74
|
-
(defun shen.get-profile (
|
74
|
+
(defun shen.get-profile (V18590) (trap-error (get V18590 profile (value *property-vector*)) (lambda E 0)))
|
75
75
|
|
76
|
-
(defun shen.put-profile (
|
76
|
+
(defun shen.put-profile (V18593 V18594) (put V18593 profile V18594 (value *property-vector*)))
|
77
77
|
|
78
78
|
|
79
79
|
|
@@ -23,14 +23,14 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
23
23
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
24
24
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
25
25
|
|
26
|
-
(defun declare (
|
26
|
+
(defun declare (V18597 V18598) (let Record (set shen.*signedfuncs* (cons (cons V18597 V18598) (value shen.*signedfuncs*))) (let Variancy (trap-error (shen.variancy-test V18597 V18598) (lambda E shen.skip)) (let Type (shen.rcons_form (shen.demodulate V18598)) (let F* (concat shen.type-signature-of- V18597) (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) V18597)))))))))))
|
27
27
|
|
28
|
-
(defun shen.demodulate (
|
28
|
+
(defun shen.demodulate (V18600) (trap-error (let Demod (shen.walk (lambda Y (shen.demod Y)) V18600) (if (= Demod V18600) V18600 (shen.demodulate Demod))) (lambda E V18600)))
|
29
29
|
|
30
|
-
(defun shen.variancy-test (
|
30
|
+
(defun shen.variancy-test (V18603 V18604) (let TypeF (shen.typecheck V18603 B) (let Check (if (= symbol TypeF) shen.skip (if (shen.variant? TypeF V18604) shen.skip (shen.prhush (cn "warning: changing the type of " (shen.app V18603 " may create errors
|
31
31
|
" shen.a)) (stoutput)))) shen.skip)))
|
32
32
|
|
33
|
-
(defun shen.variant? (
|
33
|
+
(defun shen.variant? (V18617 V18618) (cond ((= V18618 V18617) true) ((and (cons? V18617) (and (cons? V18618) (= (hd V18618) (hd V18617)))) (shen.variant? (tl V18617) (tl V18618))) ((and (cons? V18617) (and (cons? V18618) (and (shen.pvar? (hd V18617)) (variable? (hd V18618))))) (shen.variant? (subst shen.a (hd V18617) (tl V18617)) (subst shen.a (hd V18618) (tl V18618)))) ((and (cons? V18617) (and (cons? (hd V18617)) (and (cons? V18618) (cons? (hd V18618))))) (shen.variant? (append (hd V18617) (tl V18617)) (append (hd V18618) (tl V18618)))) (true false)))
|
34
34
|
|
35
35
|
(declare absvector? (cons A (cons --> (cons boolean ()))))
|
36
36
|
|
@@ -92,6 +92,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
|
92
92
|
|
93
93
|
(declare fst (cons (cons A (cons * (cons B ()))) (cons --> (cons A ()))))
|
94
94
|
|
95
|
+
(declare function (cons (cons A (cons --> (cons B ()))) (cons --> (cons (cons A (cons --> (cons B ()))) ()))))
|
96
|
+
|
95
97
|
(declare gensym (cons symbol (cons --> (cons symbol ()))))
|
96
98
|
|
97
99
|
(declare <-vector (cons (cons vector (cons A ())) (cons --> (cons (cons number (cons --> (cons A ()))) ()))))
|
@@ -23,59 +23,59 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
23
23
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
24
24
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
25
25
|
|
26
|
-
(defun pr (
|
26
|
+
(defun pr (V18621 V18622) (trap-error (shen.prh V18621 V18622 0) (lambda E V18621)))
|
27
27
|
|
28
|
-
(defun shen.prh (
|
28
|
+
(defun shen.prh (V18626 V18627 V18628) (shen.prh V18626 V18627 (shen.write-char-and-inc V18626 V18627 V18628)))
|
29
29
|
|
30
|
-
(defun shen.write-char-and-inc (
|
30
|
+
(defun shen.write-char-and-inc (V18632 V18633 V18634) (do (write-byte (string->n (pos V18632 V18634)) V18633) (+ V18634 1)))
|
31
31
|
|
32
|
-
(defun print (
|
32
|
+
(defun print (V18636) (let String (shen.insert V18636 "~S") (let Print (shen.prhush String (stoutput)) V18636)))
|
33
33
|
|
34
|
-
(defun shen.prhush (
|
34
|
+
(defun shen.prhush (V18639 V18640) (if (value *hush*) V18639 (pr V18639 V18640)))
|
35
35
|
|
36
|
-
(defun shen.mkstr (
|
36
|
+
(defun shen.mkstr (V18643 V18644) (cond ((string? V18643) (shen.mkstr-l (shen.proc-nl V18643) V18644)) (true (shen.mkstr-r (cons shen.proc-nl (cons V18643 ())) V18644))))
|
37
37
|
|
38
|
-
(defun shen.mkstr-l (
|
38
|
+
(defun shen.mkstr-l (V18647 V18648) (cond ((= () V18648) V18647) ((cons? V18648) (shen.mkstr-l (shen.insert-l (hd V18648) V18647) (tl V18648))) (true (shen.f_error shen.mkstr-l))))
|
39
39
|
|
40
|
-
(defun shen.insert-l (
|
40
|
+
(defun shen.insert-l (V18653 V18654) (cond ((= "" V18654) "") ((and (shen.+string? V18654) (and (= "~" (pos V18654 0)) (and (shen.+string? (tlstr V18654)) (= "A" (pos (tlstr V18654) 0))))) (cons shen.app (cons V18653 (cons (tlstr (tlstr V18654)) (cons shen.a ()))))) ((and (shen.+string? V18654) (and (= "~" (pos V18654 0)) (and (shen.+string? (tlstr V18654)) (= "R" (pos (tlstr V18654) 0))))) (cons shen.app (cons V18653 (cons (tlstr (tlstr V18654)) (cons shen.r ()))))) ((and (shen.+string? V18654) (and (= "~" (pos V18654 0)) (and (shen.+string? (tlstr V18654)) (= "S" (pos (tlstr V18654) 0))))) (cons shen.app (cons V18653 (cons (tlstr (tlstr V18654)) (cons shen.s ()))))) ((shen.+string? V18654) (shen.factor-cn (cons cn (cons (pos V18654 0) (cons (shen.insert-l V18653 (tlstr V18654)) ()))))) ((and (cons? V18654) (and (= cn (hd V18654)) (and (cons? (tl V18654)) (and (cons? (tl (tl V18654))) (= () (tl (tl (tl V18654)))))))) (cons cn (cons (hd (tl V18654)) (cons (shen.insert-l V18653 (hd (tl (tl V18654)))) ())))) ((and (cons? V18654) (and (= shen.app (hd V18654)) (and (cons? (tl V18654)) (and (cons? (tl (tl V18654))) (and (cons? (tl (tl (tl V18654)))) (= () (tl (tl (tl (tl V18654)))))))))) (cons shen.app (cons (hd (tl V18654)) (cons (shen.insert-l V18653 (hd (tl (tl V18654)))) (tl (tl (tl V18654))))))) (true (shen.f_error shen.insert-l))))
|
41
41
|
|
42
|
-
(defun shen.factor-cn (
|
42
|
+
(defun shen.factor-cn (V18656) (cond ((and (cons? V18656) (and (= cn (hd V18656)) (and (cons? (tl V18656)) (and (cons? (tl (tl V18656))) (and (cons? (hd (tl (tl V18656)))) (and (= cn (hd (hd (tl (tl V18656))))) (and (cons? (tl (hd (tl (tl V18656))))) (and (cons? (tl (tl (hd (tl (tl V18656)))))) (and (= () (tl (tl (tl (hd (tl (tl V18656))))))) (and (= () (tl (tl (tl V18656)))) (and (string? (hd (tl V18656))) (string? (hd (tl (hd (tl (tl V18656))))))))))))))))) (cons cn (cons (cn (hd (tl V18656)) (hd (tl (hd (tl (tl V18656)))))) (tl (tl (hd (tl (tl V18656)))))))) (true V18656)))
|
43
43
|
|
44
|
-
(defun shen.proc-nl (
|
44
|
+
(defun shen.proc-nl (V18658) (cond ((= "" V18658) "") ((and (shen.+string? V18658) (and (= "~" (pos V18658 0)) (and (shen.+string? (tlstr V18658)) (= "%" (pos (tlstr V18658) 0))))) (cn (n->string 10) (shen.proc-nl (tlstr (tlstr V18658))))) ((shen.+string? V18658) (cn (pos V18658 0) (shen.proc-nl (tlstr V18658)))) (true (shen.f_error shen.proc-nl))))
|
45
45
|
|
46
|
-
(defun shen.mkstr-r (
|
46
|
+
(defun shen.mkstr-r (V18661 V18662) (cond ((= () V18662) V18661) ((cons? V18662) (shen.mkstr-r (cons shen.insert (cons (hd V18662) (cons V18661 ()))) (tl V18662))) (true (shen.f_error shen.mkstr-r))))
|
47
47
|
|
48
|
-
(defun shen.insert (
|
48
|
+
(defun shen.insert (V18665 V18666) (shen.insert-h V18665 V18666 ""))
|
49
49
|
|
50
|
-
(defun shen.insert-h (
|
50
|
+
(defun shen.insert-h (V18672 V18673 V18674) (cond ((= "" V18673) V18674) ((and (shen.+string? V18673) (and (= "~" (pos V18673 0)) (and (shen.+string? (tlstr V18673)) (= "A" (pos (tlstr V18673) 0))))) (cn V18674 (shen.app V18672 (tlstr (tlstr V18673)) shen.a))) ((and (shen.+string? V18673) (and (= "~" (pos V18673 0)) (and (shen.+string? (tlstr V18673)) (= "R" (pos (tlstr V18673) 0))))) (cn V18674 (shen.app V18672 (tlstr (tlstr V18673)) shen.r))) ((and (shen.+string? V18673) (and (= "~" (pos V18673 0)) (and (shen.+string? (tlstr V18673)) (= "S" (pos (tlstr V18673) 0))))) (cn V18674 (shen.app V18672 (tlstr (tlstr V18673)) shen.s))) ((shen.+string? V18673) (shen.insert-h V18672 (tlstr V18673) (cn V18674 (pos V18673 0)))) (true (shen.f_error shen.insert-h))))
|
51
51
|
|
52
|
-
(defun shen.app (
|
52
|
+
(defun shen.app (V18678 V18679 V18680) (cn (shen.arg->str V18678 V18680) V18679))
|
53
53
|
|
54
|
-
(defun shen.arg->str (
|
54
|
+
(defun shen.arg->str (V18688 V18689) (cond ((= V18688 (fail)) "...") ((shen.list? V18688) (shen.list->str V18688 V18689)) ((string? V18688) (shen.str->str V18688 V18689)) ((absvector? V18688) (shen.vector->str V18688 V18689)) (true (shen.atom->str V18688))))
|
55
55
|
|
56
|
-
(defun shen.list->str (
|
56
|
+
(defun shen.list->str (V18692 V18693) (cond ((= shen.r V18693) (@s "(" (@s (shen.iter-list V18692 shen.r (shen.maxseq)) ")"))) (true (@s "[" (@s (shen.iter-list V18692 V18693 (shen.maxseq)) "]")))))
|
57
57
|
|
58
58
|
(defun shen.maxseq () (value *maximum-print-sequence-size*))
|
59
59
|
|
60
|
-
(defun shen.iter-list (
|
60
|
+
(defun shen.iter-list (V18707 V18708 V18709) (cond ((= () V18707) "") ((= 0 V18709) "... etc") ((and (cons? V18707) (= () (tl V18707))) (shen.arg->str (hd V18707) V18708)) ((cons? V18707) (@s (shen.arg->str (hd V18707) V18708) (@s " " (shen.iter-list (tl V18707) V18708 (- V18709 1))))) (true (@s "|" (@s " " (shen.arg->str V18707 V18708))))))
|
61
61
|
|
62
|
-
(defun shen.str->str (
|
62
|
+
(defun shen.str->str (V18716 V18717) (cond ((= shen.a V18717) V18716) (true (@s (n->string 34) (@s V18716 (n->string 34))))))
|
63
63
|
|
64
|
-
(defun shen.vector->str (
|
64
|
+
(defun shen.vector->str (V18720 V18721) (if (shen.print-vector? V18720) ((function (<-address V18720 0)) V18720) (if (vector? V18720) (@s "<" (@s (shen.iter-vector V18720 1 V18721 (shen.maxseq)) ">")) (@s "<" (@s "<" (@s (shen.iter-vector V18720 0 V18721 (shen.maxseq)) ">>"))))))
|
65
65
|
|
66
|
-
(defun shen.print-vector? (
|
66
|
+
(defun shen.print-vector? (V18723) (let Zero (<-address V18723 0) (if (= Zero shen.tuple) true (if (= Zero shen.pvar) true (if (not (number? Zero)) (shen.fbound? Zero) false)))))
|
67
67
|
|
68
|
-
(defun shen.fbound? (
|
68
|
+
(defun shen.fbound? (V18725) (trap-error (do (ps V18725) true) (lambda E false)))
|
69
69
|
|
70
|
-
(defun shen.tuple (
|
70
|
+
(defun shen.tuple (V18727) (cn "(@p " (shen.app (<-address V18727 1) (cn " " (shen.app (<-address V18727 2) ")" shen.s)) shen.s)))
|
71
71
|
|
72
|
-
(defun shen.iter-vector (
|
72
|
+
(defun shen.iter-vector (V18738 V18739 V18740 V18741) (cond ((= 0 V18741) "... etc") (true (let Item (trap-error (<-address V18738 V18739) (lambda E shen.out-of-bounds)) (let Next (trap-error (<-address V18738 (+ V18739 1)) (lambda E shen.out-of-bounds)) (if (= Item shen.out-of-bounds) "" (if (= Next shen.out-of-bounds) (shen.arg->str Item V18740) (@s (shen.arg->str Item V18740) (@s " " (shen.iter-vector V18738 (+ V18739 1) V18740 (- V18741 1)))))))))))
|
73
73
|
|
74
|
-
(defun shen.atom->str (
|
74
|
+
(defun shen.atom->str (V18743) (trap-error (str V18743) (lambda E (shen.funexstring))))
|
75
75
|
|
76
76
|
(defun shen.funexstring () (@s "" (@s "f" (@s "u" (@s "n" (@s "e" (@s (shen.arg->str (gensym (intern "x")) shen.a) "")))))))
|
77
77
|
|
78
|
-
(defun shen.list? (
|
78
|
+
(defun shen.list? (V18745) (or (empty? V18745) (cons? V18745)))
|
79
79
|
|
80
80
|
|
81
81
|
|
@@ -23,65 +23,65 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
23
23
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
24
24
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
25
25
|
|
26
|
-
(defun shen.yacc (
|
26
|
+
(defun shen.yacc (V18747) (cond ((and (cons? V18747) (and (= defcc (hd V18747)) (cons? (tl V18747)))) (shen.yacc->shen (hd (tl V18747)) (tl (tl V18747)))) (true (shen.f_error shen.yacc))))
|
27
27
|
|
28
|
-
(defun shen.yacc->shen (
|
28
|
+
(defun shen.yacc->shen (V18750 V18751) (let CCRules (shen.split_cc_rules true V18751 ()) (let CCBody (map (lambda X (shen.cc_body X)) CCRules) (let YaccCases (shen.yacc_cases CCBody) (cons define (cons V18750 (cons Stream (cons -> (cons (shen.kill-code YaccCases) ())))))))))
|
29
29
|
|
30
|
-
(defun shen.kill-code (
|
30
|
+
(defun shen.kill-code (V18753) (cond ((> (occurrences kill V18753) 0) (cons trap-error (cons V18753 (cons (cons lambda (cons E (cons (cons shen.analyse-kill (cons E ())) ()))) ())))) (true V18753)))
|
31
31
|
|
32
32
|
(defun kill () (simple-error "yacc kill"))
|
33
33
|
|
34
|
-
(defun shen.analyse-kill (
|
34
|
+
(defun shen.analyse-kill (V18755) (let String (error-to-string V18755) (if (= String "yacc kill") (fail) V18755)))
|
35
35
|
|
36
|
-
(defun shen.split_cc_rules (
|
36
|
+
(defun shen.split_cc_rules (V18761 V18762 V18763) (cond ((and (= () V18762) (= () V18763)) ()) ((= () V18762) (cons (shen.split_cc_rule V18761 (reverse V18763) ()) ())) ((and (cons? V18762) (= ; (hd V18762))) (cons (shen.split_cc_rule V18761 (reverse V18763) ()) (shen.split_cc_rules V18761 (tl V18762) ()))) ((cons? V18762) (shen.split_cc_rules V18761 (tl V18762) (cons (hd V18762) V18763))) (true (shen.f_error shen.split_cc_rules))))
|
37
37
|
|
38
|
-
(defun shen.split_cc_rule (
|
38
|
+
(defun shen.split_cc_rule (V18771 V18772 V18773) (cond ((and (cons? V18772) (and (= := (hd V18772)) (and (cons? (tl V18772)) (= () (tl (tl V18772)))))) (cons (reverse V18773) (tl V18772))) ((and (cons? V18772) (and (= := (hd V18772)) (and (cons? (tl V18772)) (and (cons? (tl (tl V18772))) (and (= where (hd (tl (tl V18772)))) (and (cons? (tl (tl (tl V18772)))) (= () (tl (tl (tl (tl V18772))))))))))) (cons (reverse V18773) (cons (cons where (cons (hd (tl (tl (tl V18772)))) (cons (hd (tl V18772)) ()))) ()))) ((= () V18772) (do (shen.semantic-completion-warning V18771 V18773) (shen.split_cc_rule V18771 (cons := (cons (shen.default_semantics (reverse V18773)) ())) V18773))) ((cons? V18772) (shen.split_cc_rule V18771 (tl V18772) (cons (hd V18772) V18773))) (true (shen.f_error shen.split_cc_rule))))
|
39
39
|
|
40
|
-
(defun shen.semantic-completion-warning (
|
40
|
+
(defun shen.semantic-completion-warning (V18784 V18785) (cond ((= true V18784) (do (shen.prhush "warning: " (stoutput)) (do (map (lambda X (shen.prhush (shen.app X " " shen.a) (stoutput))) (reverse V18785)) (shen.prhush "has no semantics.
|
41
41
|
" (stoutput))))) (true shen.skip)))
|
42
42
|
|
43
|
-
(defun shen.default_semantics (
|
43
|
+
(defun shen.default_semantics (V18787) (cond ((= () V18787) ()) ((and (cons? V18787) (and (= () (tl V18787)) (shen.grammar_symbol? (hd V18787)))) (hd V18787)) ((and (cons? V18787) (shen.grammar_symbol? (hd V18787))) (cons append (cons (hd V18787) (cons (shen.default_semantics (tl V18787)) ())))) ((cons? V18787) (cons cons (cons (hd V18787) (cons (shen.default_semantics (tl V18787)) ())))) (true (shen.f_error shen.default_semantics))))
|
44
44
|
|
45
|
-
(defun shen.grammar_symbol? (
|
45
|
+
(defun shen.grammar_symbol? (V18789) (and (symbol? V18789) (let Cs (shen.strip-pathname (explode V18789)) (and (= (hd Cs) "<") (= (hd (reverse Cs)) ">")))))
|
46
46
|
|
47
|
-
(defun shen.yacc_cases (
|
47
|
+
(defun shen.yacc_cases (V18791) (cond ((and (cons? V18791) (= () (tl V18791))) (hd V18791)) ((cons? V18791) (let P YaccParse (cons let (cons P (cons (hd V18791) (cons (cons if (cons (cons = (cons P (cons (cons fail ()) ()))) (cons (shen.yacc_cases (tl V18791)) (cons P ())))) ())))))) (true (shen.f_error shen.yacc_cases))))
|
48
48
|
|
49
|
-
(defun shen.cc_body (
|
49
|
+
(defun shen.cc_body (V18793) (cond ((and (cons? V18793) (and (cons? (tl V18793)) (= () (tl (tl V18793))))) (shen.syntax (hd V18793) Stream (hd (tl V18793)))) (true (shen.f_error shen.cc_body))))
|
50
50
|
|
51
|
-
(defun shen.syntax (
|
51
|
+
(defun shen.syntax (V18797 V18798 V18799) (cond ((and (= () V18797) (and (cons? V18799) (and (= where (hd V18799)) (and (cons? (tl V18799)) (and (cons? (tl (tl V18799))) (= () (tl (tl (tl V18799))))))))) (cons if (cons (shen.semantics (hd (tl V18799))) (cons (cons shen.pair (cons (cons hd (cons V18798 ())) (cons (shen.semantics (hd (tl (tl V18799)))) ()))) (cons (cons fail ()) ()))))) ((= () V18797) (cons shen.pair (cons (cons hd (cons V18798 ())) (cons (shen.semantics V18799) ())))) ((cons? V18797) (if (shen.grammar_symbol? (hd V18797)) (shen.recursive_descent V18797 V18798 V18799) (if (variable? (hd V18797)) (shen.variable-match V18797 V18798 V18799) (if (shen.jump_stream? (hd V18797)) (shen.jump_stream V18797 V18798 V18799) (if (shen.terminal? (hd V18797)) (shen.check_stream V18797 V18798 V18799) (if (cons? (hd V18797)) (shen.list-stream (shen.decons (hd V18797)) (tl V18797) V18798 V18799) (simple-error (shen.app (hd V18797) " is not legal syntax
|
52
52
|
" shen.a)))))))) (true (shen.f_error shen.syntax))))
|
53
53
|
|
54
|
-
(defun shen.list-stream (
|
54
|
+
(defun shen.list-stream (V18804 V18805 V18806 V18807) (let Test (cons and (cons (cons cons? (cons (cons hd (cons V18806 ())) ())) (cons (cons cons? (cons (cons hd (cons (cons hd (cons V18806 ())) ())) ())) ()))) (let Placeholder (gensym shen.place) (let RunOn (shen.syntax V18805 (cons shen.pair (cons (cons tl (cons (cons hd (cons V18806 ())) ())) (cons (cons hd (cons (cons tl (cons V18806 ())) ())) ()))) V18807) (let Action (shen.insert-runon RunOn Placeholder (shen.syntax V18804 (cons shen.pair (cons (cons hd (cons (cons hd (cons V18806 ())) ())) (cons (cons hd (cons (cons tl (cons V18806 ())) ())) ()))) Placeholder)) (cons if (cons Test (cons Action (cons (cons fail ()) ())))))))))
|
55
55
|
|
56
|
-
(defun shen.decons (
|
56
|
+
(defun shen.decons (V18809) (cond ((and (cons? V18809) (and (= cons (hd V18809)) (and (cons? (tl V18809)) (and (cons? (tl (tl V18809))) (and (= () (hd (tl (tl V18809)))) (= () (tl (tl (tl V18809))))))))) (cons (hd (tl V18809)) ())) ((and (cons? V18809) (and (= cons (hd V18809)) (and (cons? (tl V18809)) (and (cons? (tl (tl V18809))) (= () (tl (tl (tl V18809)))))))) (cons (hd (tl V18809)) (shen.decons (hd (tl (tl V18809)))))) (true V18809)))
|
57
57
|
|
58
|
-
(defun shen.insert-runon (
|
58
|
+
(defun shen.insert-runon (V18824 V18825 V18826) (cond ((and (cons? V18826) (and (= shen.pair (hd V18826)) (and (cons? (tl V18826)) (and (cons? (tl (tl V18826))) (and (= () (tl (tl (tl V18826)))) (= (hd (tl (tl V18826))) V18825)))))) V18824) ((cons? V18826) (map (lambda Z (shen.insert-runon V18824 V18825 Z)) V18826)) (true V18826)))
|
59
59
|
|
60
|
-
(defun shen.strip-pathname (
|
60
|
+
(defun shen.strip-pathname (V18832) (cond ((not (element? "." V18832)) V18832) ((cons? V18832) (shen.strip-pathname (tl V18832))) (true (shen.f_error shen.strip-pathname))))
|
61
61
|
|
62
|
-
(defun shen.recursive_descent (
|
62
|
+
(defun shen.recursive_descent (V18836 V18837 V18838) (cond ((cons? V18836) (let Test (cons (hd V18836) (cons V18837 ())) (let Action (shen.syntax (tl V18836) (concat Parse_ (hd V18836)) V18838) (let Else (cons fail ()) (cons let (cons (concat Parse_ (hd V18836)) (cons Test (cons (cons if (cons (cons not (cons (cons = (cons (cons fail ()) (cons (concat Parse_ (hd V18836)) ()))) ())) (cons Action (cons Else ())))) ())))))))) (true (shen.f_error shen.recursive_descent))))
|
63
63
|
|
64
|
-
(defun shen.variable-match (
|
64
|
+
(defun shen.variable-match (V18842 V18843 V18844) (cond ((cons? V18842) (let Test (cons cons? (cons (cons hd (cons V18843 ())) ())) (let Action (cons let (cons (concat Parse_ (hd V18842)) (cons (cons hd (cons (cons hd (cons V18843 ())) ())) (cons (shen.syntax (tl V18842) (cons shen.pair (cons (cons tl (cons (cons hd (cons V18843 ())) ())) (cons (cons shen.hdtl (cons V18843 ())) ()))) V18844) ())))) (let Else (cons fail ()) (cons if (cons Test (cons Action (cons Else ())))))))) (true (shen.f_error shen.variable-match))))
|
65
65
|
|
66
|
-
(defun shen.terminal? (
|
66
|
+
(defun shen.terminal? (V18854) (cond ((cons? V18854) false) ((variable? V18854) false) (true true)))
|
67
67
|
|
68
|
-
(defun shen.jump_stream? (
|
68
|
+
(defun shen.jump_stream? (V18860) (cond ((= V18860 _) true) (true false)))
|
69
69
|
|
70
|
-
(defun shen.check_stream (
|
70
|
+
(defun shen.check_stream (V18864 V18865 V18866) (cond ((cons? V18864) (let Test (cons and (cons (cons cons? (cons (cons hd (cons V18865 ())) ())) (cons (cons = (cons (hd V18864) (cons (cons hd (cons (cons hd (cons V18865 ())) ())) ()))) ()))) (let Action (shen.syntax (tl V18864) (cons shen.pair (cons (cons tl (cons (cons hd (cons V18865 ())) ())) (cons (cons shen.hdtl (cons V18865 ())) ()))) V18866) (let Else (cons fail ()) (cons if (cons Test (cons Action (cons Else ())))))))) (true (shen.f_error shen.check_stream))))
|
71
71
|
|
72
|
-
(defun shen.jump_stream (
|
72
|
+
(defun shen.jump_stream (V18870 V18871 V18872) (cond ((cons? V18870) (let Test (cons cons? (cons (cons hd (cons V18871 ())) ())) (let Action (shen.syntax (tl V18870) (cons shen.pair (cons (cons tl (cons (cons hd (cons V18871 ())) ())) (cons (cons shen.hdtl (cons V18871 ())) ()))) V18872) (let Else (cons fail ()) (cons if (cons Test (cons Action (cons Else ())))))))) (true (shen.f_error shen.jump_stream))))
|
73
73
|
|
74
|
-
(defun shen.semantics (
|
74
|
+
(defun shen.semantics (V18874) (cond ((= () V18874) ()) ((shen.grammar_symbol? V18874) (cons shen.hdtl (cons (concat Parse_ V18874) ()))) ((variable? V18874) (concat Parse_ V18874)) ((cons? V18874) (map (lambda Z (shen.semantics Z)) V18874)) (true V18874)))
|
75
75
|
|
76
|
-
(defun shen.snd-or-fail (
|
76
|
+
(defun shen.snd-or-fail (V18882) (cond ((and (cons? V18882) (and (cons? (tl V18882)) (= () (tl (tl V18882))))) (hd (tl V18882))) (true (fail))))
|
77
77
|
|
78
|
-
(defun fail () shen.fail!)(defun shen.pair (
|
78
|
+
(defun fail () shen.fail!)(defun shen.pair (V18885 V18886) (cons V18885 (cons V18886 ())))
|
79
79
|
|
80
|
-
(defun shen.hdtl (
|
80
|
+
(defun shen.hdtl (V18888) (hd (tl V18888)))
|
81
81
|
|
82
|
-
(defun shen.<!> (
|
82
|
+
(defun shen.<!> (V18896) (cond ((and (cons? V18896) (and (cons? (tl V18896)) (= () (tl (tl V18896))))) (cons () (cons (hd V18896) ()))) (true (fail))))
|
83
83
|
|
84
|
-
(defun <e> (
|
84
|
+
(defun <e> (V18902) (cond ((and (cons? V18902) (and (cons? (tl V18902)) (= () (tl (tl V18902))))) (cons (hd V18902) (cons () ()))) (true (shen.f_error <e>))))
|
85
85
|
|
86
86
|
|
87
87
|
|
data/shen-ruby.gemspec
CHANGED
@@ -12,11 +12,11 @@ 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 8.1.}
|
16
16
|
|
17
17
|
s.required_ruby_version = ">= 1.9.3"
|
18
18
|
|
19
|
-
s.add_runtime_dependency 'klam', '0.0.
|
19
|
+
s.add_runtime_dependency 'klam', '0.0.9', '0.0.9'
|
20
20
|
|
21
21
|
s.add_development_dependency 'rake', '~> 10.4.2', '>= 10.4.2'
|
22
22
|
s.add_development_dependency 'rspec', '~> 3.1', '>= 3.1.0'
|
@@ -24,6 +24,6 @@ Gem::Specification.new do |s|
|
|
24
24
|
git_files = `git ls-files`.split("\n") rescue ''
|
25
25
|
s.files = git_files
|
26
26
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
27
|
-
s.executables = %w(srrepl)
|
27
|
+
s.executables = %w(shen_ruby shen-ruby srrepl)
|
28
28
|
s.require_paths = ["lib"]
|
29
29
|
end
|
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.15.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: 2015-
|
12
|
+
date: 2015-04-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: klam
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - '='
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 0.0.
|
20
|
+
version: 0.0.9
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - '='
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: 0.0.
|
27
|
+
version: 0.0.9
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: rake
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,10 +66,12 @@ dependencies:
|
|
66
66
|
- !ruby/object:Gem::Version
|
67
67
|
version: 3.1.0
|
68
68
|
description: ShenRuby is a port of the Shen programming language to Ruby. It currently
|
69
|
-
supports Shen version
|
69
|
+
supports Shen version 8.1.
|
70
70
|
email:
|
71
71
|
- greg@sourcematters.org
|
72
72
|
executables:
|
73
|
+
- shen_ruby
|
74
|
+
- shen-ruby
|
73
75
|
- srrepl
|
74
76
|
extensions: []
|
75
77
|
extra_rdoc_files: []
|
@@ -82,6 +84,8 @@ files:
|
|
82
84
|
- MIT_LICENSE.txt
|
83
85
|
- README.md
|
84
86
|
- Rakefile
|
87
|
+
- bin/shen-ruby
|
88
|
+
- bin/shen_ruby
|
85
89
|
- bin/shen_test_suite.rb
|
86
90
|
- bin/srrepl
|
87
91
|
- lib/shen_ruby.rb
|