MathGroup Archive 2008

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

Search the Archive

Re: Mathematica commenting of code using (* *) can't be nested

  • To: mathgroup at smc.vnet.net
  • Subject: [mg84951] Re: Mathematica commenting of code using (* *) can't be nested
  • From: Martin Johansson <martin.n.johansson_LookMa_NoSpam_ at ericsson.com>
  • Date: Mon, 21 Jan 2008 04:06:58 -0500 (EST)
  • References: <fmsljm$knj$1@smc.vnet.net>

Nasser Abbasi wrote:
> Mathematica 6.0.1
> 
> I do not understand why the following can't be taken as a valid comment
> 
> (*  comment here   (*  more comments  *)
> 
> It seems to me that once the first (* is seen by the parser then it should 
> take everything in front of it, all the way until it sees the closing *) as 
> one comment.
> 
> But in the above it does not. The (* in the middle breaks this, which does 
> not make too much sense to me. What do you think?

I think it would be useful (at least for me, the way I work when coding 
and debugging) if it worked the way you expected(?). I often have a line 
like

   something = somethingElse; (* with a comment *)

that I want to "comment out" while testing my code by merely adding (* 
at the beginning of the line. But maybe there are issues with this type 
of parsing that more competent programmers can point out.

//Martin


  • Prev by Date: Re: Findfit in C++
  • Next by Date: Sticky Animations Anyone?
  • Previous by thread: Re: Mathematica commenting of code using (* *) can't be nested
  • Next by thread: Re: Re: Mathematica commenting of code using (* *)