fromString: default method

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

fromString: default method

Ralph Boland
Squeak has half a dozen methods with the name  fromString:
with the exact same code and I am about to add another
for my project.  The code is:

fromString: aString

        ^ self readFrom: (ReadStream on: aString)


Should not this method be in  Object  and all classes with the
exact same code remove the code and inherit this method
instead?

Regards,

Ralph Boland



--
Volume * Density = Mass.
Volume / Density = Intelligence.
The latter equation explains the
essentially equal intelligence of men and woman
and the capabilities of some commonly used operating systems.

Reply | Threaded
Open this post in threaded view
|

Re: fromString: default method

Randal L. Schwartz
>>>>> "Ralph" == Ralph Boland <[hidden email]> writes:

Ralph> Should not this method be in  Object  and all classes with the
Ralph> exact same code remove the code and inherit this method
Ralph> instead?

Class-side, right?

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[hidden email]> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion