Re:Errors are values
by shiro on Tuesday January 13, 2015 @02:13AM
(#8878556)
Just curious---doesn't that pattern inhibit you to return nil as a meaningful, valid result? Or is nil treated as invalid value in Lua culture?
[ Parent
| on HN ]
Re:Errors are values
by kazagistar on Tuesday January 13, 2015 @03:09AM
(#8878666)
Neither. It just basically never happens that you want both
error reporting and a maybe (nil or value) from the same function. Not in list? Nil. Could not parse? Nil. Iteration ended? Nil.