Hi Jonathan,

> (if 'any1 any2 . prg) -> any
> ...
> I also don't get the "." between "any2" and "prg" - does that mean
> something?

Yes. As you probably know, the dot is used in "dotted pairs" in Lisp, as
a result of a "cons" operation. In general, a list can be written
recursively as

   (any . lst)


   : (1 . (2 3 4))
   -> (1 2 3 4)

A 'prg' is a list of 'exe's (executable expressions). So a call like

   (if (someCondition)
      (doElse2) )

can be dissected into

   any1  (someCondition)
   any2  (doThat)
   prg   ((doElse1) (doElse2))

   : '(if (someCondition) (doThat) . ((doElse1) (doElse2)))
   -> (if (someCondition) (doThat) (doElse1) (doElse2))

> Is there any significance in the difference of "any2" and "prg". I would
> have thought they were both "any" type parameters.

In some sense, yes. 'any' is the most general type, it can be anything,
i.e. a number, a symbol or a list. 'prg', however, is typically a list,
so it better describes what 'if' expects.

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

Reply via email to