Class CapturedVariables

java.lang.Object
org.ek9lang.compiler.support.CapturedVariables

public final class CapturedVariables extends Object
THE "is this symbol one of the variables a dynamic function or class captured?" - by IDENTITY, never by name. Use it rather than walking getCapturedVariables() again.

A capture is the dynamic construct's own copy of an outer value (a constructor argument stored in a private field, CaptureScope.define), so it is a property FIELD, yet it is not one of the construct's own properties (OwnProperty): it belongs to the scope that made the construct. Identity matters - a name join would take an unrelated variable of the same name (an outer local, a property) for the capture; the E08251 check once did.

Shared by E08251 (a capture is shared state) and the lock-identity inference (a capture stands for its outer variable). Extracted 2026-10-05.

  • Method Details

    • isCaptureOf

      public static boolean isCaptureOf(ISymbol candidate, ICanCaptureVariables capturer)
      True when candidate is, by identity, one of the variables capturer captured.