utils/sexp: add some convenience

Add some convenience function for dealing the head/tail
Some whitespace / cosmetics
Add operators ==
Add operator !=
Update command handler for this.
This commit is contained in:
Dirk-Jan C. Binnema
2023-06-04 14:26:37 +03:00
parent 3624fdd5f3
commit 9bab2a4050
4 changed files with 62 additions and 42 deletions

View File

@ -71,7 +71,7 @@ struct Command: public Sexp {
* @return name
*/
const std::string& name() const {
return cbegin()->symbol();
return cbegin()->symbol().name;
}
/**
@ -119,7 +119,7 @@ struct Command: public Sexp {
if (auto&& val{arg_val(name, Sexp::Type::Symbol)}; !val)
return Nothing;
else
return val->symbol();
return val->symbol().name;
}
/**