Hi pd,

> - it breaks compatibility with almost all lisp out there
> ...
> Maybe I'm misunderstanding something.

Perhaps, though at a deeper level.

First of all, forget other Lisps! I always say it is best if you start with
PicoLisp without knowing "Lisp". Lisp dialects differ a lot, but PicoLisp starts
out from different assumptions, by targeting a pure interpreter while almost all
Lisps focus on compilation (even if they don't actually compile). Thinking this
consequently, you end up with a different language, not syntactically but
semantically.

The term "improper list" does not exist in PicoLisp. Everything is either a
number, a symbol or a pair.

As we are interpreter-only, every function is free to decide for itself how to
handle its arguments. Thus *every* built-in function is an FSUBR, always of the
form (fun . args).

If you look at the reference, you find plenty of cases like

   (de sym . any) -> sym
   (quote . any) -> any
   (if 'any1 any2 . prg) -> any
   (while 'any . prg) -> any
   (cond ('any1 . prg1) ('any2 . prg2) ..) -> any

There is no "special" form! (Or, everything is a special form)

Back to the 'quote' case:

-- Saving "only one cell" is not a minor detail. Keep in mind how often 'quote'
   is called in a typical program, and the performance of such an interpreted
   program in general is a linear function of the number of cells.

-- The syntax of 'quote' also allows for nicer source code formatting. If you
   ever look at a PicoLisp program, you find plenty of cases like

   (for X
      (quote
         ("html" . *XhtmlHtml)
         ("table" . *XhtmlTable)
         ("grid" . *XhtmlGrid)
         ("layout" . *XhtmlLayout)
         ("menu" . *XhtmlMenu)
         ("tab" . *XhtmlTab)
         ("input" . *XhtmlInput)
         ("field" . *XhtmlField)
         ("area" . *XhtmlArea)
         ("select" . *XhtmlSelect)
         ("submit" . *XhtmlSubmit) )

instead of (other Lisps!)

   (for X
      (quote
         (("html" . *XhtmlHtml)
            ("table" . *XhtmlTable)
            ("grid" . *XhtmlGrid)
            ("layout" . *XhtmlLayout)
            ("menu" . *XhtmlMenu)
            ("tab" . *XhtmlTab)
            ("input" . *XhtmlInput)
            ("field" . *XhtmlField)
            ("area" . *XhtmlArea)
            ("select" . *XhtmlSelect)
            ("submit" . *XhtmlSubmit) ) )

☺/ A!ex

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

Reply via email to