Jump to content

redcorner2000

Members
  • Posts

    5
  • Joined

  • Last visited

Posts posted by redcorner2000

  1. Just now, Ghideon said:

    No it does not mean that.

    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

    12 minutes ago, Ghideon said:

    returns zero results

    You have to keep in mind that Google is about politics, and if you search like a dilettante, you won't find anything there.

    12 minutes ago, Ghideon said:

    Maybe you could add some context to what you try to describe?

    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. 4 minutes ago, Ghideon said:

    can you provide a reference to clarify your reasoning?

    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

    5 minutes ago, Ghideon said:

    You seem to mix interpreter and compiler

    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. On 4/3/2021 at 11:22 PM, Ghideon said:

    Maybe you mean composition

    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.