[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Proposal for table length operator
- From: Mark Hamburg <mark@...>
- Date: Wed, 15 Dec 2010 07:34:21 -0800
On Dec 14, 2010, at 8:28 PM, Mark Hamburg wrote:
> True. I guess it's more the issue that Lua has a number of more or less standard idioms that almost work until confronted with nil and so you can write idiomatic code that will be fine until you hit the case it doesn't handle and that doesn't generally get called out as not handled in descriptions of the idiom.
For example, the memoize construction in PiL 17.1 works fine for the use case in question but would not work if one needed to memoize a function that returns nil (or at least would result in the function being re-invoked in those cases).
One can argue that getting that sort of thing right is just a matter of paying attention to the details, but this is a detail that doesn't generally get a lot of play in the Lua literature.
Mark