X-Git-Url: http://git.hcoop.net/jackhill/mal.git/blobdiff_plain/ece70f970306f819b148979c3d17f266c7e08146..fbfe6784d2db983018340e4e1492d8d017029867:/impls/yorick/step7_quote.i diff --git a/impls/yorick/step7_quote.i b/impls/yorick/step7_quote.i index 3d8d1aa9..67ebb627 100644 --- a/impls/yorick/step7_quote.i +++ b/impls/yorick/step7_quote.i @@ -9,25 +9,42 @@ func READ(str) return read_str(str) } -func is_pair(ast) +func starts_with(seq, sym) { - type = structof(ast) - return ((type == MalList) || (type == MalVector)) && count(ast) > 0 + return numberof(seq) == 2 && structof(*seq(1)) == MalSymbol && seq(1)->val == sym +} + +func quasiquote_loop(seq) +{ + acc = MalList(val=&[]) + for (i=numberof(seq); 0