|
|
Darren New wrote:
> Well.... I think it's one of the few languages where you can't tell
> whether something's invoking a function or adding a name to the namespace
> at compile
> time. It would seem to make writing parsers and such harder than it needs
> to be.
>
> I'll grant that there are a number of languages where (say) writing "F(5)"
> doesn't tell you whether F is a function, a pointer to a function, or a
> function that returns another function, say.
In Python, f(5) could be a normal function call if f is a function, a method
call if f is a bound method object, a method call if f is an instance of a
class with a __call__ method, or an object instantiation (passing 5 to the
__init__ method) if f is a class name.
Post a reply to this message
|
|