Quick read it, will further comment later, some quick stuff:
- You discourage the use of (*, because displaying "(" would be difficult on some terminals, but afaik { is also? - The document itself has no copyright statement.
- You discourage the use of (*, because displaying "(" would be
difficult on some terminals, but afaik { is also?
We discourage old style comments like (* this *) because in fact `{' and `}' are available everywhere these days. I tried to grep the document but don't see where you got this from...
- The document itself has no copyright statement.
If you're reading the HTML version this is true. There are copyright statements in the Texinfo source, though, but this might not be enough. However, I see that also the HTML online version of the GNU Coding Standards doesn't hold a copyright notice, either. Maybe we can add it to our HTML version, though. Frank or Peter, what do you think?
Thanks for the feedback!
Best regards,
Nick
Marco van de Voort wrote:
- You discourage the use of (*, because displaying "(" would be difficult on
some terminals, but afaik { is also?
Nope. What we mean is: The (* *) comments (just like (. .) for array indexing etc.) were introduced in the language because at that time { }, [ ] etc. were difficult on some terminals.
Today, this isn't an issue anymore, therefore we use the "original" (and shorter) forms { } and [ ].
If that wasn't clear, it should be written more extensive in the text.
- The document itself has no copyright statement.
It does, once in @ifinfo, and once in @titlepage (which appears only in the TeXed versions), so it's indeed missing in the HTML version.
Nick, you might want to try s/@ifinfo/@ifnottex/ or something. (Though my texinfo manual suggests what you did, but it might be from a time where HTML output was not supported.)
Frank
On Fri, 13 Jul 2001, Frank Heckenbach wrote:
Marco van de Voort wrote:
- You discourage the use of (*, because displaying "(" would be difficult on
some terminals, but afaik { is also?
Nope. What we mean is: The (* *) comments (just like (. .) for array indexing etc.) were introduced in the language because at that time { }, [ ] etc. were difficult on some terminals.
Today, this isn't an issue anymore, therefore we use the "original" (and shorter) forms { } and [ ].
Good idea. However, hope you don't remove support for (* *) because during developement it's a handy way to comment out a block of code - especially if the block contains { }
Russ
Russ Whitaker wrote:
On Fri, 13 Jul 2001, Frank Heckenbach wrote:
Marco van de Voort wrote:
- You discourage the use of (*, because displaying "(" would be difficult on
some terminals, but afaik { is also?
Nope. What we mean is: The (* *) comments (just like (. .) for array indexing etc.) were introduced in the language because at that time { }, [ ] etc. were difficult on some terminals.
Today, this isn't an issue anymore, therefore we use the "original" (and shorter) forms { } and [ ].
Good idea. However, hope you don't remove support for (* *)
Of course not! That would be quite a break of all existing Pascal standards and non-standards. These are merely guidelines, not plans for modifications of the compiler.
because during developement it's a handy way to comment out a block of code
- especially if the block contains { }
Yes -- though there's also {$if False} ... {$endif} (which we actually recommend since it also can be nested etc.).
Frank
Nick, you might want to try s/@ifinfo/@ifnottex/ or something.
I'm trying to fix this problem. Well, there's a problem with a "<p>" being inserted after the `G' of "GNU" for no good reason...
- Suggest changing " aString: String " to " S: String "
Indeed. I copied these lines (as an example) from older code which does not conform to our rules about identifier names.
Is this OK?
: @example : @{ Port access functions @} : function InPortB (PortNumber: ShortWord): Byte; : function InPortW (PortNumber: ShortWord): ShortWord; : procedure OutPortB (PortNumber: ShortWord; aValue : Byte); : procedure OutPortW (PortNumber, aValue: ShortWord); : @end example
Best regards,
Nick
Nicola Girardi wrote:
Not really. First of all, according the the GPCS (short for GNU Pascal Coding Standards) "S: String" should be "s: String". (Of course nobody can force anyone to apply the GPCS, they are just advice.) Secondly, "aString" is the result of a rule we haven't yet defined. It's the only one which hasn't been defined yet. If you grep for "FIXME" you'll find just one instance of it and you can read what it's about. I'll save you the grep which is hard for a printed copy. :-))
: In object oriented code (especially often in constructors), there is : often the need to have a parameter correspond to an object field : (e.g., to pass a value with which to initialize the field). Since : both can't be called the same, the field should have the ``natural'' : name since it's usually used in more routines, and the parameter : name should be ``mangled''. FIXME: We haven't found a really : satisfactory rule for mangling yet (some use ``a'' as a prefix), and : if you have any good idea, let us know.
But this (yet to be resolved) rule is only for OOP. Using `aString' in these routines here is really not good (I wrote this a long time ago), so I'm changing it to `s'.
- Suggest changing " aString: String " to " S: String "
Indeed. I copied these lines (as an example) from older code which does not conform to our rules about identifier names.
Is this OK?
: @example : @{ Port access functions @} : function InPortB (PortNumber: ShortWord): Byte; : function InPortW (PortNumber: ShortWord): ShortWord; : procedure OutPortB (PortNumber: ShortWord; aValue : Byte); : procedure OutPortW (PortNumber, aValue: ShortWord); : @end example
I wouldn't recommend it. The port functions are the (only) nonportable unit that comes with GPC, so it's not a good example. I suggest:
function Pos (const SubString, s: String): Integer; function LastPos (const SubString, s: String): Integer; function PosCase (const SubString, s: String): Integer; function LastPosCase (const SubString, s: String): Integer; function CharPos (const Chars: CharSet; const s: String): Integer; function LastCharPos (const Chars: CharSet; const s: String): Integer; function PosFrom (const SubString, s: String; From: Integer): Integer; function LastPosTill (const SubString, s: String; Till: Integer): Integer; function PosFromCase (const SubString, s: String; From: Integer): Integer; function LastPosTillCase (const SubString, s: String; Till: Integer): Integer;
Frank
Frank Heckenbach wrote:
: @example : @{ Port access functions @} : function InPortB (PortNumber: ShortWord): Byte; : function InPortW (PortNumber: ShortWord): ShortWord; : procedure OutPortB (PortNumber: ShortWord; aValue : Byte); : procedure OutPortW (PortNumber, aValue: ShortWord); : @end example
I wouldn't recommend it. The port functions are the (only)
^^^^ Whoa this demonstrates what a lucky guy I am.
nonportable unit that comes with GPC, so it's not a good example. I suggest:
[...]
Inserted.
function LastPosTillCase (const SubString, s: String; Till: Integer): Integer;
You might also want to put only a space between "function" and the function name. (I know you won't do this in the actual source because there probably is some "procedure" but I'll do it in the manual.)
Best wishes,
Nick
Nicola Girardi wrote:
You might also want to put only a space between "function" and the function name. (I know you won't do this in the actual source because there probably is some "procedure"
Exactly.
but I'll do it in the manual.)
OK.
Frank