ref: 120a0cb0fd9df6a5da5d0ba480d6eb9b8b6d66a8
parent: 083121b7a0857569d6562aa563055c19c9e2cece
author: smazga <[email protected]>
date: Mon Aug 17 09:52:59 EDT 2020
more macro work
--- a/m9.ml
+++ b/m9.ml
@@ -61,9 +61,14 @@
(Printer.dump groups) in
print_endline ("BLARGH: " ^ sgroups);
print_endline ("TOKENIZED: " ^ String.concat " " (Reader.tokenize ("(" ^ sgroups ^ ")")));
+ let rec handle_groups groups =
+ (match groups with
+ | hd :: tl -> print_endline (" HD: " ^ Printer.print hd true ^ " tl: " ^ Printer.dump tl); handle_groups tl
+ | _ -> print_endline "<list end>") in
+ handle_groups groups;
let list_reader = Reader.read_list ")" {list_form = []; tokens = (Reader.tokenize (sgroups ^ ")")) } in
let slist = Types.list list_reader.list_form in
- print_endline ("BLAAAARGH: " ^ Printer.print slist true)
+ print_endline ("BLAAAARGH: " ^ Printer.print slist true);
| _ -> ());
let smacro =
@@ -78,9 +83,8 @@
^ " args:"
^ Printer.dump args
^ " straight macro: "
- ^ Printer.dump macro
- ^ " subbed macro:"
- ^ smacro);
+ ^ Printer.dump macro);
+ print_endline (" subbed macro:" ^ smacro);
(* let sub_env = Env.make (Some env) in *)
match Reader.read smacro with
| T.List { T.value = transformer } ->
--- a/printer.ml
+++ b/printer.ml
@@ -46,7 +46,7 @@
^ "\""
else s
| T.List { T.value = xs } ->
- "~(" ^ String.concat " " (List.map (fun s -> print s r) xs) ^ ")"
+ "(" ^ String.concat " " (List.map (fun s -> print s r) xs) ^ ")"
| T.Vector { T.value = v } ->
"#(" ^ String.concat " " (List.map (fun s -> print s r) v) ^ ")"
| T.Record r -> "<record supported>"