5
$\begingroup$

What is \\ for? Help finds nothing on it. An odd number of backslashes greater than one are grouped by two and the last one is displayed with a different color. This indicates that it should mean something.

There also is a (connected?) little bug in the frontend (Mma 8.0, W7). When a text what is ended by the odd number of backslashes is commented with Alt+/, pressing the combination again leads not to uncommenting, but to further commenting like this:

a\\\
(*a\\\*)
(*(*a\\\*)*)
(*(*(*a\\\*)*)*)

etc.

$\endgroup$
6
$\begingroup$

From the tutorial Special Characters - Strings And Characters

enter image description here

example

enter image description here

Comment/Uncomment behavior you describe also happens in version 8.0.4.0 on Vista.

| improve this answer | |
$\endgroup$
  • $\begingroup$ Thanks. Judging from this a combination \* is also treated specially (that could prevent Mma from recognizing the ending of the comments *)), though it is not mentioned in help. $\endgroup$ – Andrew Apr 22 '12 at 9:36
  • $\begingroup$ @Andrew, thanks for the accept. Un/Comment function behaves differently depending on the selection. For example, when the selection is cell bracket, Un/Comment works as you expect. From the code for the Un/Comment function in the file GetFEKernelInit.tr in the directory $InstallationDirectory\SystemFiles\FrontEnd\TextResources, you can see how it treats various selection cases. $\endgroup$ – kglr Apr 22 '12 at 11:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.