on master help sign in
.
commit5a5eb7f45f246b1f29c83fe9798653f34a5996ee authoriko <mail@iko.soy> dateSun 20 Aug 2023, 21:47 (3 years ago) parentbe02e58
4 files changed+18−5
src/Nock.hs+1−1 src/Nock/Jets.hs+8−1 tests/golden/add.hoon+4−2 tests/golden/dec.hoon+5−1
src/Nock.hs+1−1
@@ -106,7 +106,7 @@ tar' b c subject = case b of
106106 2## -> case x of
107107 ~(Cell l k _) -> case tar' l k subject of
108108 ~(formula@(Cell battery ~(Cell sample _ _) _)) ->
109− if battery == Nock.Jets.dec
109+ if traceShowId battery == Nock.Jets.add
110110 then error "Found it!"
111111 else case (tar' h j subject) of
112112 ~(Cell u v _) -> tar' u v formula
src/Nock/Jets.hs+8−1
@@ -6,5 +6,12 @@ import Nock.Types
66dec :: Noun
77dec = Nock.Parser.noun "[8 [1 0] 8 [1 6 [5 [0 30] 4 0 6] [0 6] 9 2 10 [6 4 0 6] 0 1] 9 2 0 1]"
88
9+weirdDec = Nock.Parser.noun "[ 8 [ 1 [ 8 [1 0 0] [ 1 6 [5 [1 0] 0 12] [0 13] 9 2 10 [6 [8 [9 21 0 7] 9 2 10 [6 0 28] 0 2] 4 0 13] 0 1 ] 0 1 ] [ [1 2] 8 [1 0] [1 8 [1 0] 8 [1 6 [5 [0 30] 4 0 6] [0 6] 9 2 10 [6 4 0 6] 0 1] 9 2 0 1] 0 1 ] 1 1 ] 9 21 0 1 ]"
10+
911add :: Noun
10−add = Nock.Parser.noun "[ [ 6 [5 [1 0] 0 12] [0 13] 9 2 10 [6 [8 [9 5 0 7] 9 2 10 [6 0 28] 0 2] 4 0 13] 0 1 ] [0 0] [ [ 8 [1 0 0] [ 1 6 [5 [1 0] 0 12] [0 13] 9 2 10 [6 [8 [9 5 0 7] 9 2 10 [6 0 28] 0 2] 4 0 13] 0 1 ] 0 1 ] 7 [ 8 [1 69] [ 1 6 [5 [1 0] 0 6] [0 0] 8 [1 0] 8 [1 6 [5 [0 30] 4 0 6] [0 6] 9 2 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4−2
@@ -1,3 +1,5 @@
1+.*
2+~
13!=
24=>
35|%
@@ -7,7 +9,7 @@
79=/ b 0
810|- ^- @
911?. =(a +(b)) $(b +(b)) b
10−++ bar 1
12+++ bar 2
1113++ add
1214 :: ~/ %add
1315 :: unsigned addition
@@ -20,4 +22,4 @@
2022 ?: =(0 a) b
2123 $(a (dec a), b +(b))
2224--
23−%+ add 1 2
25+dec
tests/golden/dec.hoon+5−1
@@ -1,10 +1,14 @@
11!=
22=>
33|%
4+++ add
5+ |= x=@
6+ x
7+++ bar 4
48++ dec
59|= a=@
610=/ b 0
711|- ^- @
812?. =(a +(b)) $(b +(b)) b
913--
10−%- dec 8
14+dec