2009/10/28  <[email protected]>:
> Em 28/10/2009 17:52, Lukas Renggli <[email protected]> escreveu:
>
>>
>> >> What would be your isAbstract be useful for?
>> > To know whether it is wise to instantiate a class or not
>
>> That would be a pure guess  then. Presumably you will still have to
>> look at  the implementation, at  the documentation, at its  users or
>> study the coding conventions of the project to know for sure what to
>> do with the thing.
>
> Yes.
>
> Thinking aloud: if we want to insure a class shall not be instantiated, 
> shouldn't we put an error in #new of that class?

That would be the shortest way to freeze you image:
Object>>#freezeMyImage
   ^self subclassResponsibility

...and you could not create any instance of Object and its subclasses anymore
(but via a few primitives bypassing this mechanism).

Beside, do you want a runtime check at each creation ?
We would have to cache the information at least...

Nicolas

>
>
> _______________________________________________
> Pharo-project mailing list
> [email protected]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>

_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to