1
1
mirror of https://github.com/kanaka/mal.git synced 2024-09-20 18:18:51 +03:00

Ada: add deref (stage 1 complete)

This commit is contained in:
Chris M Moore 2015-03-19 22:19:13 +00:00
parent d32be19b9b
commit 1d440bb570
3 changed files with 11 additions and 1 deletions

View File

@ -309,6 +309,12 @@ package body Reader is
Meta => null,
The_Function => Unquote,
The_Operand => Read_Form);
elsif MT.Symbol = ACL.Commercial_At then
return new Mal_Type'
(Sym_Type => Unitary,
Meta => null,
The_Function => Deref,
The_Operand => Read_Form);
else
return MT;
end if;

View File

@ -107,6 +107,9 @@ package body Types is
when Splice_Unquote =>
return
"(splice-unquote " & To_String (T.The_Operand.all) & ")";
when Deref =>
return
"(deref " & To_String (T.The_Operand.all) & ")";
end case;
when Error =>
return To_String (T.Error_Msg);

View File

@ -16,7 +16,8 @@ package Types is
type Sym_Types is (Int, Floating, List, Sym, Str, Atom, Unitary, Error);
type Unitary_Functions is (Quote, Unquote, Quasiquote, Splice_Unquote);
type Unitary_Functions is
(Quote, Unquote, Quasiquote, Splice_Unquote, Deref);
type List_Types is (List_List, Vector_List, Hashed_List);
function Opening (LT : List_Types) return Character;