Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #12947 > unrolled thread
| Started by | "djmpark" <djmpark@comcast.net> |
|---|---|
| First post | 2012-12-27 10:02 +0000 |
| Last post | 2012-12-28 10:32 +0000 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.soft-sys.math.mathematica
Usage Messages in Mathematica "djmpark" <djmpark@comcast.net> - 2012-12-27 10:02 +0000
Re: Usage Messages in Mathematica David Bailey <dave@removedbailey.co.uk> - 2012-12-28 10:32 +0000
| From | "djmpark" <djmpark@comcast.net> |
|---|---|
| Date | 2012-12-27 10:02 +0000 |
| Subject | Usage Messages in Mathematica |
| Message-ID | <kbh6ca$ihr$1@smc.vnet.net> |
An extremely weak features of Mathematica is the design of Usage messages,
which seems to be stuck at Version 1, although the technology has moved far
beyond that.
The present design is not up to the task and full of gotchas. For example,
how does one include a box structure, for example a subscripted symbol,
within a usage message? If one just enters a subscript then the first time
the message is displayed there are quotes around it and the second time the
quotes go away. If one starts an InlineCell within the string and enters the
expression then that problem goes away. If one then moves the usage
definition to a package and Runs the package it works OK. But if one saves
and closes the package, quits the kernel and then reinitializes, loading the
package, the usage message is defective giving the InputForm of the box
expression. Mathematica parses and changes the usage messages when the file
is read.
The String form is just not adequate for usage messages. Nor is it adequate
to contain information on overloading functions. Usage definitions should be
expressions. Something like the following:
Usage[FunctionName] = {{template, usageExpression}..}
(The usageExpression might be a Row containing Strings and mathematical
expressions.)
Then Workbench would have all the information for constructing the Usage
cell at the top of Function pages and the Build process should have the
information to incorporate the command completion features - now lacking for
developers in Version 9.
Another present inadequacy is the use of SubValues, such as f[p][x,y] where
p might be a parameter and x,y are variables. This construction is extremely
useful. Alfred Gray used SubValues copiously in his Modern Differential
Geometry book. Workbench now truncates at the first pair of square brackets
on command completion. The specification of explicit templates might solve
that problem.
The potential to use Mathematica as a development, preservation,
documentation and communication medium is one of its greatest features, but
WRI has badly neglected this possibility and, as a result, discouraged such
use. Workbench is dormant and fraught with problems, for example not being
platform independent and not incorporating command completion features.
David Park
djmpark@comcast.net
http://home.comcast.net/~djmpark/index.html
[toc] | [next] | [standalone]
| From | David Bailey <dave@removedbailey.co.uk> |
|---|---|
| Date | 2012-12-28 10:32 +0000 |
| Message-ID | <kbjsf2$mv3$1@smc.vnet.net> |
| In reply to | #12947 |
On 27/12/2012 10:02, djmpark wrote: > An extremely weak features of Mathematica is the design of Usage messages, > which seems to be stuck at Version 1, although the technology has moved far > beyond that. > > The present design is not up to the task and full of gotchas. For example, > how does one include a box structure, for example a subscripted symbol, > within a usage message? If one just enters a subscript then the first time > the message is displayed there are quotes around it and the second time the > quotes go away. If one starts an InlineCell within the string and enters the > expression then that problem goes away. If one then moves the usage > definition to a package and Runs the package it works OK. But if one saves > and closes the package, quits the kernel and then reinitializes, loading the > package, the usage message is defective giving the InputForm of the box > expression. Mathematica parses and changes the usage messages when the file > is read. I rather think a lot of ancient, but valuable software contains little hell holes of primitive design like this. Never mind usage, the whole Message system could do with a rethink. I'd like to be able to: a) Divert messages to a function of mine, to (say) display it in a separate box. b) Resume messages that had been counted out. c) Intercept the message function (possibly subsumed under (a). d) Be able to suspend when an error occurs (OK, my DebugTrace package can do that, as can the built-in debugger, I think. However, why isn't it available without using a debugger? The message system seems to have a design appropriate for the batch processing computing era. There are also a zillion other very simple things that would be really useful, such as the ability to programmatically switch the Print stream between notebooks, and some better selection functions for manipulating notebooks (for example, I'd like to be able to read the current selection information, perform a set of manipulations, and then write the old selection back again). There are bits of undocumented stuff that will do parts of that, but not everything. And I would like a decent UNDO! I wish version 10 would be a catchup version where WRI would hold back a bit on new features, and instead review all the stupid hell holes that have developed over the years, and resolve them. As for Workbench, I could never take it seriously once I realised that all the extended characters come out in FullForm. I feel that the mere existence of Workbench has somehow diverted attention away from useful work needed to use Mathematica directly. BTW, I guess you could get an inline cell in a usage message, if you recreated the usage message dynamically as the package loads. David Bailey http://www.dbaileyconsultancy.co.uk
[toc] | [prev] | [standalone]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web