add symbolName() for macros
This commit is contained in:
@@ -58,6 +58,7 @@ class Kiss {
|
||||
"zip" => Symbol("Prelude.zip"),
|
||||
"pairs" => Symbol("Prelude.pairs"), // TODO test pairs
|
||||
"memoize" => Symbol("Prelude.memoize"), // TODO test memoize
|
||||
"symbolName" => Symbol("Prelude.symbolName"),
|
||||
"map" => Symbol("Lambda.map"),
|
||||
"filter" => Symbol("Lambda.filter"), // TODO use truthy as the default filter function
|
||||
"has" => Symbol("Lambda.has"),
|
||||
|
@@ -277,6 +277,14 @@ class Prelude {
|
||||
return v;
|
||||
}
|
||||
|
||||
// ReaderExp helpers for macros:
|
||||
public static function symbolName(s:ReaderExp):ReaderExpDef {
|
||||
return switch (s.def) {
|
||||
case Symbol(name): StrExp(name);
|
||||
default: throw 'expected $s to be a plain symbol';
|
||||
};
|
||||
}
|
||||
|
||||
#if sys
|
||||
private static var kissProcess:Process = null;
|
||||
#end
|
||||
|
Reference in New Issue
Block a user