mirror of https://github.com/voidlizard/hbs2
wip
This commit is contained in:
parent
1a1d04ea5c
commit
41c023de8c
|
@ -530,8 +530,8 @@ apply_ :: forall c m . ( IsContext c
|
|||
apply_ s args = case s of
|
||||
ListVal [SymbolVal "builtin:lambda", SymbolVal n] -> apply n args
|
||||
|
||||
ListVal (SymbolVal "builtin:closure" : what@(SymbolVal _) : free) -> do
|
||||
apply_ what (free <> args)
|
||||
ListVal (SymbolVal "builtin:closure" : e : free) -> do
|
||||
apply_ e (free <> args)
|
||||
|
||||
SymbolVal "quasiquot" -> mkList <$> mapM (evalQQ mempty) args
|
||||
SymbolVal "quasiquote" -> mkList <$> mapM (evalQQ mempty) args
|
||||
|
@ -1088,6 +1088,10 @@ internalEntries = do
|
|||
r <- mapM eval syn
|
||||
pure $ lastDef nil r
|
||||
|
||||
entry $ bindMatch "curry" \case
|
||||
[e1, e2] -> pure $ mkForm "builtin:closure" [e1, e2]
|
||||
e -> throwIO (BadFormException @c (mkList e))
|
||||
|
||||
entry $ bindMatch "id" $ \case
|
||||
[ e ] -> pure e
|
||||
_ -> throwIO (BadFormException @C nil)
|
||||
|
|
Loading…
Reference in New Issue