Results 1 to 11 of 11

Thread: A really simple question

  1. #1
    Tygur
    Guest
    Originally posted by parksie
    I never said you couldn't, I said you weren't allowed to.

    It's a reserved prefix.
    Not allowed? By whom? Is there some list of disallowed names somewhere? This is new to me.

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    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
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    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...
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  4. #4
    Tygur
    Guest
    hmm..
    Is there someplace where I can see these standards?

  5. #5
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    You buy them from ANSI / ISO.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  6. #6
    Tygur
    Guest
    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?

  7. #7
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    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.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  8. #8
    Tygur
    Guest
    So everyone does use them, then? (relatively speaking)

  9. #9
    jim mcnamara
    Guest
    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.

  10. #10
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    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 refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  11. #11
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    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.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width