Multiple Returns, was Re: Common Lisp style macros inSmalltalk?

Lex Spoon lex at cc.gatech.edu
Wed Jan 19 16:27:32 UTC 2000


Chris Reuter <cgreuter at calum.csclub.uwaterloo.ca> wrote:
[ deleted: Tuple class ]
> 
> I like this idea but I'm a bit disturbed by the thought of
> automatically creating subclasses.  In my mind, classes are code and
> thus more precious than most of the other objects (which are usually
> created by code anyway).  Creating new classes on the fly means that
> suddenly, there is code that is not human-created.  (GUI builders that
> generate C code frameworks also bother me for the same reason.)
> 
> What would be involved in adding the concept of disposable
> classes--classes which don't show up in the browser, don't have source
> code for their methods and go away when they're not needed?  If they
> don't have names, they would go away when the last instance is
> reclaimed.  If we use those, we can create classes that are clearly
> not 
> 

It should be possible to implement these "disposable" classes.

However, I would suggest that the best use of this Tuple construct would
be for design-while-coding.  If you just want to try something out, it's
really a high overhead to define a new class with a proper name and all
the initialization and access methods.  A good programmer would come
back and make it into a real class before distributing the code too far.

With this latter viewpoint, you wouldn't want the new classes to automatically
go away, because you'd like to use them as a basis for refactoring later.  *Some*
way to get rid of unused tuple-classes would be nice, however; how about
having a manual method to remove all unused tuples?  If they really are in
use, then the classes will be recreated before long, anyway.  And this will leave
the classes around in the interim for programmers to fiddle with.

Lex


PS -- Come to think of it, how about calling it a "record" instead of a
"tuple"?  Usually a "tuple" is indexed with numbers, just like an array,
whereas a "record" is indexed by name.  (Can anyone see why I dislike
having the "overhead" of naming a new class?  It takes me forever!)





More information about the Squeak-dev mailing list