[Cuis-dev] Double colon syntax
Gerald Klix
cuis.01 at klix.ch
Wed Jan 5 23:41:05 PST 2022
Hi,
I use it a lot. For me it is a "logical" or "expected"
addition to Smalltalk's cascade syntax.
Smalltalk feels less lispish with it.
Additionally Haver is full of methods that use it:
--- snip ---
bear at speedy ~/h/Public-HaverOnCuis> pwd
/home/bear/hgwork/Public-HaverOnCuis
bear at speedy ~/h/Public-HaverOnCuis> find -iname '*.st'| wc -l
58
bear at speedy ~/h/Public-HaverOnCuis> find -iname '*.st' | xargs grep -l
'::' | wc -l
51
--- snip ---
In fact 4 of the 26 CUIS-patches I submitted contain
double-colon syntax, often in more than one place:
--- snip ---
bear at speedy ~/g/C/C/CoreUpdates> pwd
/home/bear/gitwork/Cuis-Smalltalk/Cuis-Smalltalk-Dev/CoreUpdates
bear at speedy ~/g/C/C/CoreUpdates> ls *Klix* | wc -l
26
bear at speedy ~/g/C/C/CoreUpdates> ls *Klix* | xargs grep -l '::' | wc -l
4
bear at speedy ~/g/C/C/CoreUpdates> ls *Klix* | xargs grep '::' | wc -l
9
--- snip ---
Alas, the pretty printer does not support it.
Fixing this is a bit complicated, because AFIR
the AST does not distinguish between these two
syntagmas.
OTH, if you want to make your double-colon-code portable
just pretty print it.
HTH and Best Regards,
Gerald
On 1/6/22 2:03 AM, Mariano Montone via Cuis-dev wrote:
> Hello,
>
> I discovered double colon syntax today, when I came across Parser
> class>>chainExamplesDoubleColon method.
>
> Looks like this:
>
> 3 + 4 :: negated " => -7 "
>
> How many of you already knew about it?
>
> Is it something specific to Cuis? Is it available in other Smalltalks
> too (perhaps in some other form)?
>
> Cheers,
>
> Mariano
>
More information about the Cuis-dev
mailing list