On Sat 13 Mar 2021 at 13:33, Alexander Burger <a...@software-lab.de> wrote:
> It does. Just the syntax is different:
>
>    (de <p> (@Str) (fill '(p @Str)))
>
> This also creates just 2 cells.

True, I forgot about fill.

> But the FEXPR solution explained at PilCon allocates no new cells at all. It
> prints directly.

Avoiding allocations is wrong thing to do for this use-case.  Printing
directly is severely inconvenient.  Do you have a neat solution to the
svg viewBox problem I wrote about?

> Also, needing two separate functions for every HTML function is ugly, tedious
> and error-prone.

Not sure what do you mean.  There would be only one function, lets call
it html which takes a cons tree and prints it using html syntax.
Opposite of tedious and error-prone.  Similar to the xml function in
picolisp.

> Side-effects like printing? No problem! In PicoLisp, you can trace,
> break and single-step FEXPRs (with or without side-effects) like any
> other function (unlike macros in e.g. Common Lisp).

You can trace it but the trace does not show the side-effect thus making
trace useless.

>> Using FEXPRs for html output is misoptimisation.
>
> Wrong.

In reality it is misoptimisation because it optimizes for irrelevant
advantage of no allocation but it severely criples what one can do.

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

Reply via email to