Re: Feature request - 'fill'

2021-12-14 Thread pd
On Tue, Dec 14, 2021 at 3:15 AM Erik Gustafson 
wrote:

>
> I think Alex has shown that ',' and ',@' can be rolled into one - '^'
>
> : (let X (1 2) (macro (1 (^ X) 2)))
> -> (1 (1 2) 2)
> : (let X (1 2) (macro (1 ^ X 2)))
> -> (1 1 2 2)
> : (let X (1 2) (macro (1 ^ (apply + X) 2)))
> -> (1 3 2)
>
> the point is precisely that, maybe using , and ,@ is redundant in fill
because of ^   But the point is that it's better to follow lisp tradional
syntax, this way lispers can easy understand the meaning of code in (fill
`( 1 ,x 2 ))  but have to learn a new syntax to understand (fill '(1 ^ X
2)), that is another one "picolisperism"  ;-)


Re: Feature request - 'fill'

2021-12-14 Thread Alexander Burger
Hi pd, Erik,

> several lisps :
> > ...
> > `(1 ,(+ 2 4) 3) -> (1 8 3)
> > ...
> Both backquote and comma are already read-macros in picolisp, so that's a
> no go
> at the language level.

Right.

And in PicoLisp they are probably more often used than 'fill' (i.e. backquote in
other Lisps).

I would not want to waste a precious character like comma for fill. It is the
read macro for language localization, so it precedes *every* string in an
application (e.g. (ht:Prin ,"Hello").


> Alex, does the new tilde functionality mean that backquote is now
> technically
> redundant?

I would not say so.

It is needed in cases like

   : (1 `(list (hex "41") (hex "42")) 9)
   -> (1 (65 66) 9)

where "~" would otherwise require one more layer of nesting

   $: (1 ~(list (list (hex "41") (hex "42"))) 9)
   -> (1 (65 66) 9)
   $: (1 (~(list (hex "41") (hex "42"))) 9)
   -> (1 (65 66) 9)

But right, for simple, known, atomic values ` and ~ are equivalent now:

   : (1 `(hex "100") 9)
   -> (1 16777216 9)
   $: (1 ~(hex "100") 9)
   -> (1 16777216 9)

☺/ A!ex

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