Damien,
Interesting! As an aside, I have a love/hate relationship with the RB, and
almost never let it rewrite any of my Dolphin code. The XP guys will recoil in
horror at this, but I have too often been saved by 18 month old comments to
have them disrespectfully scattered around my source. If that is fixed, I will
become a believer. I *do* use pull up/down to great advantage, and will
sometimes use other refactorings on new code that has not had time to
accumulate valuable comments.
The above said, I have considered doing something like your rewrite to fix
stream method naming snags. Consider #next. As we have discussed, I think it
should be named #nextOrNil, allowing #next to behave as it does in Dolphin.
Yes, I have a bias toward Dolphin, but I also consider its streams to be
elegantly/correctly built.
One way to fix it would be to transform #next into #nextOrNil (which is what
Squeak's #next does), and then add a #next that signals EndOfStream on
exhaustion; EndOfStream would have no default action in this scenario. If we
could further transform any idioms such as
aStream next ifNotNil:[ :x | ... ]
into
aStream nextIfPresent:[ :x | ... ]
etc., that could be great if we did it well. Even a clean change to #nextOrNil
would allow us to make an otherwise breaking change as painlessly as possible.
FWIW, I have no direct problem with #on:, though I see where you are going. We
might get a similar benefit by simply changing ReadStream in the system
dictionary, making it an alias for NSReadStream??
Bill
Wilhelm K. Schwab, Ph.D.
University of Florida
Department of Anesthesiology
PO Box 100254
Gainesville, FL 32610-0254
Email: [EMAIL PROTECTED]
Tel: (352) 846-1285
FAX: (352) 392-7029
>>> [EMAIL PROTECTED] 05/30/08 4:47 AM >>>
Hi,
I've just published in the pharo inbox a package for the System
category. This change has been generated automatically through the
rewriter:
ParseTreeRewriter new
replace: 'ReadStream on: [EMAIL PROTECTED]' with: '[EMAIL PROTECTED]
readStream';
yourself
The formatting of the changed method is completely different due to
the use of the refactoring browser. This makes the diffs not readable.
Even if it is a real problem, I don't see any simple solution. What do
you think?
--
Damien Cassou
Peter von der Ahé: «I'm beginning to see why Gilad wished us good
luck». (http://blogs.sun.com/ahe/entry/override_snafu)
_______________________________________________
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