On 2007.12.07., at 20:06, Charles Oliver Nutter wrote:
> > John Wilson wrote: >> Note *none* of the above require the dynamic language to support >> optional static typing so I think it's an issue for Jython and JRuby >> too. > > It's not nearly as much of an issue as you think. I tend to see > categories of types here: integral types and composite types. When > calling dynamic typed methods, obviously type is not examined unless > by > the actual method being called. When calling static-typed methods, > JRuby > only has implicit coercions for integral types like strings and > numbers. > Composite types either need to actually be the type required by the > target method (it must implement Map if it's to be passed to a Map > method) or you must convert them into a type acceptable to the method > you want to call. In no cases do we attempt to automatically coerce > such > types since that introduces an unacceptable object construction, > conversion, and identity concern into method invocation. Oh yeah, identity. One of main reasons I like the MOP approach is that with wrappers, you were forced to give up object identity, as one part of the system interacted with wrappers, the other with wrapped objects, and it could also be that you had multiple wrapper instances for a single object. I don't want to paint it in bad light; these systems remain mostly manageable, but you always run into a corner case with identity sooner or later :-) > > > We don't try to pretend we're calling a dynamic language when we call > Java...we fail fast if we can't do an integral type coercion. Exactly my idea too of correct behaviour in this case. > - Charlie Attila. -- home: http://www.szegedi.org weblog: http://constc.blogspot.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "JVM Languages" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/jvm-languages?hl=en -~----------~----~----~----~------~----~------~--~---
