Basic SETF implementation
[jscl.git] / prelude.js
index cf976a0..b934132 100644 (file)
@@ -1,4 +1,6 @@
-function pv (x) { return x ; }
+var nil;
+
+function pv (x) { return x==undefined? nil: x; }
 
 function mv(){
     var r = [];
@@ -8,6 +10,10 @@ function mv(){
     return r;
 }
 
+function forcemv (x) {
+    return typeof x == 'object' && 'multiple-value' in x? x: mv(x);
+}
+
 // NOTE: Define VALUES to be MV for toplevel forms. It is because
 // `eval' compiles the forms and execute the Javascript code at
 // toplevel with `js-eval', so it is necessary to return multiple