News for hackers. Stuff that matters.
Re:A polyglot's guide to multiple dispatch by StefanKarpinski on Tuesday April 19, 2016 @11:46PM (#11532130)
> But then, what is the point of foo being associated with the class of bar?

One benefit is that the name `bar` is looked up in `foo`'s namespace, which means that it doesn't have to be in the current global namespace. This is a mixed blessing, but it's sometimes what you want.

Re:A polyglot's guide to multiple dispatch by kazinator on Wednesday April 20, 2016 @02:05PM (#11536398)
That's an interesting point and basically leads us to "member generic functions". An object has some static slot which is a function, and treated as a method: it can be called obj.meth(args, ...). But, this method is also a generic function. A generic function is a function; an object can have a function, and so an object can have a generic function.
Re:A polyglot's guide to multiple dispatch by wtbob on Thursday April 21, 2016 @11:39AM (#11542947)
You're quite right, but does it make sense to conflate objects and namespaces that way? Might it not make more sense to separate the concerns?
Re:A polyglot's guide to multiple dispatch by kazinator on Thursday April 21, 2016 @08:01PM (#11546192)
Object must have name spaces by definition, because they are collections of named properties.

These name spaces do not have to be conflated with program lexical scopes, whereby if you are a piece of code such and such a "blessed" function, you "see" the name space of the class as if it were lexical variable bindings.

You definitely don't want crud like different scopes in the program which are all working with exactly the same object, and want to access slot S, but they all refer to a different S because they are associated with a different place in the inheritance hierarchy, and that hierarchy contains unrelated slots named S at different levels. A given object must just have one S.

Re:A polyglot's guide to multiple dispatch by akavi on Thursday April 21, 2016 @12:05PM (#11543178)
It might, but it also might be more typing/visual noise for little benefit.