mirror of
https://gitlab.com/eql/EQL5.git
synced 2026-01-02 23:33:32 -08:00
fix "eql5.js" to allow any number of arguments in "Lisp.fun()"
This commit is contained in:
parent
f290094824
commit
c10db89cc1
3 changed files with 17 additions and 28 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue