Block argument scoping must be ugly sometimes, David! 
Author Message
 Block argument scoping must be ugly sometimes, David!

Quote:
David Simmons writes:
> I will say however, that having had to re-look at this issue in "gory"
> detail I am very inclined to think that block parameters should ONLY
> have block scope. The potential for mistakes, bad side effects, and
> misleading code outweigh any real benefits of allowing parameters to
> be globals (as STA currently does) or method temporaries (as STA and
> Digitalk allow).  It has been close to two years since I last looked
> into the issues.  In that time I have gained a great deal more insight
> into the nature of large code bases (i.e. the entire class library
> set) and related implementation issues. The added performance cost for
> allowing block parameters to be anything other than block scoped are
> not worth it. So we will probably transition our implementation to
> only allow block scoping of a blocks parameters.

No, David, don't do it!! The performance hit for dirty blocks when you
follow PPS's scoping rules can be so severe (I've seen a factor of 4)
that there must be a way for the programmer to bypass their rigorous
and elegant rules when the block is just too plain slow. Try some
performance tests in STA and you'll see. Better, buy a copy of ST80
and try some tests with it. There's an example (Marten Feldtmann's
count loop) in my article in the June issue of The Smalltalk Report.

You need to get a copy of ST80 anyway. The user manual alone lucidly
explains many points on which you are speculating, such as how the
memory spaces are organized and how the GC works.

I think the reason your STA decisions have stirred up such vigorous
discussion in the newsgroup is that your product is so interesting
that we want to make sure you get it off the the best possible launch.
You are also overwhelmingly more responsive than the other vendors,
which I for one appreciate. I'm not criticizing the PPS and Digitalk
people who monitor the newsgroup--I'm sure they're already overworked.
You must be more so!
--
**********************************************************
* Bruce Samuelson       Department of Linguistics        *

**********************************************************



Sat, 17 Feb 1996 13:44:18 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. 07 looking for DAVID LOCKE DAVID LOCKE DAVID LOCKE DAVID LOCKE

2. 01 looking for DAVID LOCKE DAVID LOCKE DAVID LOCKE DAVID LOCKE

3. Block arguments vs method arguments

4. Pretty-printing ugly blocks of SQL?

5. file upload-problem: my computer sometimes blocks

6. command line arguments processing: an ugly lpr wrapper

7. Question on scoping of LOC argument

8. Clocks: Was: Ugly Ugly BeBox

9. Loops, sometimes it works, sometimes not.

10. Lexical scoping good, dynamic scoping bad

11. std blocks vs blocks+cache ( was: block behavior)

12. multiple blocks or proc arguments to method

 

 
Powered by phpBB® Forum Software