The Importance of Terminology's Quality

Robert Maas, usenet1.3.CalRobert at SpamGourmet.Com
Thu May 8 06:25:54 EDT 2008


> From: "xah... at gmail.com" <xah... at gmail.com>
> the importance of naming of functions.

I agree, that's a useful consideration in the design of any system
based on keywords, such as names of functions or operators.
(I'm not using "keyword" in the sense of a symbol in the KEYWORD package.)

> the naming in Mathematica, as Stephen Wolfram implied in his blog
> above, takes the perspective of naming by capturing the essense, or
> mathematical essence, of the keyword in question.

For concepts adapted from mathematics, that naming meta-convention makes sense.
For concepts adapted from data-processing, it's not so clearly good.

> lambda, widely used as a keyword in functional languages, is
> named just Function in Mathematica.

That makes sense, but then what does Mathematica call the special
operator which Common Lisp calls Function? Or is that not provided,
and the programmer must case-by-case handcode what they really mean?
(function foo) == (symbol-function 'foo) ;so FUNCTION not really needed there
(function (lambda (x) (+ x y)) ;y is a lexical variable to be encapsulated
                               ; into the resultant closure
How would you do something like that in mathematica?

> Module, Block, in Mathematica is in lisp's various let*
> The lisp's keywords let, is based on the English word let.

No, that's not correct. It's based on the mathematical use of "let":
Let R be the complete ordered field of real numbers.
Let S be the subset of R consisting of numbers which satisfy
  equations expressed in transcendental functions with rational
  parameters.
Prove that S is dense in R.
(Yeah, the question is trivial, but I'm just showing how "let" might be used.)

I see nothing wrong with LET used in that way in Lisp.
Bind would be good too.
I don't like Module or Block at all, because those words convey
nothing about binding some temporary local name to represent some
globally-definable concept, and they actually mis-lead because
module can mean either something like a vector space over a ring,
or a set of functions/methods that serve some small problem domain
within a larger library of functions/methods, or a set of lectures
on a single-topic within a curriculum, while Block sounds more like
just some random consecutive interval of statements rather having
nothing specific to do with bindings. TAGBODY or PROGN would be
more properly called Block perhaps.

> One easy way to confirm this, is taking a keyword and ask a wide
> audience, who doesn't know about the language or even unfamiliar of
> computer programing, to guess what it means.

That is a biassed question because the only options are the words
you choose in advance. Better would be to reverse the question: Ask
random people on the street what they would like to call these
concepts:
1 You set up a temporary relation between a name and some datum,
   such that all references to that name give you that same datum.
   For example you might set up the name 'n' to temporarily mean 5.
   Fill in the missing word: (word (n 5) <say "ouch" n times>)
2 You set up a rule by which one step of data-processing is performed,
   taking input to produce output. For example you set up a rule by
   which the input value is divided by two if it's even but
   multiplied by three and then 1 added if it was odd.
   Fill in the missing word: (word (n) <if n even n/2 else 3*n+1>)
3 You set up a rule as above, but also give it a permanent name.
   Fill in the missing word: (word collatz (n) <if n even n/2 else 3*n+1>)
4 You already have a rule that takes two input data and produces one output.
     (oldword foo (x y) <absolute value of difference between x and y>)
   You now know one of the two inputs, and that info won't change for a while,
   and you hate to keep repeating it. So you want to define a new rule
   that has that one known parameter built-in so that you only have
   to say the *other* parameter each time you use the new rule.
   Fill in the missing newword: (newword foo <x is fixed as 3>)
So I'd choose words: 1=let 2=lambda 3=defun 4=curry.
What words would a typical man on the street choose instead?

> The name regex has done major hidden damage to the computing industry

I have my own gripe against regular expressions ("regex" for short).
I hate the extremely terse format, with horrible concoctions of
escape and anti-escape magic characters, to fit within Unix's
255-character limit on command lines, compared to a nicely
s-expression nested notation that would be possible if regex hadn't
entrenched itself so solidly.



More information about the Python-list mailing list