[Newbies] Defining a class at runtime
Bert Freudenberg
bert at freudenbergs.de
Fri Jul 20 10:31:45 UTC 2007
On Jul 20, 2007, at 11:57 , Marcin Tustin wrote:
> On 7/20/07, Bert Freudenberg <bert at freudenbergs.de> wrote:
> On Jul 20, 2007, at 11:31 , Marcin Tustin wrote:
>
> >
> >
> > On 7/20/07, Bert Freudenberg <bert at freudenbergs.de> wrote: On Jul
> > 20, 2007, at 8:52 , Louis Moon wrote:
>
> > ...and yes, of course, there is a runtime.
>
> Well, you could say there is only runtime. Which makes the term
> useless, as it implies some sort of opposite.
>
> Then how would you refer to runtime? In any case, we can oppose it
> to code-definition time. Nothing exciting may happen then, but it's
> worth being able to talk about it.
There is no technical distinction. All you do when "defining code" is
creating an instance and adding it to a dictionary in some object.
That's no different from other activities you do at "runtime".
The instance might be an instance of a metaclass and the dictionary
might be held in a global variable called Smalltalk. Or the instance
could happen to be a CompiledMethod instance, and the dictionary
would be the method dictionary of a class object. So what?
Sending messages, creating instances, storing them in fields of other
objects, wouldn't you call that "runtime" if you insist on that term?
- Bert -
More information about the Beginners
mailing list