Closed bigodel closed 1 year ago
Hi! Thanks for opening this PR. I decided to go with simply adding a check for var
inside the and
so that when nil is used, the and
value is not used. This way we also maintain the usage of symbols as keys for verb--vars
, which I prefer over strings. See here: https://github.com/federicotdn/verb/commit/ba215b70fb09f35656d0791599be2d5abc3113d8
Edit: sorry, misread part of your code. Your code still uses symbols as keys, however the shorter fix is preferable to maintain the function signature.
that's cool, it solves it. only thing i'd point out is that with this change there is no need to keep using assoc-string
on line 1082 to get the variable's value, assoc
should do it.
Currently, on interactive calls,
verb-set-var
always prompts on a value for the variablenil
. That happens because it checks for the following(and (symbolp var) (symbol-name var))
and that always results in"nil"
, since(symbolp nil)
returns true. I propose the following:Using the mechanism from interactive to specify a list of arguments to be used on interactive calls, here prompting the user for them like it was done before. in any other case, rely on the old behaviour.
Notice that for this new version, the variable
var
is required.