diff --git a/README.md b/README.md index ccdc2e8..2bd9592 100644 --- a/README.md +++ b/README.md @@ -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. \ No newline at end of file diff --git a/examples/helloworld.lamb b/examples/helloworld.lamb index 34fdc05..1f90e7f 100644 --- a/examples/helloworld.lamb +++ b/examples/helloworld.lamb @@ -1,4 +1,4 @@ -hello(object) -> object + "!". hello() -> "hello, " + hello("world"). +hello(object) -> object + "!". putstrln(hello()). \ No newline at end of file diff --git a/interp.hs b/interp.hs index 6a0ba3c..35c7d11 100644 --- a/interp.hs +++ b/interp.hs @@ -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