[squeak-dev] Two methods sharing source code?

John Thornborrow john at pinesoft.co.uk
Thu May 29 14:32:35 UTC 2008


Use blocks and an accessor?

MyObject>>myBlock
  ^[:anObject | anObject doSomething]

MyObject>>foo
   ^self myBlock value: 1

MyObject>>bar
   ^self myBlock value: 2

HTH,
John

Martin Beck wrote:
> Hi there,
> for some reasons, I want to have two methods sharing the same source 
> code base. So if I change one method within the browser, the other would 
> change, too. Is this possible in Squeak? And, would the usual tools work 
> with that?
> 
> Regards,
> Martin
> 
> 

-- 
John Thornborrow
http://www.pinesoft.co.uk


******************************************************************************************************************************************
This email is from Pinesoft Limited. Its contents are confidential to the intended recipient(s) at the email address(es) to which it has been addressed. It may not be disclosed to or used by anyone other than the addressee(s), nor may it be copied in anyway. If received in error, please contact the sender, then delete it from your system. Although this email and attachments are believed to be free of virus, or any other defect which might affect any computer or IT system into which they are received and opened, it is the responsibility of the recipient to ensure that they are virus free and no responsibility is accepted by Pinesoft for any loss or damage arising in any way from receipt or use thereof. *******************************************************************************************************************************************


Pinesoft Limited are registered in England, Registered number: 2914825. Registered office: 266-268 High Street, Waltham Cross, Herts, EN8 7EA



More information about the Squeak-dev mailing list