[m-rev.] update coding standard for long strings

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Jan 12 23:05:39 AEDT 2004


Estimated hours taken: 0.25
Branches: main

compiler/notes/coding_standards.html:
	Document that "++" should be used for string literals that don't
	fit on a single line.

Workspace: /home/jupiter/fjh/ws-jupiter/mercury
Index: compiler/notes/coding_standards.html
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/notes/coding_standards.html,v
retrieving revision 1.11
diff -u -d -r1.11 coding_standards.html
--- compiler/notes/coding_standards.html	10 Dec 2003 07:09:34 -0000	1.11
+++ compiler/notes/coding_standards.html	12 Jan 2004 12:04:25 -0000
@@ -173,11 +173,17 @@
 
 <p>
 
-Each line should not extend beyond 79 characters,
-unless this is necessary due to the use of long string literals.
+Each line should not extend beyond 79 characters.
 The reason we don't allow 80 character lines is that
 these lines wrap around in diffs,
 since diff adds an extra character at the start of each line.
+
+<p>
+
+String literals that don't fit on a single line should be
+split by writing them as two or more strings concatenated using the
+"++" operator; the compiler will evaluate this at compile time,
+if --optimize-constant-propagation is enabled (i.e. at -O3 or higher).
 
 <p>
 

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list