[Grace-core] Parsing ambiguity

Michael Homer mwh at ecs.vuw.ac.nz
Wed Jul 2 01:26:03 PDT 2014


On Wed, Jul 2, 2014 at 8:12 PM, Timothy Jones <tim at ecs.vuw.ac.nz> wrote:
> On 02/07, Michael Homer wrote:
>> ALGOL, COBOL, Fortran, Lua, PL/I, Smalltalk*, and some modules in some
>> Visual Basic programs would like a word with you.
>
> Many of those are by-convention (as the arrays can be indexed with negative
> values as well), and Smalltalk doesn't use subscripting (right?).
I asked the Oracle of Knowledge for a list:
<https://en.wikipedia.org/wiki/Comparison_of_programming_languages_%28array%29#Array_system_cross-reference_list>.
In Lua it's certainly the built-in behaviour, and I think ALGOL and
COBOL at least too. It's not unheard of to use one-based indexing
(it's just a bad idea if you're planning to teach data structures).

Ada also does the right thing, by the way, in case that's a less
cautionary example than Pascal.
-Michael


More information about the Grace-core mailing list