conditional compilation \#case

This commit is contained in:
2021-07-12 15:22:03 -06:00
parent 06b730b379
commit 0a9a53bed1
5 changed files with 70 additions and 7 deletions

View File

@@ -285,6 +285,13 @@ class Prelude {
return v;
}
public static function symbolNameValue(s:ReaderExp):String {
return switch (s.def) {
case Symbol(name): name;
default: throw 'expected $s to be a plain symbol';
};
}
// ReaderExp helpers for macros:
public static function symbol(?name:String):ReaderExpDef {
if (name == null)