Re: Usage Messages in Mathematica

*To*: mathgroup at smc.vnet.net*Subject*: [mg129263] Re: Usage Messages in Mathematica*From*: David Bailey <dave at removedbailey.co.uk>*Date*: Fri, 28 Dec 2012 05:32:22 -0500 (EST)*Delivered-to*: l-mathgroup@mail-archive0.wolfram.com*Delivered-to*: l-mathgroup@wolfram.com*Delivered-to*: mathgroup-newout@smc.vnet.net*Delivered-to*: mathgroup-newsend@smc.vnet.net*References*: <kbh6ca$ihr$1@smc.vnet.net>

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