mirror of
https://github.com/carp-lang/Carp.git
synced 2024-11-05 04:44:12 +03:00
Merge pull request #610 from hellerve/master
Disallow non-symbols in fn arguments
This commit is contained in:
commit
8e8fce0744
@ -147,6 +147,11 @@ eval env xobj =
|
||||
_ -> return (makeEvalError ctx Nothing ("`if` condition contains non-boolean value: " ++ pretty okCondition) (info okCondition))
|
||||
Left err -> return (Left err)
|
||||
|
||||
[XObj (Fn _ _) _ _, args@(XObj (Arr a) _ _), _] ->
|
||||
if all isUnqualifiedSym a
|
||||
then return (Right listXObj)
|
||||
else return (makeEvalError ctx Nothing ("`fn` requires all arguments to be unqualified symbols, but it got `" ++ pretty args ++ "`") (info xobj))
|
||||
|
||||
[defnExpr@(XObj Defn _ _), name, args@(XObj (Arr a) _ _), body] ->
|
||||
case obj name of
|
||||
(Sym (SymPath [] _) _) ->
|
||||
|
Loading…
Reference in New Issue
Block a user