reverse pattern binding order
This commit is contained in:
parent
98305cd6d0
commit
99ce2f75ee
|
@ -15,8 +15,8 @@ It's not meant for real-world use but for educational purposes on writing an int
|
|||
|
||||
`examples/helloworld.lamb`:
|
||||
|
||||
hello(object) -> object + "!".
|
||||
hello() -> "hello, " + hello("world").
|
||||
hello(object) -> object + "!".
|
||||
|
||||
putstrln(hello()).
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
hello(object) -> object + "!".
|
||||
hello() -> "hello, " + hello("world").
|
||||
hello(object) -> object + "!".
|
||||
|
||||
putstrln(hello()).
|
|
@ -108,7 +108,7 @@ eval (Defun name fn) = do
|
|||
Just oldfn -> -- add pattern to old fn
|
||||
let FnV oldpats = oldfn
|
||||
Lambda [(pat, body)] = fn
|
||||
newfn = FnV ((pat, body):oldpats) in
|
||||
newfn = FnV (oldpats ++ [(pat, body)]) in
|
||||
put (s, bind env name newfn) >> return newfn
|
||||
|
||||
eval (Def name v') = do
|
||||
|
|
Loading…
Reference in New Issue