Article View: comp.lang.misc
Article #5741Re: String Concatenation (Third public review of X3J11 C)
From: Dave Berry
Date: Tue, 13 Sep 1988 12:59
Date: Tue, 13 Sep 1988 12:59
26 lines
1845 bytes
1845 bytes
In article <381@quintus.UUCP> ok@quintus.UUCP (Richard A. O'Keefe) writes:
>ML is not mathematics.
ML is not mathematics, but the Definition of Standard ML is. It's the formal
specification of the language.
In any case, programming languages aren't used exclusively for maths.
So if there are non-commutative uses of "+", mathematical or otherwise,
it weakens the argument that "+" shouldn't be used for string concatenation.
The amount that the argument is weakened depends on how widespread the
non-commutative uses are. I won't claim that the single case of the definition
of ML is sufficient!
>It would be *so* sensible to use a "product"
>symbol "x" or even "*" for string concatenation, because it is
>associative with an identity, and exponentiation is exactly the
>right operation for iterated concatenation ("ab"**3 = "ababab").
That makes sense to me, but I wonder how intuitive it would be to novices with
no mathematical background. "+" is fairly intuitive (to non-mathematical
folks), because it "adds" the second string to the first.
"*" might also get confusing (though probably not ambiguous) in the
presence of regular expressions or if it's also used as a wild card.
Dave Berry. db@lfcs.ed.ac.uk
Technical Details
Message-ID:
<773@etive.ed.ac.uk>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!mcvax!ukc!etive!lfcs!dbReferences:
<8365@smoke.ARPA> <225800053@uxe.cso.uiuc.edu> <8374@smoke.ARPA> <8660@ihlpb.ATT.COM> <908@l.cc.purdue.edu> <340@quintus.UUCP> <769@etive.ed.ac.uk> <381@quintus.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!mcvax!ukc!etive!lfcs!db From: db@lfcs.ed.ac.uk (Dave Berry) Newsgroups: comp.lang.misc Subject: Re: String Concatenation (Third public review of X3J11 C) Message-ID: <773@etive.ed.ac.uk> Date: 13 Sep 88 12:59:26 GMT References: <8365@smoke.ARPA> <225800053@uxe.cso.uiuc.edu> <8374@smoke.ARPA> <8660@ihlpb.ATT.COM> <908@l.cc.purdue.edu> <340@quintus.UUCP> <769@etive.ed.ac.uk> <381@quintus.UUCP> Sender: news@etive.ed.ac.uk Reply-To: db@lfcs.ed.ac.uk (Dave Berry) Organization: Laboratory for the Foundations of Computer Science, Edinburgh U Lines: 26