lua-users home
lua-l archive

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

On Wed, Dec 10, 2014 at 3:29 PM, Dirk Laurie <> wrote:
> 2014-12-10 18:24 GMT+02:00 Andrew Starks <>:
>> On Wed, Dec 10, 2014 at 8:52 AM, Dirk Laurie <> wrote:
>>> 2014-12-10 16:44 GMT+02:00 Rena <>:
>>>> Interesting. Why is __tostring not a core metamethod? The distinction
>>>> seems arbitrary to me.
>>> A core metamethod is a fallback. It is called when Lua does not
>>> know what to do, as a last resort instead of throwing an error.
>>> __tostring, __pairs etc are called _instead_ of what Lua knows
>>> to do.
>> I don't make that distinction, even when I'm reminded that the authors do.
> Understanding what the authors do and why they do it is in
> the long run more productive than sticking with one's
> ({'principles','prejudices'})[math.random(2)].

It's a matter of frequency in the pattern. The less frequency, the more effort required. If it is a 2 dimensional continuum, where blissful ignorance fades into a "possession of truth", then in the middle is vague anxiety that "there is something that I should look up when I use this." Over time, if it comes up more, it will be committed to memory. This is what I think of when someone says, "The dark corners of X." It doesn't have much to do with preference; mostly it's a lack of repetition. Although, if I thought it was especially clever or crazy, it might push itself into my memory.

And since it fits within the same vicinity as your observation,

Roberto wrote:
> Not at all. We just reason in the world of reasoning ;-)

I was going to reply with something about how two people may value different things and then reasoning might lead you to a different answer. I think that you probably hold the view that a design that is as simple as possible is always easier to explain and therefore use, than one that accommodates large, semi-overlapping groups of shared expectations.

So, now I won't argue that.