Not allowed? By whom? Is there some list of disallowed names somewhere? This is new to me.Quote:
Originally posted by parksie
I never said you couldn't, I said you weren't allowed to.
It's a reserved prefix.
Printable View
Not allowed? By whom? Is there some list of disallowed names somewhere? This is new to me.Quote:
Originally posted by parksie
I never said you couldn't, I said you weren't allowed to.
It's a reserved prefix.
the C++ keywords can't be used as indentifiers, the compiler won't accept it, (neither will keywords used by the compiler) but I don't know any compiler that doesn't disallow "reserved" keywords like stroustrup ;)
you can't make up a list of the "reserved" keywords according to parksie, you obviously have infinite amount of them. The C++ keywords are listed though, search for them
They're reserved for the standard. If you have a function str-anything then you're messing with ANSI/ISO, and they have the final say on who owns the name...
hmm..
Is there someplace where I can see these standards?
You buy them from ANSI / ISO.
I'm getting the impression that these standards are only for big businesses that are willing to pay to look at them.
Does everyone actually use them?
You can get out-of-date electronic copies, and also on things like the yahoo groups c-prog mailing list people will quote you bits if you ask them.
So everyone does use them, then? (relatively speaking)
CB - regular expressions are clearly defined, not limited to perl, but apply in grep, sed, awk, etc. I'm sure you didn't mean to imply that, but that is how I read it.
Parksie - The str thing. This also happens in other OS's, Parksie. We reserved the ENV prefix for VMS. The DEC people had already set aside about 12 like Str, Mth, Sys$, and so on.
The idea is: if I use my special prefix as part of my standard nomenclature, I'm guaranteed that my code will be comptatible, and link, with eveybody else's stuff. No name conflicts.
For example, don't create a dll that starts with MS. You probably will regret it someday.
Tygur - what he's talking about is standard naming. You have a company - TYGURSOFT. All your proprietary names start with Tyg.
You can resister the prefix as a standard name. The str thing goes one step beyond, it's part of a defined ANSI standard. Will something break if you use strfoo() as a function name? No.
There's two styles I know of, POSIX and Perl styles (the only ones I'm vaguely familiar with).
As far as the str thing goes, that was just an example, I think they've taken a lot more than that...but your point still stands...
I think they also have taken wcs, which is the UNICODE equivalent of str.
jim: just what parksie said. I know that other things beside perl use regexps, but from my knowledge of PHP I know that it supports both perl and POSIX style regexps, but since I only know the perl one, I wanted to point out that I use this variation.