(isListExp) predicate
This commit is contained in:
@@ -111,7 +111,8 @@ class Kiss {
|
||||
"zipThrow" => Symbol("Prelude.zipThrow"),
|
||||
"joinPath" => Symbol("Prelude.joinPath"),
|
||||
"readDirectory" => Symbol("Prelude.readDirectory"),
|
||||
"substr" => Symbol("Prelude.substr")
|
||||
"substr" => Symbol("Prelude.substr"),
|
||||
"isListExp" => Symbol("Prelude.isListExp")
|
||||
],
|
||||
fieldList: [],
|
||||
fieldDict: new Map(),
|
||||
|
@@ -420,7 +420,16 @@ class Prelude {
|
||||
case ListExp(exps):
|
||||
exps;
|
||||
default: throw 'expected $s to be a list expression';
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public static function isListExp(s:ReaderExp):Bool {
|
||||
return switch (s.def) {
|
||||
case ListExp(exps):
|
||||
true;
|
||||
default:
|
||||
false;
|
||||
};
|
||||
}
|
||||
|
||||
#if sys
|
||||
|
Reference in New Issue
Block a user