Re: simple question

*To*: mathgroup at smc.vnet.net*Subject*: [mg77107] Re: simple question*From*: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>*Date*: Mon, 4 Jun 2007 03:43:29 -0400 (EDT)*Organization*: The Open University, Milton Keynes, UK*References*: <f3u511$3ae$1@smc.vnet.net>

dimitris wrote: > Hi. > > I have a simple question but I can't find any relevant. You should try Google Groups with the keywords Mathematica comment imputform... > 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. This "feature" has generated numerous discussions over the net and the years :-) As David Park pointed out [1], "Furthermore, if one converts a cell from one form to another, say StandardForm to InputForm, the comments are discarded. This is also an annoyance. COMMENTS SHOULD BE CONSIDERED AN ESSENTIAL PART OF CODE. THEY SHOULD BE HANDLED ROBUSTLY AND NEVER DISCARDED. WRI WOULD VASTLY IMPROVE THE USEFULNESS OF MATHEMATICA IF THEY ATTENDED TO THIS." > Any ideas to "fix" this situation? > > Dimitris The following threads, (a short list among dozens about the subject), are very relevant: [1] "Package development" http://groups.google.com/group/comp.soft-sys.math.mathematica/browse_thread/thread/7bc3ba05281bc9d2/aa440b9e9fc68a2b?lnk=gst&q=Comment%5B+InputForm&rnum=8#aa440b9e9fc68a2b [2] "Comments are KILLING me" http://groups.google.com/group/comp.soft-sys.math.mathematica/browse_thread/thread/291c328cc58a4ff2/5a68f5a0cfa8e6a4?lnk=gst&q=Comment%5B+InputForm&rnum=5#5a68f5a0cfa8e6a4 [3] "Transfering Packages Between Platforms and InputForm Conversions" http://groups.google.com/group/comp.soft-sys.math.mathematica/browse_thread/thread/b5a321ab5e8550f6/2401067af0f7637e?lnk=gst&q=Comment%5B+InputForm&rnum=6#2401067af0f7637e [4] "newbie Comment question" http://groups.google.com/group/comp.soft-sys.math.mathematica/browse_thread/thread/5aa3aabeb9140369/288967928f5acd0a?lnk=gst&q=Comment%5B+InputForm&rnum=1#288967928f5acd0a Best regards, Jean-Marc