Hi Nicolas--
How will we understand code when reading [the source for a method which uses a class whose name is used by multiple classes]? Hyperlink navigation?
That's one possibility. I expect there will be some visual cue in the rendering of the class name, so that the casual reader will know that there are other classes that also have that name. If the reader wants to know more about that class, the tools can provide more information (probably via a menu or hyperlink navigation). Keep in mind that this situation will probably be relatively rare in the first place.
The only concern is if one ever wanted to rebuild a system from source... Being asked for many choices, it would be quite boring... And it would be very hard to investigate code from others...
Indeed, I only intend this interactive mode of use to be used in the situation of a human entering source manually. I think we can bootstrap new systems without using source, by writing out object memories directly (rather like the system tracer and the Fenix work).
In case you want to merge two equivalent classes because they are doing mostly the same job, you'll have to recompile from source.
I don't think that's true. You could just transfer all the compiled methods into a common class programmatically. Any conflicts will probably have to be resolved interactively anyway.
I imagine you could maybe give a hint to the compiler so that it does not ask you twice the same question within the same compiling unit...
Sure; I expect there will be several environment preferences related to how chatty the compiler is during interactive development.
If you want to use shared pool keys in your code, you have to declare it somewhere (in class definition by now). Do you write something like (poolDictionaries: {Text constants}) instead of (poolDictionaries: 'TextConstants')?
Well, first of all there will be two pool-dictionary-related instance variables in Class instead of one ("publishedPools" and "receivedPools").
If that is the case, i see a little problem. If we store and initialize TextConstants in a Text classVariable, how would Text use CR constant itself? There is a bootstrap problem in class definition:
ArrayedCollection subclass: #Text instanceVariableNames: 'string runs' classVariableNames: 'TextConstants' poolDictionaries: {Text constants} category: 'Collections-Text'
Should TextConstants be declared and initialized in a neutral place?
I expect that a class' published pools (the pools for which it is responsible, and which it provides to the rest of the system) will be defined as part of class initialization. Thereafter, the pool objects themselves are transferred directly. The way class objects are transferred from one system to another in Spoon is much more sophisticated than using an expression like the one you cite above.
I also expect that the browsing tools will provide an actual user interface for interactively defining new classes, rather than the crude way we've been doing it all this time (editing an expression and evaluating it).
Finally, there won't be an inherent need to use class variables when defining or initializing shared pools.
Do per-method meta declarations like
<thisCompiler useSharedPool: Text constants>
make any sense?
It's doable. But personally, I'd find it confusing for every method to have its own compilation environment (potentially). I'd prefer to keep this decision with each class.
Sometimes we have to check for existence of a class. This can be done with (Smalltalk includesKey: #MyClass). VW has #{MyClass} construct... What is your replacement? Root class tree recursion?
Yes, searches from the root class.
Of course, you cannot rely only on name anymore...
Right, relying on the name alone was always risky! With the mechanisms you mention above, you're still not really sure you're getting a meaningful answer. What you really want to know is whether there is a class which implements a particular set of messages with a particular set of meanings (i.e., a particular interface).
You might also want to ensure that this class has some expected performance characteristics, or was written by a particular set of authors, or was written at a particular point in time, etc. You can make as detailed a query as you like in the scheme I propose.
From what you explained, i do not see major weak point in your approach. It seems consistent and quite solid to me.
Thanks for reading and for your comments!
-C
I expect that a class' published pools (the pools for which it is responsible, and which it provides to the rest of the system) will be defined as part of class initialization. Thereafter, the pool objects themselves are transferred directly. The way class objects are transferred from one system to another in Spoon is much more sophisticated than using an expression like the one you cite above.
I also expect that the browsing tools will provide an actual user interface for interactively defining new classes, rather than the crude way we've been doing it all this time (editing an expression and evaluating it).
In fact I do not understand why text is not good for defining classes. I think that relying on tools to perform extra things is fishy. What I would like is to have a declarative syntax for any construct so that we can manipulate then. I liked the approach of Ginsu.
Finally, there won't be an inherent need to use class variables when defining or initializing shared pools.
Hi Stef--
Is my hypothesis really true? "is the binding (and not the class) stored because that way a class can be recompiled/changed and the new object representing the class can be changed without having to go over all the method literal frames?"
Well, we could use identity-exchange ("become:") to get around that. No, I don't think that's why classes aren't stored directly as method literals. Associations are used for literal variables is so that the variable itself can have a name which is distinct from the name of the variable's value. Classes are stored in methods as literal variables just to keep things simple (the same mechanism used to push other shared variables is also used for pushing classes).
Fundamentally, the key of a shared variable association (the name of a shared variable) is provided for human convenience (in particular, so that the system can provide readable decompiled source), not because it's necessary for the system to run.
...do you only transfer method or also object?
Spoon systems can transfer any object. In fact, this is mandatory just to transfer methods, since method literals can potentially refer to any object.
Roel will start to work on a parcel like system for Squeak.
I'm sorry to hear that. :)
...I do not understand why text is not good for defining classes. I think that relying on tools to perform extra things is fishy.
You won't have to rely on tools for anything; you'll still be able to do everything programmatically. I was just mentioning in passing that there will be more convenient ways to do some things with tools.
thanks, Stef!
-C
spoon@lists.squeakfoundation.org