|
Re: cloning/invocation: msg#01350lang.smalltalk.squeak.general
On Wednesday, August 28, 2002, at 11:20 Uhr, Jecel Assumpcao Jr wrote: On Tuesday 27 August 2002 18:23, Marcel Weiher wrote: Er, no. A *method* in Smalltalk and a C/Pascal function consists only of the parts you describe as "the immutable part". Values for arguments are not defined inside the method, they are provided externally in a method context / stack-frame, which is not part of the method. Both together are necessary for the invocation/execution to work. Values for temporary variables are also not copies of the method, they are initialized by code running in the method. Regarding any assignment statement that is ever executed in a method as "copying the method" is an 'interesting' point of view, but not one that I find particularly compelling. Either making a full copy or a partial copy You are calling something a copy that isn't a copy. When I pass arguments into the function, I am not making a copy of anything that is inside the function. Quite the contrary, I am providing information to the function that lives *outside* the function. Not making a copy at all will give you a different behavior. In No. Without a copy, two Exactly. You create a *new* stack frame and then initialize it with *new* values. How do you do that? By No, not even with your somewhat creative definition of "copying", which only applies to literals anyway. To make this clear, consider the following example: int foo( int arg1, int arg2 ) { return arg1 + arg2; } See, no copying of the function at all, but I still have invoked a function and passed it parameters. With a copy, each one has a separate state. Yes, allocate a *different* memory. addresses for "count" and "max", and each one will copy 0 and 99 to Er, not really. See above. those memory addresses. We can make them not copy by doing That has nothing to do with it. Of course, the declarative "invoke with arguments" will almost Yes, it did. It made it clear that you are (a) using a somewhat creative point of view wrt 'copying' and (b) still wrong, even if I accepted that POV (which I don't). Yes. I am fully behind the importance of interactive object Yup. With copying and modifications, you have to remember and be aware of I don't see any reason why they would want to do that, but that is not at all what I am talking about. I am saying that I want something like (1) to be usable with objects as well as methods. However, we do use object instance this way (2). As far as I can Well, I have a bit of a problem with a "unifying mechanism" that is used neither (a) by the user nor (b) by the implementation. If there is no actual leverage, maybe the mechanism isn't actually useful? My current approach is to say that (1) is the unifying mechanismmm Glad you like it :-) In fact, if you allow lexical scoping you can actually Could very well be. However, I am not in the "I have one construct that can do everything" business. I call that "Turing-envy". ;-) I am more interested in finding useful/usable mechanisms that might have a chance at tackling the "abstraction problem" I think we have in CompSci (in addition to some strange asymmetries in OO). We can always refactor later ;-) I am trying to convince a Interesting! I am currently busier actually trying this construct ( constructed objects -> parametrization -> use of parametrized objects) in real-world situations, with existing languages. My own proposal was in a different direction, but that I was just following up on Alan's comments about "Exemplars". Not sure what he has in mind there, but it does sound similar in some respects. Compare this with the model Hmm...a byte-coded interpreter seems like a very specific implementation of the message-passing object system that is Smalltalk. But I do think that different levels are part of the problem.. You will probably tell me that the "normal" But (see above) it seems to me that there is a level in the middle that isn't actually productive, because its model is neither used in the implementation nor presented to the user. What's it doing there? At the very top level we can Sure. Though I'd actually try to limit "typing of expressions" and doing "print it" as much as possible. I'd much rather connect reasonably smart components, and resort to expressions (preferably just constraints) only when absolutely necessary. [snip] And of course, this implementation might run on a processor that Yes, you should never forget about the turtles ;-) Anyway, this is all too low-level for me anyhow, and method Great! Marcel
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: [BUG]Collection>>removeAll:, Tim Rowledge |
|---|---|
| Next by Date: | [BUG] WorldWindow not correctly drawn., Alan Grimes |
| Previous by Thread: | c correction (was: cloning/invocation), Jecel Assumpcao Jr |
| Next by Thread: | [BUG] WorldWindow not correctly drawn., Alan Grimes |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |