[mercury-users] Quotation marks

Peter Moulder Peter.Moulder at infotech.monash.edu.au
Sun Feb 26 23:13:38 AEDT 2006


On Tue, Feb 21, 2006 at 08:56:26AM +1100, Nicholas Nethercote wrote:

> I've noticed that Mercury uses pairs of apostrophes and backticks around 
> words, like `this':
> 
>   zinc.m:032: Syntax error at token 'main': operator or `.' expected.
> 
>   zinc.m:001:   warning: module `io' is imported in the interface, but is 
>   not
> 
> I'm seeing it in G12 also.  I've seen an opinion that this should be 
> avoided, and either proper Unicode or single apostrophes should be 
> preferred, like 'this':
> 
>   http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html

Current gcc (e.g. 4.0) uses unicode ‘quotes’ in locales supporting these
characters [or at least in utf8 locales, I haven't tried other
curly-quote-containing charsets], falling back to 'ascii apostrophe'.
(Whereas current groff falls back to `this style' in charsets lacking
curly quotes.)

Using non-ascii quote characters is ideal from a user's perspective, in
that it's most clear what the quoted text is, assuming that the quoted
text contains only ASCII characters but may contain ASCII quotation
characters.

However, if the only choices under consideration are either status quo
or changing hardcoded `this' to hardcoded 'this', then I don't think it
worth changing.  The above-cited page's only argument for 'this' over
`this' is ugliness.  I believe this conclusion doesn't hold for use by
programmers: `this style' is both less likely to produce ambiguities and
is easier to search for than 'this style'.  The "ugliness" argument
hardly even holds for programmers, who are accustomed to `this style'
from many years of use in Gnu & Unix software.  A Mercury-specific
argument for preferring `this style' is that it allows 'this style' to
be understood as meaning Mercury symbol quoting.

If you wish to use unconditional 'this style' despite these arguments,
then please consider at least making it easy for someone to later change
to unicode quotes (the ideal according to both the cited article and
current usage by gcc, groff): e.g. by using a function or named
constant/s.  Otherwise, it's hard for someone to later search for 'this
style' to change to `this style', e.g. because single quotes are more
common in source code, and also because occasionally one really does
mean Mercury single-quote syntax.

pjrm.
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list