mirror of
https://github.com/carp-lang/Carp.git
synced 2024-09-11 05:25:28 +03:00
fix: make Symbol.prefix work on qualified symbols (#1286)
This commit makes it so that `Symbol.prefix` can take qualified symbols as prefix arguments, e.g. `(Symbol.prefix 'Foo.Bar 'baz) => 'Foo.Bar.baz`
This commit is contained in:
parent
cbdf425247
commit
98acdb53e9
@ -614,6 +614,8 @@ commandSymConcat ctx a =
|
||||
commandSymPrefix :: BinaryCommandCallback
|
||||
commandSymPrefix ctx (XObj (Sym (SymPath [] prefix) _) _ _) (XObj (Sym (SymPath [] suffix) st) i t) =
|
||||
pure (ctx, Right (XObj (Sym (SymPath [prefix] suffix) st) i t))
|
||||
commandSymPrefix ctx (XObj (Sym (SymPath ps prefix) _) _ _) (XObj (Sym (SymPath [] suffix) st) i t) =
|
||||
pure (ctx, Right (XObj (Sym (SymPath (ps++[prefix]) suffix) st) i t))
|
||||
commandSymPrefix ctx x (XObj (Sym (SymPath [] _) _) _ _) =
|
||||
pure $ evalError ctx ("Can’t call `prefix` with " ++ pretty x) (xobjInfo x)
|
||||
commandSymPrefix ctx _ x =
|
||||
|
Loading…
Reference in New Issue
Block a user