[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: about 'fail'
- From: Scott Morgan <blumf@...>
- Date: Thu, 10 Oct 2019 02:10:42 +0100
On 10/10/2019 00:03, Soni "They/Them" L. wrote:
>
> if select('#',...) was built into the language instead of being a C-ism
> (as in, something that leaks C API details) then for loops could've just
> stopped on no value.
>
Kinda related, and Just spitballing here: Been wondering if tuples
should be fully supported in Lua. We already have the ... operator, that
kinda acts like it, why not go all in?
> local tup = make_tuple('a', nil, 3) -- imagine better syntax here
> =tup[1]
a
>#tup
3
> local x,y,z = tup
> =x,y,z
a nil 3
> local tup_copy = return tup
> =#tup_copy
3
>tup[2] = 'foo'
* Error: Tuples are read only
> local pi = make_tuple(3.1425) -- consts ;)
> for x in tup do print(x); end
a
nil
3
Maybe do car and cdr functions too :)
Scott
- References:
- about 'fail', Phil Leblanc
- Re: about 'fail', Egor Skriptunoff
- Re: about 'fail', Roberto Ierusalimschy
- Re: about 'fail', Oliver Kroth
- Re: about 'fail', Egor Skriptunoff
- Re: about 'fail', Roberto Ierusalimschy
- Re: about 'fail', Soni "They/Them" L.
- Re: about 'fail', Roberto Ierusalimschy
- Re: about 'fail', Ahmed Charles
- Re: about 'fail', Jonathan Goble
- Re: about 'fail', Soni "They/Them" L.