Hi Christophe,

> # In order to call <xml> with the default args and then the particular args,
> # decided to use apply:
> (apply <xml> (quote text text-anchor "middle" font-size 24 x 120 y 99

Yes, this is not possible.


'apply' can only be used for functions which evaluate their arguments
(EXPRs and SUBRs, but not FEXPRs). And '<xml>' is an FEXPR:

   (de <xml> Lst
      ... )

The single 'Lst' parameter indicates that the arguments are not
evaluated.


To understand why 'apply' cannot be used with non-evaluating functions,
recall how 'apply' works: It does some kind of internal quoting to the
arguments, to _suppress_ the evaluation a function normally does.

For example:

   (setq A 1  B 2  C 3)
   (apply println '(A B C))

This should print

   A B C

and _not_

   1 2 3

Thus, it is equivalent to

   (println 'A 'B 'C)

and not

   (println A B C)


To achieve that, 'apply' passes the elements in the list (A B C) to some
internal structure, which quotes them before calling the function
'println'. 'println' in turn evaluates the arguments, and gets the
symbols A, B and C as expected.

If - instead of 'println' - a function is called which does not evaluate
its arguments, the results will be undefined (implementation-specific).

♪♫ Alex
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to