lua-users home
lua-l archive

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


From: Mike Kreuzer <mike@mikekreuzer.com>

What's wrong with checking in the function, or after it's returned?  I
don't see the issue.

From: David Given <dg@cowlark.com>

Now, whenever you call a method k on t, it'll actually attempt to call
k_type1_type2_type3... instead. This strikes me as being rather simple code
--- why do you consider such an approach unsatisfactory?

I don't believe that such a thing belongs into the parser. Nobo
...
...? I find this considerably clearer to read, as well as not needing any new
features. It makes it explicit the order of processing, for example --- in
your example, the 'local' line has the assertions on the left of the
expression, where the return line puts them on the right, which isn't terribly
clear.

Agreed. I only see a real benefit of such patch if it checked the types at compile time, plus (optionally) at runtime (for the cases when a value with "any" type is bound to a parameter with a specified type).

Ivan Kolev