MathGroup Archive 2008

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

Search the Archive

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

  • To: mathgroup at smc.vnet.net
  • Subject: [mg84943] Re: Mathematica commenting of code using (* *) can't be nested well.
  • From: Bill Rowe <readnewsciv at sbcglobal.net>
  • Date: Sun, 20 Jan 2008 03:40:32 -0500 (EST)

On 1/19/08 at 6:01 AM, nma at 12000.org (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  *)

Why would you want a comment formed like this? Why not either
end the first comment as Mathematica expects with a *) before
starting the added comments or use something other than (* to
separate the added 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.

Another equally logical way to parse comments might be to have a
counter that is incremented whenever it sees (* and decremented
whenever *) occurs. If things were done this way, comments in
the form you post above would not be correct.

>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?

It seems to me there are a number of different ways a parser for
comments can be implemented. And it is fairly useless to argue
one particular implementation is better than another.
--
To reply via email subtract one hundred and four


  • Prev by Date: Re: Tracing a Cycloid
  • Next by Date: Re: Version 6 graphics can be painfully slow
  • Previous by thread: Re: Mathematica commenting of code using (* *) can't be nested well.
  • Next by thread: Mathematica 6.01 kernel crash report. reproducible. C++ run-time error, R6025, pure virtual function call.