handy reader macro for debug printing

This commit is contained in:
2021-05-18 13:49:23 -06:00
parent 4739c0f881
commit 7dcd27944d

View File

@@ -71,6 +71,9 @@ class Reader {
readTable["!"] = (stream:Stream, k) -> CallExp(Symbol("not").withPos(stream.position()), [assertRead(stream, k)]);
// Helpful for quickly debugging an expression by printing the value:
readTable["~"] = (stream:Stream, k) -> CallExp(Symbol("print").withPos(stream.position()), [assertRead(stream, k)]);
// Helpful for defining predicates to pass to Haxe functions:
readTable["?"] = (stream:Stream, k) -> CallExp(Symbol("Prelude.truthy").withPos(stream.position()), [assertRead(stream, k)]);