summaryrefslogtreecommitdiff
path: root/src/cli/runtime/RT.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/cli/runtime/RT.cs')
-rw-r--r--src/cli/runtime/RT.cs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/cli/runtime/RT.cs b/src/cli/runtime/RT.cs
index 1f97c081..5cf4187f 100644
--- a/src/cli/runtime/RT.cs
+++ b/src/cli/runtime/RT.cs
@@ -196,6 +196,21 @@ static public Object find(Object key, Object coll)
return ((Associative)coll).find(key);
}
+ //takes a seq of key,val,key,val
+//returns tail starting at val of matching key if found, else null
+static public ISeq findKey(Keyword key,ISeq keyvals) {
+ while(keyvals != null)
+ {
+ ISeq r = keyvals.rest();
+ if (r == null)
+ throw new Exception("Malformed keyword argslist");
+ if (keyvals.first() == key)
+ return r;
+ keyvals = r.rest();
+ }
+ return null;
+}
+
static public Object without(Object key, Object coll)
{
if (coll == null)