dab0484bbf740e924bff2d8632125c265968436e
[jscl.git] / prelude.js
1 function pv (x) { return x ; }
2
3 function mv(){
4     var r = [];
5     r['multiple-value'] = true;
6     for (var i=0; i<arguments.length; i++)
7         r.push(arguments[i]);
8     return r;
9 }
10
11 // NOTE: Define VALUES to be MV for toplevel forms. It is because
12 // `eval' compiles the forms and execute the Javascript code at
13 // toplevel with `js-eval', so it is necessary to return multiple
14 // values from the eval function.
15 var values = mv;
16
17 function checkArgsAtLeast(args, n){
18     if (args.length < n) throw 'too few arguments';
19 }
20
21 function checkArgsAtMost(args, n){
22     if (args.length > n) throw 'too many arguments';
23 }