lua-users home
lua-l archive

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


On Mon, May 24, 2010 at 4:10 PM, Enrico Colombini <erix@erix.it> wrote:
> Mark Hamburg wrote:
>>
>> The other thing this breaks is if one were using functions simply as
>
>> unique values. There are plenty of other ways to achieve that,
>> however.
>
> All this thread is definitely above my head, but (assuming I understood
> correctly) removing the ability to use functions as table keys and unique
> identifiers looks confusing. Sounds as if functions would be degraded to
> "first class and a half" values.
>
> Example: did I already call this function? I'd normally use "called[f] =
> true" to remember it. Or "called[f] = result" for memoization.
>
>  Enrico
>

In the specific case of memoization, the correct behaviour would still
always happen, as far as I can tell.

The "did I already call this function" pattern isn't one I can
remember using or encountering before. Does anyone have an existing
real-world example of a case where it is used?

(Don't get me wrong, I'm not trying to desperately fight for this
optimisation. I'm just interested in trying to accurately weigh the
bad against the good.)

-Duncan