• R/O
  • HTTP
  • SSH
  • HTTPS

Thun: Commit

Interpreter and library.


Commit MetaInfo

Révisionbe4a3d6e1600a590253de802d6a506e287879180 (tree)
l'heure2021-11-26 10:38:01
AuteurSimon Forman <sforman@hush...>
CommiterSimon Forman

Message de Log

The problem is in the step combinator definition.

Change Summary

Modification

--- /dev/null
+++ b/debugger.out
@@ -0,0 +1,115 @@
1+[1 [2 [3 4 625 6] 7] 8] -- pass
2+[1 [2 [3 4 625 6] 7] 8] ? pass
3+[1 [2 [3 4 625 6] 7] 8] && pass
4+[1 [2 [3 4 625 6] 7] 8] ++ pass
5+[1 [2 [3 4 625 6] 7] 8] || pass
6+[1 [2 [3 4 625 6] 7] 8] !- pass
7+[1 [2 [3 4 625 6] 7] 8] <{} pass
8+[1 [2 [3 4 625 6] 7] 8] <<{} pass
9+[1 [2 [3 4 625 6] 7] 8] abs pass
10+[1 [2 [3 4 625 6] 7] 8] anamorphism pass
11+[1 [2 [3 4 625 6] 7] 8] app1 pass
12+[1 [2 [3 4 625 6] 7] 8] app2 pass
13+[1 [2 [3 4 625 6] 7] 8] app3 pass
14+[1 [2 [3 4 625 6] 7] 8] appN pass
15+[1 [2 [3 4 625 6] 7] 8] at pass
16+[1 [2 [3 4 625 6] 7] 8] average pass
17+[1 [2 [3 4 625 6] 7] 8] b pass
18+[1 [2 [3 4 625 6] 7] 8] binary pass
19+[1 [2 [3 4 625 6] 7] 8] ccccons pass
20+[1 [2 [3 4 625 6] 7] 8] ccons pass
21+[1 [2 [3 4 625 6] 7] 8] clear pass
22+[1 [2 [3 4 625 6] 7] 8] cleave pass
23+[1 [2 [3 4 625 6] 7] 8] clop pass
24+[1 [2 [3 4 625 6] 7] 8] codi pass
25+[1 [2 [3 4 625 6] 7] 8] codireco pass
26+[1 [2 [3 4 625 6] 7] 8] dinfrirst pass
27+[1 [2 [3 4 625 6] 7] 8] dipd pass
28+[1 [2 [3 4 625 6] 7] 8] disenstacken pass
29+[1 [2 [3 4 625 6] 7] 8] down_to_zero pass
30+[1 [2 [3 4 625 6] 7] 8] drop pass
31+[1 [2 [3 4 625 6] 7] 8] dupd pass
32+[1 [2 [3 4 625 6] 7] 8] dupdd pass
33+[1 [2 [3 4 625 6] 7] 8] dupdip pass
34+[1 [2 [3 4 625 6] 7] 8] dupdipd pass
35+[1 [2 [3 4 625 6] 7] 8] enstacken pass
36+[1 [2 [3 4 625 6] 7] 8] flatten pass
37+[1 [2 [3 4 625 6] 7] 8] fork pass
38+[1 [2 [3 4 625 6] 7] 8] fourth pass
39+[1 [2 [3 4 625 6] 7] 8] gcd pass
40+[1 [2 [3 4 625 6] 7] 8] genrec pass
41+[1 [2 [3 4 625 6] 7] 8] grabN pass
42+[1 [2 [3 4 625 6] 7] 8] grba pass
43+[1 [2 [3 4 625 6] 7] 8] hypot pass
44+[1 [2 [3 4 625 6] 7] 8] ifte pass
45+[1 [2 [3 4 625 6] 7] 8] ii pass
46+[1 [2 [3 4 625 6] 7] 8] infra pass
47+[1 [2 [3 4 625 6] 7] 8] infrst pass
48+[1 [2 [3 4 625 6] 7] 8] make_generator pass
49+[1 [2 [3 4 625 6] 7] 8] mod pass
50+[1 [2 [3 4 625 6] 7] 8] neg pass
51+[1 [2 [3 4 625 6] 7] 8] not pass
52+[1 [2 [3 4 625 6] 7] 8] nulco pass
53+[1 [2 [3 4 625 6] 7] 8] nullary pass
54+[1 [2 [3 4 625 6] 7] 8] of pass
55+[1 [2 [3 4 625 6] 7] 8] pam pass
56+[1 [2 [3 4 625 6] 7] 8] pm pass
57+[1 [2 [3 4 625 6] 7] 8] popd pass
58+[1 [2 [3 4 625 6] 7] 8] popdd pass
59+[1 [2 [3 4 625 6] 7] 8] popop pass
60+[1 [2 [3 4 625 6] 7] 8] popopop pass
61+[1 [2 [3 4 625 6] 7] 8] popopd pass
62+[1 [2 [3 4 625 6] 7] 8] popopdd pass
63+[1 [2 [3 4 625 6] 7] 8] product pass
64+[1 [2 [3 4 625 6] 7] 8] quoted pass
65+[1 [2 [3 4 625 6] 7] 8] range pass
66+[1 [2 [3 4 625 6] 7] 8] range_to_zero pass
67+[1 [2 [3 4 625 6] 7] 8] reco pass
68+[1 [2 [3 4 625 6] 7] 8] rest pass
69+[1 [2 [3 4 625 6] 7] 8] reverse pass
70+[1 [2 [3 4 625 6] 7] 8] roll> pass
71+[1 [2 [3 4 625 6] 7] 8] roll< pass
72+[1 [2 [3 4 625 6] 7] 8] rollup pass
73+[1 [2 [3 4 625 6] 7] 8] rolldown pass
74+[1 [2 [3 4 625 6] 7] 8] rrest pass
75+[1 [2 [3 4 625 6] 7] 8] run pass
76+[1 [2 [3 4 625 6] 7] 8] second pass
77+[1 [2 [3 4 625 6] 7] 8] shift pass
78+[1 [2 [3 4 625 6] 7] 8] shunt pass
79+[1 [2 [3 4 625 6] 7] 8] size pass
80+[1 [2 [3 4 625 6] 7] 8] spiral_next pass
81+[1 [2 [3 4 625 6] 7] 8] split_at pass
82+[1 [2 [3 4 625 6] 7] 8] split_list pass
83+[1 [2 [3 4 625 6] 7] 8] sqr pass
84+[1 [2 [3 4 625 6] 7] 8] stackd pass
85+[1 [2 [3 4 625 6] 7] 8] step_zero pass
86+[1 [2 [3 4 625 6] 7] 8] sum pass
87+[1 [2 [3 4 625 6] 7] 8] swapd pass
88+[1 [2 [3 4 625 6] 7] 8] swons pass
89+[1 [2 [3 4 625 6] 7] 8] swoncat pass
90+[1 [2 [3 4 625 6] 7] 8] tailrec pass
91+[1 [2 [3 4 625 6] 7] 8] take pass
92+[1 [2 [3 4 625 6] 7] 8] ternary pass
93+[1 [2 [3 4 625 6] 7] 8] third pass
94+[1 [2 [3 4 625 6] 7] 8] tuck pass
95+[1 [2 [3 4 625 6] 7] 8] unary pass
96+[1 [2 [3 4 625 6] 7] 8] uncons pass
97+[1 [2 [3 4 625 6] 7] 8] unit pass
98+[1 [2 [3 4 625 6] 7] 8] unquoted pass
99+[1 [2 [3 4 625 6] 7] 8] unswons pass
100+[1 [2 [3 4 625 6] 7] 8] while pass
101+[1 [2 [3 4 625 6] 7] 8] x pass
102+step failed!
103+[1 [2 [3 4 625 6] 7] 8] _step0 pass
104+[1 [2 [3 4 625 6] 7] 8] _step1 pass
105+[1 [2 [3 4 625 6] 7] 8] _stept pass
106+[1 [2 [3 4 625 6] 7] 8] times pass
107+[1 [2 [3 4 625 6] 7] 8] _times0 pass
108+[1 [2 [3 4 625 6] 7] 8] _times1 pass
109+[1 [2 [3 4 625 6] 7] 8] _timest pass
110+[1 [2 [3 4 625 6] 7] 8] map pass
111+[1 [2 [3 4 625 6] 7] 8] _map? pass
112+[1 [2 [3 4 625 6] 7] 8] _mape pass
113+[1 [2 [3 4 625 6] 7] 8] _map0 pass
114+[1 [2 [3 4 625 6] 7] 8] _map1 pass
115+[1 [2 [3 4 625 6] 7] 8] _map2 pass
--- /dev/null
+++ b/debugger.py
@@ -0,0 +1,39 @@
1+'''
2+In order to debug the problem I'm having with definitions breaking a
3+zipper expression I need to load a system, load the defs into a dictionary,
4+and then run the expression and see if it raises an exception, substituting
5+definitions one-at-a-time until I find the one that breaks it.
6+'''
7+
8+from joy.library import default_defs, initialize, inscribe, Def
9+from joy.joy import joy
10+from joy.parser import text_to_expression
11+from joy.utils.pretty_print import trace
12+from joy.utils.stack import stack_to_string
13+
14+
15+inscribe(trace)
16+dictionary = initialize()
17+defs = {}
18+default_defs(defs)
19+
20+
21+expression = text_to_expression(
22+ '[1 [2 [3 4 25 6] 7] 8]'
23+ '[dup mul]'
24+ '[dip dip infra dip infra dip infra]'
25+ '[[] ccons] step i'
26+## '[[[] ccons] step i]'
27+## 'trace'
28+ )
29+
30+for def_name in defs:
31+ D = dictionary.copy()
32+ D[def_name] = defs[def_name]
33+ try:
34+ stack, _, d = joy((), expression, D)
35+ except:
36+ print(def_name, 'failed!')
37+ else:
38+ print(stack_to_string(stack), def_name, 'pass')
39+
Afficher sur ancien navigateur de dépôt.