X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=lispstrack.lisp;h=f3f01dfe3debaea3b3c7c8697bbcf7f7244c0c91;hb=0ef25ffae5dd2d182bc69daa9dc41bfec53d7729;hp=0c90bb2799c6b52c6bf116cad85566d68f21d9fe;hpb=727f819dbd366213bdfdc1e48ce638815928b68a;p=jscl.git diff --git a/lispstrack.lisp b/lispstrack.lisp index 0c90bb2..f3f01df 100644 --- a/lispstrack.lisp +++ b/lispstrack.lisp @@ -306,10 +306,12 @@ "){" *newline* (if rest-argument - (concat "var " (lookup-variable rest-argument new-env) - " = arguments.slice(" - (prin1-to-string (length required-arguments)) - ");" + (concat "var " (lookup-variable rest-argument new-env) ";" *newline* + "for (var i = arguments.length-1; i>=" + (integer-to-string (length required-arguments)) + "; i--)" *newline* + (lookup-variable rest-argument new-env) " = " + "{car: arguments[i], cdr: " (lookup-variable rest-argument new-env) "};" *newline*) "") (concat (ls-compile-block (butlast body) new-env fenv)