Drop backslash from lambda definitions

This commit is contained in:
2025-04-15 10:34:38 -05:00
parent 5024a2be4c
commit f2beb86d8a
16 changed files with 181 additions and 182 deletions

View File

@ -1,36 +1,36 @@
!import "list.tri" !Local
match_ = y (\self value patterns :
match_ = y (self value patterns :
triage
t
(\_ : t)
(\pattern rest :
(_ : t)
(pattern rest :
triage
t
(\_ : t)
(\test result :
(_ : t)
(test result :
if (test value)
(result value)
(self value rest))
pattern)
patterns)
match = (\value patterns :
match_ value (map (\sublist :
match = (value patterns :
match_ value (map (sublist :
pair (head sublist) (head (tail sublist)))
patterns))
otherwise = const (t t)
matchExample = (\x : match x
[[(equal? 1) (\_ : "one")]
[(equal? 2) (\_ : "two")]
[(equal? 3) (\_ : "three")]
[(equal? 4) (\_ : "four")]
[(equal? 5) (\_ : "five")]
[(equal? 6) (\_ : "six")]
[(equal? 7) (\_ : "seven")]
[(equal? 8) (\_ : "eight")]
[(equal? 9) (\_ : "nine")]
[(equal? 10) (\_ : "ten")]
[ otherwise (\_ : "I ran out of fingers!")]])
matchExample = (x : match x
[[(equal? 1) (_ : "one")]
[(equal? 2) (_ : "two")]
[(equal? 3) (_ : "three")]
[(equal? 4) (_ : "four")]
[(equal? 5) (_ : "five")]
[(equal? 6) (_ : "six")]
[(equal? 7) (_ : "seven")]
[(equal? 8) (_ : "eight")]
[(equal? 9) (_ : "nine")]
[(equal? 10) (_ : "ten")]
[ otherwise (_ : "I ran out of fingers!")]])