[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: syntax across languages (Lua)
- From: Pixel <pixel@...>
- Date: 03 Jan 2002 01:39:03 +0100
nop@nop.com writes:
[...]
> > > - dictionary constructor: { a=b, c=d }
> > > dictionary access: a[e]
> > >
> > > I don't know if the changes come from lhf (if this is the case, I accept
> > > them ;-), but I wrote { a="b", c="d" } and a["e"], because the above syntax
> > > works only if b, d and e are variables with non-nil values. And in this case,
> > > a[e] isn't the same thing than a.e
> >
> > i don't think such a differentiation goes along with the goal of
> > syntax-across-languages.
>
> Actually, this was a mistake in my submission too.
>
> Given keys k1 and k2, and values v1 and v2, the general lua dictionary
> constructor is:
>
> {[k1]=v1, [k2]=v2}
[...]
> That's the trickiest problem I saw in our Lua submissions; you'll have
> to decide how you want to present it.
For the moment, I'll keep the simplest form { k = v }
One day, if I try to detail things (some stuff alike this occurs in perl and
others), i'll use this nice explaination.
thanks!