-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
There's some weirdness in the C API when it comes to thunks. They are sort of just considered normal values, but most of the time they are forced before being returned from functions, and for some purposes you don't want to consider them normal values.
We discussed a couple of options for redesigning this, including
- Having two enums, one with one without thunks
- Using something like trees that grow. This adds a lot of complexity though
- Using an enum without thunks, and then an
Option<T>
to represent thunks (None
being "it's a thunk") The function returning this value could be something liketype_if_evaled(&Value): Option<ValueType>
- Once a value is forced, it can maybe be a nicer enum, such that there's no possibility of trying to get the string value out of an int value.
Another point related to this restructuring: perhaps force()
should take a &mut self
, since it might mutate the underlying value.
Metadata
Metadata
Assignees
Labels
No labels