Refactor Value
into command and expression values
#1047
Labels
C-Project
A larger project, more suitable for experienced contributors.
G-CESK machine
This issue has to do with the CESK machine (the Swarm language interpreter).
S-Nice to have
The bug fix or feature would be nice but doesn't currently have much negative impact.
Overall I'm not happy with the way we handle
VResult
. It is a fertile source of bugs (#977 , #858, #327, #328) and will probably continue to be so because of some subtle invariants. It's necessary internally in order to pass along intermediate results that also carry an environment of bound names, but there are also many places where we don't expect to see it and don't want to have to worry about dealing with it. A few options for improving the situation that come to mind:VResult
fromValue
, and create a wrapper type for "values with environment" (EValue
?) which can be either aValue
or aVResult
, and carefully decide which instances of theValue
type should change toEValue
.Value
that indicates whether it is allowed to containVResult
or not.Originally posted by @byorgey in #977 (comment)
Note that the distinction is precisely between values which result from evaluating an expression (which can never be a
VResult
) and values which result from executing a command (which can be).The text was updated successfully, but these errors were encountered: