[squeak-dev] Re: talk on Newspeak online
Klaus D. Witzel
klaus.witzel at cobss.com
Fri May 9 18:27:28 UTC 2008
On Fri, 09 May 2008 18:49:07 +0200, Vassili Bykov wrote:
...
> Regarding prototypes--this isn't a model Newspeak supports *as part of
> the language standard*. But before you say "boo!"--neither does
> Smalltalk. A particular Smalltalk *system* may allow making a behavior
> an instance of itself as an implementation-specific feature.
> Smalltalk-80 had no facilities for that.
Do you mean that the following steps are not possible:
1] myPrototype := Behavior new
2] initialize the instVars of myPrototype properly
3] myPrototype class become: myPrototype
Why shouldn't that be possible, right from the beginning of Smalltalk-80?
> Adrian Kuhn first implemented
> his Protalk on VisualWorks last year, but a year or so before he
> wouldn't be able to.
Adrian mailed me his Squeak implementation in which (IIRC) he makes use of
Squeak's #primitiveChangeClassTo: as a "safer" way of above step 3] but
the rest is same as above. My response to him was that I've invented that
as well ;) In his words from his Protalk page:
Protalk is pure Smalltalk, it relies on two features that had been hiding
in plain sight since Smalltalk-80
o Every object can possible be used as a class
o The class of an object can change after instantiation
I fully agree with Adrian. FWIW behaviors as instances of themselves seem
to have been invented by the many, IIRC Dan was mentioned here in
squeak-dev by someone, some time ago.
Ergo, the facilities for prototypes (behaviors as instances of
themselves), in Smalltalk #class and #become:, date back to the invention
of Smalltalk.
FWIW it might be possible that some VMs don't do #become: with all (or
some non-smi) objects, that would be sad because then the developers who
use such "crappy" VMs wouldn't be able to use the industrial light+magic
of Smalltalk ;)
/Klaus
More information about the Squeak-dev
mailing list
|