Jump to content

redcorner2000

Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by redcorner2000

  1. You can have your own opinion. The general definition of delegation in programming is a call in the context of another object(implicity or explicity).
  2. Like this: define method = blabla{x} define class Example where x = foo, bar = global blabla call Example.bar > foo You have to keep in mind that Google is about politics, and if you search like a dilettante, you won't find anything there. I clarified and gave some examples maybe like that define method = blabla{x} define class Example where x = foo call blabla with contextOf Example > foo Example.x = baz // redefinition call blabla with contextOf Example > baz Delegation means that the called method or property is not in the environment of the object, but delegates it to its class or superclass, only the name is in the environment of the object
  3. Method inheritance by delegation means, that when a method is called, it's realisation always looked up in the class(class is runtime object in this case) And dynamic resolution will mean, in addition to this, that the resolution can be not only in the context of the lexical environment (dynamic scoping) In this case, during compilation, it is impossible to make substitutions, inline, but even create a table of virtual methods
  4. This is not reasoning, but a fact, you can find the "link" by request "inheritance by delegation" or read about the implementation of inheritance in languages like js, self, smalltalk or python The very assumption that this can be confused looks as strange as if someone confused inheritance with composition. Here compilation means translation with optimization.
  5. You are confusing categories here. It was about the implementation of inheritance. It can be implemented by delegation or copying. This is about the same difference as between the regular and virtual methods. And composition is a method, a template. And composition is not inheritance at all, it is surrogate If name resolution occurs already at compile time, this means that we are dealing with a copy derived from the class. This situation is beneficial for compiler manufacturers. The analisys would be much more difficult if they don't know how it resolve in runtime
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.