I have noticed that often, when I am adding a comment above a line as in:
(* , *)
I will notice that at the end of the comment there is a lower case, gray x as in:
(* A comment *) x
That lower case x is also associated with lines being tabbed in such a way that it states that I have a syntax error. But all I have to do is add a space after the *) and the x disappears and the tabbling becomes normal.
But what is worse, is that the lower case, grayed x, does not occur after the comment, but to a comment that is further down in the code!
This means that it can be easy to miss the x (unless you notice the odd tabbing).
And if you run your code, without adding that space after the comment, you get errors in your code.
I wonder if anybody else has experienced the same thing.
I just want to understand why I have to have a space after the (* … *)
Can you provide an explicit example (being clear about where every whitespace character is)? In the meantime, I’m pretty sure that whenever you see a little gray x, that’s the front end telling you that it’s interpreting the surrounding expression as a multiplication. So, if you just type 1 2, you’ll see 1x2. If this is what is happening in your case, then there must be something nearby that would be reasonable to interpret as a multiplication, and that wouldn’t be a comment (unless maybe there is a version specific behavior that I haven’t seen). So, you need to provide more details either about the expression itself or what sequence of keystrokes led up to it.
Hello Eric,
Thank you for your reply. I will try to find an example. But here is the funny thing. The previous statement before the comment ends with a “;”. Also when I add the space after the *), the lower case grayed x disappears and then, if I remove the space I just put in, the x doesn’t reappear.
Hello Eric,
Based on your suggestion that the x means that the interpreter seems to see a multiplication, I went ahead and tried different scenarios and indeed whenever an implicit multiplication was a possibility, the x would appear.
That solves that problem although I will be on the lookout for cases where that is not the case (meaning that multiplication doesn’t make sense) and will report on those with the code sample.