[self-interest] simplicity
Brian Rice
water at tunes.org
Tue Jun 29 01:20:04 UTC 2004
On Jun 28, 2004, at 12:55 PM, Ian Woollard wrote:
> Michael Latta wrote:
>
>> If I can paraphrase your position:
>>
>> Reference counting is more deterministic when releasing resources that
>> have semantics beyond bits in memory.
>>
>> I would agree with that statement.
>
> More generally, I would argue that Smalltalk/Java/Self rely on the
> programmer for deterministic resource release.
I don't really care to get into this (read: reply to further posts in
the same vein), but this seems truly ill-informed about Smalltalk or
any language with extensible syntax and blocks (Ruby). I can define:
FileStream class>>named: filename do: aBlock
| file |
[file := FileStream open: filename.
aBlock value: file]
ensure: [file ifNotNil: [file close]]
and use it as such:
FileStream named: 'foo' do:
[:file |
self doSomethingWith: file.
self doSomethingElseWith: file]
So now, we're not just talking about closing the file, but opening it
as well, with the VM supporting ensure: semantics so that the finalizer
is just a fallback. With ensure: or mechanisms like it, you can /alter/
your blocks into C++-style blocks without having to architect language
support for it, or limit your block semantics to stack-allocation
limits of semantics.
I am always suitably impressed by the number of people on this list who
like Self but don't have a firm grasp of its much broader basis,
Smalltalk-80. Self has quite poor libraries and as such is a
demonstration and not a system that should be considered on its own
unless you cite Smalltalk and really understand it.
--
Brian T. Rice
LOGOS Research and Development
http://tunes.org/~water/
More information about the Self-interest
mailing list