Skip to content

Commit

Permalink
v1.0.1 :: Lambda hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
ProggerX committed Mar 2, 2025
1 parent cddbd78 commit 7d1d51d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Lapse/Lambda.hs
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ unName v = error $ "Expected name, but got: " ++ show v
mkFunction :: (Monad m) => [Value m] -> Value m -> LapseM m (Func m)
mkFunction argsN' expr = gets f
where
f ss args =
f ss args = do
ns <- get
let
argsV = unList args
argsN = map unName argsN'
ss' = fromList (zip argsN argsV) : ss
ss' = fromList (zip argsN argsV) : ss ++ ns
in
inScopes ss' expr

Expand Down
2 changes: 2 additions & 0 deletions test-code.lp
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@
(print "1 <= 2"))
(if (< 1 2) (print "1 < 2")
(print "1 >= 2"))
(defn fac (x) (if (< x 1) 1 (* x (fac (- x 1)))))
(print (fac 6))

0 comments on commit 7d1d51d

Please sign in to comment.