Currently, every hasp expression evaluated, if it does not fail, must return some value of type HData. However this does not really make much sense for define, so its return value (if successful) is set to simply be the empty list (), which gets displayed by the REPL. Ideally there should be no output when define is successful. This can be addressed in one of (at least) three ways:
Allow hasp expressions to return nothing, e.g. by changing the return value of evalExpr to Either Error (Maybe HData, Env). This will require careful planning to avoid adding yet another layer of complexity wherever expressions are evaluated.
Suppressing the output of successful calls to define in the UI.
Adding a new data type to HData to essentially represent "nothing". Need to be careful to either ensure that it can only be used when necessary, or take care to make it an actual feature of the language.
Currently, every hasp expression evaluated, if it does not fail, must return some value of type
HData
. However this does not really make much sense fordefine
, so its return value (if successful) is set to simply be the empty list()
, which gets displayed by the REPL. Ideally there should be no output whendefine
is successful. This can be addressed in one of (at least) three ways:evalExpr
toEither Error (Maybe HData, Env)
. This will require careful planning to avoid adding yet another layer of complexity wherever expressions are evaluated.define
in the UI.HData
to essentially represent "nothing". Need to be careful to either ensure that it can only be used when necessary, or take care to make it an actual feature of the language.