From 98acdb53e99eb68284231f4ca19ffae41c76a210 Mon Sep 17 00:00:00 2001 From: Scott Olsen Date: Thu, 29 Jul 2021 02:26:31 -0400 Subject: [PATCH] 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` --- src/Commands.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Commands.hs b/src/Commands.hs index 0419191b..6f8238a4 100644 --- a/src/Commands.hs +++ b/src/Commands.hs @@ -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 =