User loginNavigation |
archivesMessage Passing vs. Multi-Methods; Mixing the two?Even though message passing can be thought of as a special case of the generic functions approach, there still seems to be something appealing about grouping procedure implementations and their shared data into logical units as in Smalltalk. I understand that polymorphic dispatch need not be conflated with program modularity / encapsulation, but for some reason it still feels like a good idea to me. I looked around this afternoon for a good discussion of multi-methods vs. message passing and came up empty, so I'm wondering if anyone could point me to one or share their thoughts on the issue. I am interested in writing a lispy scripting language that integrates with the Apple's Cocoa environment, which is based on Smalltalk and therefore hardcore message-passing based. I would like a seamless connection into that world from this language. But I also want the power of multi-methods. I am imagining a language in which first-class namespaces could be blended with the Smalltalk approach to objects, exposing methods that respond to messages. But within these namespaces multi-methods could be used when they seemed appropriate. Therefore, in the large, the program would be assembled out of modules that resembled Smalltalk objects, but the implementation of methods exposed by these modules could have a lispier style. This is all very vague I know... and there's the obvious question of where multi-methods would belong. Any ideas? Type Inference in Object Oriented LanguagesIs it possible to do type inference of an object oriented language (such as Java) without any type annotations? I've never seen it done and I'm curious about why that is. During my limited exposure (to type inference in general) I've been taught that it is possible to do type inference of rank 1 polymorphic functions but the general case (rank 2 and up) is undecidable without type annotations. How does this relate to the type of polymorphism used in object oriented languages? The R ProjectOne of my best friends is a Ph.D. student in a well-respected geology department, and an avid R user. He informs me that the programming language "R" is highly fashionable in his department, and is increasingly popular across his field. I mention this because R encourages functional programming, and I have not heard it mentioned on LtU. Here is a quote from the language manual:
Here is another quote from the FAQ:
The upshot is that "S" is dynamically scoped while "R" is lexically scoped. I applaud R for getting this right, but the FAQ makes an interesting counterpoint that I paraphrase here:
Other than scope, R tries to be as close to S as possible. I'll end with two amusing remarks from the introduction:
Enjoy. |
Browse archivesActive forum topics |
Recent comments
23 weeks 8 hours ago
23 weeks 12 hours ago
23 weeks 12 hours ago
45 weeks 1 day ago
49 weeks 3 days ago
51 weeks 20 hours ago
51 weeks 20 hours ago
1 year 1 week ago
1 year 6 weeks ago
1 year 6 weeks ago