AW: [FYI] Java vs Squeak/Smalltalk
Andreas Raab
Andreas.Raab at gmx.de
Sun Jan 20 15:49:27 UTC 2002
Hi Ken,
> If you mean error recovery code that is part of the behavior
> of #new for ByteArray then why isn't it done?
Yes, that's what I mean with error recovery. Why it isn't done?! Good
question. I think it's mostly because (at least so far) nobody was
overly interested in making non-primitive numbers of the kind you're
describing. And because of this, nobody ever run into this
implementation-specific trap. I mean it's not hard to think of a method
like #asPrimitiveNumber which notion would be to specifically return a
primitive number for use in primitive operations.
> Suppose I come along with some great debugger or program analysis tool
> that works as follows. I define variants of all the built-in types
like
> numbers that maintain a data structure of the history of the messages
they
> receive and also forward all messages along to the primitive object. I
> want to use my version of numbers to used while running arbitrary
Smalltalk code.
> If everything treated my version of numbers the same as the
> primitive numbers that they emulate all would be fine. But it doesn't
seem
> to work that way and I'm trying understand why it doesn't get fixed.
One answer to the latter would be "hey, it's Open Source, if you want it
fixed, fix it" ;-)
Another (more realistic perhaps) one is that in fact, various people are
working on getting many of the more problematic aspects fixed here (I
should note that there are a few other implementation tricks at work
which would make your example even harder to work). See some of the
discussions between Stephen Pair and Rob Withers for example. They've
discussed a variety of problems and solutions to issues that come up
when you're trying to do completely transparent forwarders.
> Now of course you need to bottom out somewhere but this was
> first done in actor languages in the 70s. Behavior is all that
> should count though of course somewhere the implementation has
> to cheat and see if something is primitive or not. But that shouldn't
> show through.
True enough. "You can cheat but you mustn't get caught" ;-)
Cheers,
- Andreas
More information about the Squeak-dev
mailing list
|