[Pharo-dev] Visit/accept method naming philosophy

Ben Coman btc at openInWorld.com
Sat Nov 8 10:29:10 EST 2014


Alain Rastoul wrote:
> trying to be more concrete (and still not sure of pragma
> syntax and capabilities) I wonder if with methods in the image like:
> 
> OSMorphicEventHandler>>accept: aMouseEvent
> <pragma: precondition parameter:aMouseEvent isKindOf: OSMorphicEvent>
> 
> OSXWindowEvenHandlert>>accept: aMouseEvent
> <pragma: precondition parameter:aMouseEvent isKindOf: OSMorphicEvent>
> 
> OSMarsWindowEvent>>accept: aMouseEvent
> <pragma: precondition parameter:aMouseEvent isKindOf: OSMorphicEvent>
> 
> SignalHandler>>accept: aSignalEvent
> <pragma: precondition parameter:aSignalEvent isKindOf: SignalEvent>
> 
> 
> browsing  OSWindowMorphicEventHandler>>handleEvent:
>      OSWindowMorphicEventHandler>>handleEvent:
>          morphicEvent := anEvent accept: self.
>          or
>          morphicEvent := anEvent accept: aVariableEvent.
> 
> current class beeing a  subclass of OSMorphicEvent (type of self),
> and aVariableEvent type beeing known (NEC/NEOController/model ?)
> it couldn't be possible to find  or filter relevant methods for both,
> excluding SignalHandler (filtering on accept: methods with good pragma 
> signature) ?
> 
> Regards,
> Alain
> 
> 
> 

Thanks for the concrete examples.  So you may be right.  If you can 
demonstrate it working reliably, it would be easy enough to rename 
#acceptXxx: methods back to #accept:.

cheers -ben




More information about the Pharo-dev mailing list