These are the objectives I came up with for this decision problem.
Find an operator that:
- Does not clash with the ~~ operator.
- Is easy to visually parse on a projector screen.
- Matches the "loudness" of the operation.
- Has minimal impact on the set of existing Lisp-related operators.
"Loudness" here is defined by how much the operator stands out in an
expression. Here are all of the currently defined operators ordered
from high to low precedence (I created a new procedure named
"OperatorsGet" to obtain this information"):
In> (MapSingle("ToAtom", OperatorsGet()))
Result: [',@,`,:*:,~,++,--,:,<<,>>,∠,^,+,-,.,/,X,bin,hex,o,*,***,+,-,~~,||,!==,!=?,<=>,<=?,<>,<?,==,=?,>=?,>?,@@,!?,..,/@,&?,|?,AddTo,#,->?,==?,Where,'',::,``,##,-->,->,/:,/::,+:=,-:=,:=,Else]
In an expression tree, operators that are higher in the tree have more
of an impact on the expression's structure than operators lower in the
tree do. Therefore, operators that are higher in an expression tree
should stand out more than operators that are lower in the tree. As an
example, notice that the very low precedence operators &? and |? have
their backgrounds syntax highlighted so they stick out much more than
higher precedence operators do.
The units operator is a very high precedence operator. Therefore, it
should be a "quiet" operator that does not stand out very much. In
fact, in science textbooks, juxtaposition is used between a value's
numeric part and its unit part to indicate the presence of an implicit
units operator.
In light of this information, I have decided to change the "~"
operator to "`" and test it during fall semester to see how well it
works. As for loosing the "`" operator as a Lisp-like quasiquote
operator, this is indeed a sacrifice. However, if "`" works out well
as a units operator, I think the sacrifice is worth it because in
theory many more users will be using units than will be using
quasiquoting.
I like the idea of using "Quasiquote" and "Quasiquote2" as
replacements for the existing "`" and "``" operators. It would then
probably make sense to rename the "Hold" procedure to "Quote" to be
compatible with this change. Eventually, it would make sense to move
Quasiquote2's splicing capability into Quasiquote. The reason it is
not there already is splicing capability was created under a very
tight timeline near the beginning of spring semester, and there was
not time to properly integrate it into the existing "`" operator.
Technical debt is easy to create and difficult to pay off...
Ted