The Artima Developer Community
Sponsored Link

Agile Buzz Forum
Multimethods in VW

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
James Robertson

Posts: 29924
Nickname: jarober61
Registered: Jun, 2003

David Buck, Smalltalker at large
Multimethods in VW Posted: Dec 24, 2003 3:58 AM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: Multimethods in VW
Feed Title: Michael Lucas-Smith
Feed URL: http://www.michaellucassmith.com/site.atom
Feed Description: Smalltalk and my misinterpretations of life
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From Michael Lucas-Smith

Advertisement

Someone I've not had the chance to talk to yet has added Multimethods as a new package to the public store for VW. It's an interesting idea, being able to switch methods based on the types of arguments passed in. In the same token, it is limited because you cannot really programmatically test each argument to switch methods in a simple way.

What I want to say to the author is this: If class 'A' implements printOn: aStream and I extend it to include printOn_withFooBar: aStream, the original method will pick up the call and the DNU will not see it.

How can this be worked around? Well, to tell you the truth, I'm not sure it can. You could add a stack manipulator into the printOn: to check for multimethods and adjust the stack accordingly instead of running the code it has. That'd be a simple one line insertion in to the printOn: method, such as 'self adjustForMultimethods.'. Or you could do a #perform: like action from the sender side, that would check for multi methods before committing to the selector it's going use.

Either solution isn't so nice IMHO.

Interesting idea though. I'm not a big fan of the explicit implementation he's ended up with thus far. But keep the interesting ideas rolling in :)

Read: Multimethods in VW

Topic: Re: Knowing How Code Works Previous Topic   Next Topic Topic: Complexity and development

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use