From: No Na Me
Subject: Length limit for variable names in your language?
Date: 
Message-ID: <3AFC6382.927B9B1C@my-deja.com>
What this limit is for
C++,Fortran,Lisp,Pascal etcetcetc

Since this is multi-newsggroups message
please do not forget mention the language :-)

From: Brian Timothy HERLIHY
Subject: Re: Length limit for variable names in your language?
Date: 
Message-ID: <9divfo$8ag$1@mulga.cs.mu.OZ.AU>
No Na Me <········@my-deja.com> writes:

>What this limit is for
>C++,Fortran,Lisp,Pascal etcetcetc

>Since this is multi-newsggroups message
>please do not forget mention the language :-)

In Applesoft BASIC, the limit is two significant characters.. so the variable
names GILBERT and GIT both refer to the same variable (this should not come
as any surprise to Melbourne University denizens).

This has turned out to be a very rich source of bugs, providing many hours of
employment for BASIC programmers during the 80s.  In fact, were it not for
bugs such as these, many programmers would have starved to death during this
time, and so we must recognize this length limit as an example of sound
programming language design.
From: Greg Menke
Subject: Re: Length limit for variable names in your language?
Date: 
Message-ID: <m38zk2oj1j.fsf@europa.mindspring.com>
> >Since this is multi-newsggroups message
> >please do not forget mention the language :-)
> 
> In Applesoft BASIC, the limit is two significant characters.. so the variable
> names GILBERT and GIT both refer to the same variable 

The version of basic Intel put in their 8052 ucontrollers was similar
except they included the length of the variable name along with the
(IIRC) first and last characters.  Frankly it would have been easier
to debug the resulting problems if they had simply used the first 2
chars.  Aside from that problem it was(is) a pretty good basic, if
somewhat abbreviated- but those variable names... <shudder>

Gregm
From: Kent M Pitman
Subject: Re: Length limit for variable names in your language?
Date: 
Message-ID: <sfw1ypuwuq5.fsf@world.std.com>
[ replying to comp.lang.lisp only
  http://world.std.com/~pitman/pfaq/cross-posting.html ]

No Na Me <········@my-deja.com> writes:

> What this limit is for
> C++,Fortran,Lisp,Pascal etcetcetc
> 
> Since this is multi-newsggroups message
> please do not forget mention the language :-)

I don't plan to engage myself in the cross-posted stuff.  It seriously
annoys me when people cross-post into our forum, and I am not going to
risk seriously annoying others in retaliation.  However, if anyone was
going to reply anyway, or was just curious, here's my take on this.

In Common Lisp we like to talk as if we had infinite-length
identifiers but since identifiers are symbols and symbols' names are
strings, we usually talk about them as arbitrarily long, just as we
talk about bignums as integers in an aribitrarily large range, knowing
it's really impossible to be in the infinitely large range we like to
think of them as occupying.  

In fact, maximum portable length of an identifier in conforming ANSI CL 
code turns out to be 1024, which is the mininum possible conforming value
for both of the implementation-defined constants ARRAY-DIMENSION-LIMIT
and ARRAY-TOTAL-SIZE-LIMIT.

It seems like an absurdly low value to me, not even long enough to
have a portable string made up of all the unicode characters.  BARELY
long enough to hold all the ISO latin characters!  But fortunately,
pragmatics prevails, and the actual practice is that serious Lisp
implementations allow much longer strings, and so much longer
identifiers, since they have considerably higher values for these
constants.  LispWorks for Windows 4.1.20, for example, allows strings
(and therefore identifiers) 8388607 characters long.

To my knowledge, no one has ever complained that this size is limiting
in any way, nor even that they ran into the much shorter portable length
limit.

Consequently, in the tradition of Lisp, I think the right way to
answer the question for Common Lisp is symbolically, rather than
numerically.  That is, our length limit is: big enough.

Additional trivia: Common Lisp also allows zero-length identifiers
(more than one, since you can use packages to distinguish them, and
you can just MAKE-SYMBOL them if you get bored making new packages)
and Common Lisp allows for identifiers containing any character at
all, including ASCII NUL.
From: hack
Subject: Re: Length limit for variable names in your language?
Date: 
Message-ID: <9dp4s6$cgk$1@news.btv.ibm.com>
In article <·················@my-deja.com>,
No Na Me  <········@my-deja.com> wrote:
>What this limit is for
>C++,Fortran,Lisp,Pascal etcetcetc
>
>Since this is multi-newsggroups message
>please do not forget mention the language :-)
>

The following are languages I use at IBM.
Old EXEC-2 (1979):       255  (even older EXEC: 8)
Modern EXEC-2:     unlimited
Rexx:                    250
Assembler H:              63
HLASM:                    63
Phantasm:          unlimited  (experimental S/390 assembler at Research) 

"Unlimited" means the only constraint is available storage.

Sometimes the language permits an implementation to impose a limit.
This is the case for the Rexx that I use.

Michel.