lua-users home
lua-l archive

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


Hi Roberto and Jorge

If the function was just returning nothing, that would be ok. But
in fact it is returning an error indicator followed by the error
message. To mix an error indicator with an absent value is what bothers
me.
But what value could be that error indicator? Or you thought about changing the whole model to something like exception handling constructions? In that case the error indicator would be internal to the VM no?

But nil is not a value.
Yes.  I would call it a non-value (something like NaN ?)

And if a
application has some other meaning for nil besides "absence of value",
perhaps something from the application domain, then I think said
application is badly designed. In that sense, in application domain,
nil is not a "perfectly valid return"
In SQL, NULL is that kind of value. And the mapping of NULL to nil is quite natural, although sometimes the programmer have to take care (for instance, not to make a query that could result in NULL at the first column of a valid row).

In fact, I think part of this discussion also applies to the domain of database languages such as SQL.

Regards,
Tomás