Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

The Science of Programming/SwayPresentations/Objects/ReificationInheritance

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

Reification Inheritance Reification inheritance: whereby the subclass completes (or partially completes) an incomplete superclass. function super() { function a(x) { b(x * x); } this; } function sub() { function b(y) { y + 1 * (y - 1); } extends(super()); } Now we make a sub object: var s = sub(); inspect(s . a(3)); The output is: s . a(3) is 80 Sway allows you to look at the concatenated environment: ppObject(s); yields: <OBJECT 5651>: context: <OBJECT 654> dynamicContext: <OBJECT 654> callDepth: 1 constructor: <function sub()> this: <OBJECT 5651> b: <function b(y)> a: <function a(x)> Next Previous Top