MathGroup Archive 2007

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

Search the Archive

RE: simple question

  • To: mathgroup at
  • Subject: [mg77113] RE: [mg77099] simple question
  • From: "Ingolf Dahl" <ingolf.dahl at>
  • Date: Mon, 4 Jun 2007 03:46:35 -0400 (EDT)
  • References: <>

Hi Dimitris,
I cite from mg64218 (Feb 7, 2006), thread "Notebooks, packages, cells, and
literate programming":

"One alternative way to enter inline comments, if you anyway want that, is
to wrap them up in a ordinary Mathematica function in this way:

Comment[" This is my comment. "];

There usually are any number of places in the code where you could add
comments in this way. If you have not defined the function Comment, the
statement will not be evaluated. Such comments are not removed by
Shift-Ctrl-N or Shift-Ctrl-I.
Of course I must here also remind that the button "CopyAsInputForm" in my
SetFaceAndFont Palette preserves (* *) comments by converting them into the
suggested alternative. (See"

The palette is not updated to version 6 yet, since I just have had
Mathematica 6 available a few days, but this feature seems to be

Best regards

Ingolf Dahl

> -----Original Message-----
> From: dimitris [mailto:dimmechan at] 
> Sent: den 3 juni 2007 12:15
> To: mathgroup at
> Subject: [mg77099] simple question
> Hi.
> I have a simple question but I can't find any relevant.
> Suppose a user-defined function with comments [that is 
> (*...*) structures] added.
> Let for example
> \!\(Nint[g_ (*function*) , n_Integer, {x_, a_, b_} (*
>       the\ variable\ and\ the\ limits\
>         of\ integration*) , opts___ (*set\ possible\ options\ for\ \
> NIntegrate*) ] := NIntegrate[Evaluate[g\^Range[n]], {x, a, b}, opts]\)
> The code has been copy/paste in StandardForm.
> Let me convert it to InputForm. After selecting the cell and 
> press Shift+Ctrl+I, I get
> In[1]:=
> Nint[g_, n_Integer, {x_, a_, b_}, opts___] := 
> NIntegrate[Evaluate[g^Range[n]], {x, a, b}, opts]
> That is, the comments during the conversion have been lost.
> Any ideas to "fix" this situation?
> Dimitris

  • Prev by Date: Very Strange Behaviour about something Very Simple
  • Next by Date: Re: Re: Problem with Mathematica 6
  • Previous by thread: simple question
  • Next by thread: Re: RE: simple question