Class CaptureOrigins

java.lang.Object
org.ek9lang.compiler.phase5.CaptureOrigins
All Implemented Interfaces:
Function<ISymbol,ISymbol>, UnaryOperator<ISymbol>

final class CaptureOrigins extends Object implements UnaryOperator<ISymbol>
Where a dynamic function's or class's captured copy came from, as the RETAINS derivation walks a callable: each capture argument a capture list names ((p, items) is Adder as function) is noted with the variable or property it copies, and apply(ISymbol) answers the ORIGIN of a copy - transitively, so a capture of a capture is the outermost variable. The derivation audit's M9 (2026-11-15): inside the closure body p and items are the closure's own fields, so items += p kept nothing for anyone; read through their origins it is the enclosing method's p kept into its own items. Filled in walk order (a capture list is written before the body it serves); one per walk - hold one.
  • Constructor Details

    • CaptureOrigins

      CaptureOrigins()
  • Method Details

    • note

      void note(ISymbol copy, ISymbol origin)
      A capture list made copy of origin.
    • apply

      public ISymbol apply(ISymbol symbol)
      The outermost variable or property symbol is a captured copy of; null when it is no recorded copy.
      Specified by:
      apply in interface Function<ISymbol,ISymbol>