[fpc-pascal] stuck with untyped pointer
denis.spir at gmail.com
Sat May 29 00:03:46 CEST 2010
On Fri, 28 May 2010 23:07:35 +0200
José Mejuto <joshyfun at gmail.com> wrote:
> 3) Variable name "val" (Use Value instead, there is a function called
Naming problems in object pascal... I could not use "value" because it's the name of a method that returns a value, lol! So, I used "val". But now I cannot use "val". Will end up with "v". Should we only use single-letter var names to be sure?
Pascal is already problematic with names because of (1) many keywords (2) loads of builtin funcs and procs (3) case-insensitivity.
But the object layer brings the biggest issue with the implicit "self" causing names external to a method to clash with local names. Like if there were no local scope at all. Indeed, the names one would need to use, because they make sense for a given class, are precisely the ones that clash with data or method attributes. Worse: the compiler _sometimes_ blocks when var names conflict with slot names (I have not yet understood when/why it does or not).
No offense intended, but I consider this as a language-design error. (symptom: lexical paralysis ; cause: namespace leak)
PS: Tricks to work around these problems welcome :-) How do you solve that?
(One I won't use because I find it ugly is ___prefixing or postfixing___ all var names, or ___both___.)
vit esse estrany ☣
More information about the fpc-pascal