[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Unexpected error using tostring
- From: Dirk Laurie <dirk.laurie@...>
- Date: Sat, 9 Mar 2019 19:10:51 +0200
> While the OP might be pushing things a bit hard, I think he does have a point. LUA_TNONE *is* a slightly odd way to indicate that you are “off the end” of the stack.
>
It's in principle no different that the time-honoured Fortran trick of
returning -1, -2 etc for errors in a function that should return a
positive integer, or from Unix retund codes of processes.
> As I’ve said before (though Roberto disagreed), “nil” in Lua is subtly overloaded to mean both “no value” and “not present”. In many cases this doesnt make a practical difference, but when it DOES, it can be confusing since the lack of distinction in most cases lulls new users into thinking there IS no difference; witness all the arguments about sequence.
I've never been impressed by arguments involving alleged pontes
asinorum for new users, Nobody stays a new user for long. Sure, the
difference is subtle, but once grasped , never lost.