lua-users home
lua-l archive

Re: Has Lua reached perfection?

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 2018年01月28日 12:19 PM, Paige DePol wrote:
Soni They/Them L. <fakedme@gmail.com> wrote:
On 2018年01月28日 12:04 PM, Paige DePol wrote:
Soni They/Them L. <fakedme@gmail.com> wrote:
I want a switch where you can use math.random() in switch cases and it
lazy-evaluates them and just works.
What practical use would that even have?
~Paige
It's equivalent to if...elseif chains and supports ==
I meant using math.random() as a case value.
I think I'd need to see a code example of what you mean
to understand how this switch block would work.
~Paige
It's just a natural consequence of evaluating them in-order and supporting ==, like a desugaring into if...elseif chains.
--
Disclaimer: these emails may be made public at any given time, with or without reason. If you don't agree with this, DO NOT REPLY.

AltStyle によって変換されたページ (->オリジナル) /