[erlang-questions] I think I wish I could write case Any of whatever -> _ end.
Richard O'Keefe
ok@REDACTED
Tue May 18 03:43:41 CEST 2010
On May 18, 2010, at 12:01 PM, Henning Diedrich wrote:
> But if it was another symbol? Say ~.
No, let's NOT say \sim, a symbol widely used in mathematics and
physics for something that is syntactically a binary relation
and means "sort-of equal, kinda", which is why I want it for
frames, and is used in a variety of programming languages as a
unary operator with negation-related meanings.
But what if it were some other symbol?
Well, WHY a symbol? What's the difference between @#$%^ and Fred?
The differences are clear:
+ there is an infinite set of variable names, which can be
chosen to be easy to pronounce and understand, allowing you
to name many things at the same time
- a symbol is one thing, probably doesn't have an agreed way
to say it (is ~ "tilde", "wiggle", "squiggle", "sim",
"roughly equals", or what) and has no special connexion with
what it stands for; since there's one of it, it's very hard to
use in a nested context.
Example: Common Lisp has
* the value of the last expression you typed in
** the old value of *
*** the old value of **
What happens if you want to refer to the old value of *** ?
Tough luck. What happens if you miscount and typed ** when
you meant *** ? Tough luck. What is the connection between
multiplication and history that makes this memorable?
There isn't one.
(OK: + ++ +++ are the last three forms you typed,
* ** *** are their (primary) values
/ // /// are the lists of all their values
- is the form that is being evaluated right now
How "-" gets to be more recent than "+" is a mystery,
but at least they managed to blow this up into an
"arithmetic function = history variable" analogy.
The consistency is perfect. < << and <<< do the
obvious things. No, wait, there _is_ no obvious
thing, and if there were, they don't. Oh well,
at least there are consistently X, XX, and XXX versions.
No, wait, there aren't. -- and --- do not exist.)
Why invent triangular wheels covered in barbed wire and razor blades
when we have nice round rubber ones?
More information about the erlang-questions
mailing list