1
1
mirror of https://github.com/kanaka/mal.git synced 2024-10-05 18:08:55 +03:00

ada: allow keyword argument for keyword core function

This commit is contained in:
Nicolas Boulenguez 2021-08-13 08:14:21 +02:00 committed by Joel Martin
parent de68c38029
commit e3c98eeb3a

View File

@ -563,7 +563,18 @@ package body Core is
Sym_Handle := Car (Rest_List);
return New_Symbol_Mal_Type (':' & Deref_String (Sym_Handle).Get_String);
case Deref (Sym_Handle).Sym_Type is
when Str =>
return New_Symbol_Mal_Type (':' & Deref_String (Sym_Handle).Get_String);
when Sym =>
if Deref_Sym (Sym_Handle).Get_Sym (1) = ':' then
return Sym_Handle;
end if;
when others =>
null;
end case;
raise Runtime_Exception with "keyword: expects a keyword or string";
end Keyword;