Re: was: Current Uses for Fortran ??

From: James Giles (jamesgiles_at_worldnet.att.net)
Date: 09/23/04


Date: Thu, 23 Sep 2004 20:36:30 GMT

glen herrmannsfeldt wrote:
> Eugene Miya wrote:
...
>> I would not say strange as I learned math in the era transitioning
>> to the cross for multiply, the dot, the *, and adjacency. It's trying
>> to be succinct.
>
> Strange because no other programming languages do it. You need at least
> space between two identifiers.

Madcap had a rule that all identifiers must begin with a capital
letter and be followed (if longer than one character) lower-case
letters. Given that rule, adjacency (even without a space) is not
ambiguous as multiply.

> > A number of languages use + for string cat.
>
> Including languages that allow automatic conversion between
> numbers and strings. Consider the Java statement:
>
> println("the sum of three and for is"+3+4);

Does Java associate from the left? Or does it have two
different precedences for +? If the latter: bletch!! Assuming
that + associates from the right, consider the following:

   println(3+4+"is the sum of three and four?");

Wouldn't that result in the output of "3 4 is the sum of three and four?"

I don't like + for concatenate since I believe that concatenate
is a perfectly sensible operation on rank-one arrays. Also, I
think that it's a useful idea to permit strings of things other
than characters, and it would be perfectly sensible to allow
elemental addition of strings to scalars, or even arrays or
other strings of the same length. If you use + to mean concatenate,
then what does A+B mean? If they're conformable, and they're
rank-one, it would have to mean both element-wise addition
*and* concatenate.

-- 
J. Giles
"I conclude that there are two ways of constructing a software
design: One way is to make it so simple that there are obviously
no deficiencies and the other way is to make it so complicated
that there are no obvious deficiencies."   --  C. A. R. Hoare


Relevant Pages

  • Re: passing pointers [C]
    ... >I could malloc some space, concatenate the first two, malloc some more, ... >strings, do that malloc, and return a new string. ... Since you only call realloc, there is no way for old allocations not ...
    (alt.comp.lang.learn.c-cpp)
  • passing pointers [C]
    ... My app has to concatenate strings to build up a bunch of SQL queries ... I could malloc some space, concatenate the first two, malloc some more, ... gradually built up) and realloc-ing it's memory block. ...
    (alt.comp.lang.learn.c-cpp)
  • Re: Best practices for efficient FP string building in CL?
    ... CONCATENATE fast: ... (defun smarter-concatenate-strings (strings) ... (defun not-so-clever-concatenate (strings) ...
    (comp.lang.lisp)
  • Re: Building HTML - String vs Array
    ... Concatenate Strings: ... Build Using Arrays: ... Use either arrays or string concatenation, whichever suits. ...
    (comp.lang.javascript)
  • Re: Console.WriteLine(s) Is Missing Line Terminator?
    ... If I don't know if those are strings or numerics, ... It's the ease with which it encourages lazy programming that puts me off ... Matius is arguing strongly that '+' should not be used to concatenate ... reasons", to me it's like saying "Say Hasta La Vista to ...
    (microsoft.public.dotnet.general)