MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: syntax error in Mathematica 8

  • To: mathgroup at smc.vnet.net
  • Subject: [mg115097] Re: syntax error in Mathematica 8
  • From: John Fultz <jfultz at wolfram.com>
  • Date: Thu, 30 Dec 2010 19:05:35 -0500 (EST)

On Thu, 30 Dec 2010 04:10:48 -0500 (EST), Scot T. Martin wrote:
> I'm using Get[] on multiple different *.m files, and I am getting a new
> syntax error in Mathematica 8.
>
> "Syntax::stresc: Unknown string escape \c."
>
> In looking at the *.m files, I cannot see any problems, and these same
> codes ran without problems in earlier version of Mathematica.
>
> Any tips?

Once upon a time, versions of Mathematica would allow this input without warning
or error:

"\c"

which was considered a lazy way of expressing the equivalent expression:

"\\c"

This can be confusing for some people because, although a single backslash works
to represent a literal backslash when combined with some characters, it doesn't
with others.  I.e.,

"\n" ==!== "\\n"

Instead, "\n" represents a newline.  And "\t" represents a tab character.  Etc.

So, in more recent versions, we decided to be more stringent about warning users
about code which is not using double-backslashes to represent literal
backslashes in strings since this is a common source of confusion and errors in
user-written code.

You can always turn the message off by doing:

Off[Syntax::stresc]

and the code will execute in exactly the same way.  But if you authored the
package files, it would be advisable to go and fix the code at some point. You
might even find that the code as it is is not fully correct.

Sincerely,

John Fultz
jfultz at wolfram.com
User Interface Group
Wolfram Research, Inc.


  • Prev by Date: Re: Manually culling a list
  • Next by Date: Re: WAV Import[] and Integer16 Issue
  • Previous by thread: syntax error in Mathematica 8
  • Next by thread: C compiler and XLL framework