::usage messages for symbols with DownValues
- To: mathgroup at smc.vnet.net
- Subject: [mg102555] ::usage messages for symbols with DownValues
- From: Januk <ggroup at sarj.ca>
- Date: Thu, 13 Aug 2009 03:22:49 -0400 (EDT)
I often have to import structured files and work with them in common ways. I have a function to import and split them up into useful bits. For my workflow, I've found it very convenient to assign the bits to a user-supplied symbol using various DownValues. Here is a toy example: SetAttributes[parseFile, HoldFirst] parseFile[ mySymbol_, file_String] := Module[{}, mySymbol::usage = "All the help information goes here"; mySymbol["Import"] := Import[file]; mySymbol["RawData"] := (mySymbol["RawData"] = mySymbol["Import"]); mySymbol["FirstData"] := (mySymbol["FirstData"] = First@mySymbol ["RawData"]); ] parseFile[ toySymb, "testfile.csv" ] Using this method, you can then type "?toySymb" and get information about the overall symbol. However, all the help is in one place, which can be cumbersome when there are many DownValues. Is there a way to split up the usage messages? I would like to be able to type something like the following and get targetted information: ?toySymb["FirstData"] ??toySymb["FirstData"] Any suggestions would be most welcome. Thanks, Januk