lua-users home
lua-l archive

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


From: "Will Leshner" <will@softbook.com>
>

> Then assignment should be an expression. And why can't I do something like
>
> x = while y < 10 do y = y + 1 end

No you're definitely moving into sceme country... :)

What is the above supposed to mean? Or, rather, what
would you like x to be? 10? What is the return value
of a loop -- the return value of the last
expression/statement in the loop? Or should we perhaps
use a "return" statement in loops as well? Or make
"return" statements obsolete in functions?

This might be a good ideas in some languages, but in
a (predominantly) imperative language, it seems...
well... strange to me.

> I imagine that might really by a maintenance nightmare,
> but it wouldn't have to be used by somebody worried
> about such things.

The problem is that you usually maintain other people's
code.

What you are proposing is in essence a completely
new/different language; scheme with "imperative
syntax" so to speak. If you make it I will most
certainly play with it, but warping Lua to such a
degree seems excessive (and improbable).

--

  Magnus Lie Hetland         http://www.hetland.org

 "Reality is that which, when you stop believing in
  it, doesn't go away."           -- Philip K. Dick