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, memorySize
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract boolean
printInternal
(BlobBuilder sb, long limit) Print 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
equals, getTag, getType, hasArity, invoke, isCVMValue, isDataValue, supportsArgs, updateRefs
Methods inherited from class convex.core.data.ACell
attachMemorySize, attachRef, cachedEncoding, cachedHash, calcMemorySize, createEncoding, createRef, encode, encodeRaw, equals, genericEquals, getCanonical, getChildRefs, getEncoding, getEncodingLength, getHash, getMemorySize, getMemorySize, getRef, getRef, getRefCount, hashCode, isCanonical, isEmbedded, toCanonical, toCVMString, toString, validate, validateCell
Methods inherited from class convex.core.data.AObject
attachEncoding, print, print, print
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface convex.core.data.IWriteable
estimatedEncodingSize
-
Field Details
-
lexicalEnv
-
-
Constructor Details
-
AClosure
-
-
Method Details
-
withEnvironment
-
printInternal
Print the "internal" representation of a closure e.g. "[x] 1", excluding the 'fn' symbol.- Parameters:
sb
- StringBuilder to print tolimit
- Limit of BlobBuilder size- Returns:
- True if printed successfully within limit, false otherwise
-