java.lang.Object
org.kink_lang.kink.HostResultCore
org.kink_lang.kink.Val
- All Implemented Interfaces:
HostResult
- Direct Known Subclasses:
BindingVal
,BinVal
,ExceptionVal
,FunVal
,JavaVal
,LocationVal
,MaybeTraitVal
,NumVal
,RngVal
,StrVal
,TraceVal
,VarrefVal
,VecVal
A Kink value or val.
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
Constructs a val.protected
Val
(Vm vm, SharedVars sharedVars) Constructs a val with the shared vars. -
Method Summary
Modifier and TypeMethodDescriptionfinal Val
getVar
(int symHandle) Returns the target of the var specified bysym
; or null if absent.Returns the sym handle set of the vars of this val.final boolean
hasVar
(int symHandle) Returns whether the val has the var specified bysym
.final BigInteger
identity()
Returns the identity number of this val.final HostResultCore
Returns the core of the result, which the executor handles.final void
Assignsval
to the var specified bysymHandle
.
-
Field Details
-
vm
The vm.
-
-
Constructor Details
-
Val
Constructs a val.- Parameters:
vm
- the vm.
-
-
Method Details
-
makeHostResultCore
Description copied from interface:HostResult
Returns the core of the result, which the executor handles.This method is intended to be used by the Kink runtime implementation. Do not call this method from your program.
- Specified by:
makeHostResultCore
in interfaceHostResult
- Returns:
- the core of the result.
-
identity
Returns the identity number of this val.The identity number is unique within the vm.
- Returns:
- the identity number of this val.
-
setVar
Assignsval
to the var specified bysymHandle
.- Parameters:
symHandle
- the sym handle of the var.val
- the val to be assigned.
-
getVar
Returns the target of the var specified bysym
; or null if absent.- Parameters:
symHandle
- the sym handle of the var.- Returns:
- the target of the var specified by
sym
; or null if absent.
-
hasVar
public final boolean hasVar(int symHandle) Returns whether the val has the var specified bysym
.- Parameters:
symHandle
- the sym handle of the varl.- Returns:
- true if the val has the var specified by
sym
.
-
getVarSymHandleSet
Returns the sym handle set of the vars of this val.- Returns:
- the sym handle set of the vars of this val.
-