[fpc-pascal] Illogical automatic dereferencing

"Vinzent Höfler" JeLlyFish.software at gmx.net
Sun Oct 11 14:17:48 CEST 2009


Henry Vermaak <henry.vermaak at gmail.com>:

> 2009/10/10 "Vinzent Höfler" <JeLlyFish.software at gmx.net>:
> > Henry Vermaak <henry.vermaak at gmail.com>:
> >
> >> One thing I think you don't understand is that an array _is_ a
> >> pointer.  Look at this table to visualise:
> >>
> >> http://en.wikipedia.org/wiki/C_syntax#Accessing_elements
> >
> > One thing I think you don't understand is that arrays and pointers are
> orthogonal concepts in almost every
> > other programming language than C.
> 
> Yes, I am aware of this (at least with the languages I've worked with).
>
> > So technically, C is the one who got it wrong.
> 
> Huh?  Are you saying something is wrong because the majority does it
> differently?

No. I'm saying it's wrong because this "majority" _proves_ it can be done differently. So the concept seems flawed at least.

> > Same for "Array subscript numbering begins at 0." - which simply isn't
> true for Pascal.
> 
> Except when you define an array[0..9], for instance, or for dynamic
> arrays.  I can think of only strings that always start with [1], but
> I'm often mistaken :)

type CharMap = array['a' .. 'z'] of Char;

It doesn't even have to be a number at all. :)


Vinzent.
-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01



More information about the fpc-pascal mailing list