Closed arvidn closed 3 years ago
is your opinion that SExp
's API should be .atom
and .pair
properties instead of .as_atom()
and .as_pair()
, or that it should have both?
I think the fact that CLVMObject
and SExp
share some part of their interfaces is problematic, and makes it more difficult to separate their responsibilities and uses.
Both. We can have SExp
be a subclass of CLVMObject
, but .as_pair()
is subtly different from .pair
in that it rewraps the pair of CLVMObject
children as SExp
objects.
SExp
is basically so you can get convenience features like .as_iter
and .as_int
. It really shows how clever rust impl
blocks are, since it'd be much nicer to just be able to add these methods right into CLVMObject
.
This is in preparation for making
SExp
have a clearer API and not derive fromCLVMObject