comp.lang.tcl
[Top] [All Lists]

Re: merging variables and arrays ...

Subject: Re: merging variables and arrays ...
From: Alexandre Ferrieux
Date: Fri, 30 May 2008 08:28:00 -0700 PDT
Newsgroups: comp.lang.tcl

On May 30, 4:41 pm, Andreas Leitgeb <a...@xxxxxxxxxxxxxxxxxxxxxxxx>
wrote:
> Alexandre Ferrieux <alexandre.ferri...@xxxxxxxxx> wrote:
>
> > Now in the meantime you have made another interesting suggestion with
> > odd-numbered lists. I must admit it is elegant.
>
> Thanks, but it also has it's "con":
>   It would corrupt the idiom:  foreach {key val} $dict {...}
>     by causing it to iterate once more for the default value
>     appearing as "key" associated with an empty val.
>     I fear this is quite severe, even though [dict for ...]
>     would be a correct alternative.
>     Just too much old code uses [foreach] with [array get]
>     despite the inefficiency of dict->list conversion/shimmer.

Argh. You're unmistakably right :-(
Then it looks that it will be hard to serialize a dict's default.
This brings us back to Donal's idea and my suggestion of a syntax...

(I know dicts are not your focus; I'm just following a side branch)

-Alex



<Prev in Thread] Current Thread [Next in Thread>
Privacy Policy