fix "eql5.js" to allow any number of arguments in "Lisp.fun()"

This commit is contained in:
polos 2017-01-21 10:34:35 +01:00
parent f290094824
commit c10db89cc1
3 changed files with 17 additions and 28 deletions

View file

@ -11,10 +11,11 @@ Item {
// Please note:
//
// * Lisp.fun() is limited to 9 arguments; use Lisp.apply() for more arguments
// * to call lisp functions, use either Lisp.fun() or Lisp.apply();
// use JS arrays for lists (can be nested);
//
// * return values can be nested Lisp lists or vectors, which will be converted to
// nested JS arrays: they will be prepared in Lisp and passed to JS eval
// nested JS arrays: they will be prepared in Lisp and passed to JS eval;
// (1) call CL function
console.log(Lisp.fun("format", false, "~R", 123))
@ -25,10 +26,10 @@ Item {
// (3) pass list argument
console.log(Lisp.fun("x:join", ["11", "55"], ":"))
// (4) nested list arguments; note Lisp.apply() for any number of arguments
// (4) nested list arguments
// N.B: don't get fooled by the printed representation of the return value:
// it's a nested JS array internally
console.log(Lisp.apply("list", [[[1, 2, 3], ["a", "b", "c"], 4, 5], 6, [[7, 8], 9]]))
console.log(Lisp.fun("list", [[1, 2, 3], ["a", "b", "c"], 4, 5], 6, [[7, 8], 9]))
}
Text {