From: Hoehle, Joerg-C. <Joe...@t-...> - 2002-06-18 07:58:07
|
Hi, apply in Jscheme takes exactly 2 arguments. > apply {jsint.Primitive apply[2]} In R4RS terms: essential procedure: apply proc args procedure: apply proc arg1 ... args , this means that only the essential part if implemented in Jscheme. R5RS' apply takes n arguments and doesn't make a distinction anymore. = Having only apply/2 is a nightmare for recursive procedures with = variable number of arguments. BTW, the documentation at http://jscheme.sourceforge.net/jscheme/doc/R4RSprimitives.html is inconsistent. It says (apply f arguments ) ... (map F L) ... Yet map takes n arguments (in both R4RS and R5RS and) in Jscheme. While it is a trivial exercise to write an apply/n based on the = apply/2, it is not so w.r.t. compiler optimization and inlining. Will the home-grown apply/n compile to as efficient code/bytecode as = apply/2? BTW, Common Lisp has list* which is quite useful for a straightforward = apply/n->apply/2. Regards, J=F6rg H=F6hle. Using Jscheme 5.0 04/05/2002 on MS-Woes-2000 |