[Developers] Re: [CactusMaint] Compiler/1929: param.ccl variable description string doesn't quote things that look like C character escapes , but aren't
Erik Schnetter
schnetter at aei.mpg.de
Mon May 16 12:38:12 CDT 2005
On Monday 16 May 2005 18:15, Jonathan Thornburg wrote:
> Hi, Thomas,
>
> In bug #1929 I wrote
>
> | The following param.ccl fragment
> | Boolean strong_freezing \
> | "should $\alpha \to 0$ imply $\partial_t \beta^i \to 0$
> | \ or just $\partial_{tt} \beta^i \to 0$?"
> | {
> | } true
> | causes the CST to generate illegal C code, because
> | the \p of \partial looks like a C escape sequence,
> | but isn't valid.
>
> On Mon, 16 May 2005, Thomas Radke wrote:
> > in the current CST implementation parameter and parameter range
> > description strings are treated as C strings (which may include
> > escape sequences). So the solution to your problem would be to add
> > backslashes in your param.ccl file where necessary.
> >
> > Don't you like this ?
>
> I guess I have 2 answers to this question:
> (a) I can find no Cactus documentation which says how this should
> behave. (b) No, I don't like it. Having C-literal-string quoting
> semantics is is an implementation artifact, and shouldn't be in the
> CST language. Particularly with Steve's patch to have thorn guides do
> latex typesetting of things inside $...$ in such strings, I think
> it's confusing to try to follow both of the C and TeX semantics of
> backslash. Indeed...
The current semantics is that the characters that you put into the
comment should appear in the output as they are in the comment, minus
the enclosing quotes. You get backslashes and quotes by putting a
backslash in front of them. The quoting for Latex is already there,
the quoting for C was missing. It is not acceptable that certain
comments make the C compiler abort in auto-generated code.
Note that the quoting means that everything in the string is output
verbatim on the screen at run time and in postscript. That is, "\t" is
translated to "\\t" in C (well, it isn't, but it should be), and
"$\rho$" is translated into "\${\textbackslash}rho\$" for latex.
See my pending patch.
If we want a markup language for comments, then we should define what
its elements should be. I personally think that this is overkill.
-erik
--
Erik Schnetter <schnetter at aei.mpg.de> http://www.aei.mpg.de/~eschnett/
My email is as private as my paper mail. I therefore support encrypting
and signing email messages. Get my PGP key from www.keyserver.net.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.cactuscode.org/pipermail/developers/attachments/20050516/6bc88553/attachment-0002.bin
More information about the Developers
mailing list