Em 08-06-2011 06:13, Ryan Davis escreveu:
> On Jun 8, 2011, at 00:44 , Charles Oliver Nutter wrote:
>
>> I might be more inclined to a keyword or pseudo constant along the
>> lines of __FILE__, like __MAIN__ that produces true iff __FILE__ ==
>> $0. Something we can statically determine before runtime without
>> digging around in the caller's frame.
> While I think the feature request is a bit inane to begin with, I think __MAIN__ is a beautifully pragmatic compromise. Easy to implement on all impls, non-hacky, and yet makes its intention very clear.
I like the idea too. I just think that Ruby is very simple to start with
because it is very consistent and with a few rules. Someone would expect
__MAIN__ to be a constant, which is not. Maybe something like __MAIN?
would show the contrast to something that seems to be like a constant
(MAIN) but doesn't seem at the same time (?). I know this is still
confusing, but I prefer something like this instead of a pure __MAIN__...