reverse pattern binding order

This commit is contained in:
darkf 2013-10-20 18:59:22 -07:00
parent 98305cd6d0
commit 99ce2f75ee
3 changed files with 4 additions and 4 deletions

View File

@ -15,11 +15,11 @@ 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()).
** License **
**License**
Licensed under the terms of the zlib license. See `LICENSE` for details.

View File

@ -1,4 +1,4 @@
hello(object) -> object + "!".
hello() -> "hello, " + hello("world").
hello(object) -> object + "!".
putstrln(hello()).

View File

@ -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