Package convex.core.lang.impl
Class AClosure<T extends ACell>
java.lang.Object
convex.core.data.AObject
convex.core.data.ACell
convex.core.lang.AFn<T>
convex.core.lang.impl.AClosure<T>
- Type Parameters:
T- Return type of function
- All Implemented Interfaces:
IValidated,IWriteable,IFn<T>
Abstract base class for functions that can close over a lexical environment.
-
Field Summary
FieldsModifier and TypeFieldDescriptionLexical environment saved for this closureFields inherited from class convex.core.data.ACell
cachedRef, EMPTY_ARRAY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidPrint the "internal" representation of a closure e.g.withEnvironment(AVector<ACell> env)Produces an copy of this closure with the specified environmentMethods inherited from class convex.core.lang.AFn
getTag, getType, hasArity, invoke, isCVMValue, supportsArgs, updateRefsMethods inherited from class convex.core.data.ACell
announce, announce, attachMemorySize, attachRef, cachedEncoding, cachedHash, calcMemorySize, createAnnounced, createEncoding, createPersisted, createPersisted, createRef, encode, encodeRaw, equals, equals, getChildRefs, getEncoding, getEncodingLength, getHash, getMemorySize, getRef, getRef, getRefCount, hashCode, isCanonical, isEmbedded, toCanonical, toString, validate, validateCell, writeMethods inherited from class convex.core.data.AObject
attachEncoding, print, printMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface convex.core.data.IWriteable
estimatedEncodingSize
-
Field Details
-
lexicalEnv
Lexical environment saved for this closure
-
-
Constructor Details
-
AClosure
-
-
Method Details
-
withEnvironment
Produces an copy of this closure with the specified environment- Parameters:
env- New lexical environment to use for this closure- Returns:
- Closure updated with new lexical environment
-
printInternal
Print the "internal" representation of a closure e.g. "[x] 1", excluding the 'fn' symbol.- Parameters:
sb- StringBuilder to print to
-