Re: Options for Cell: Why are some of these System symbols and others not?
- To: mathgroup at smc.vnet.net
- Subject: [mg15792] Re: Options for Cell: Why are some of these System symbols and others not?
- From: dreissBLOOP at bloop.earthlink.net (David Reiss)
- Date: Sun, 7 Feb 1999 02:04:09 -0500 (EST)
- Organization: EarthLink Network, Inc.
- References: <firstname.lastname@example.org>
- Sender: owner-wri-mathgroup at wolfram.com
In article <79eamq$9jd at smc.vnet.net>, r.lawrence at worldnet.att.net (Robert Lawrence) wrote: > Recently, I was stymied when a function that I had defined in a package > did not work properly. The function was designed to copy, from an open > notebook, a Cell expression representing a closed cell in the > notebook, and to create a new cell in the notebook, based on the closed > cell, but with two Cell options modified: CellTags->"xxxx" was to be > replaced by CellTags->"yyyy", and CellOpen->False was to be replaced by > CellOpen->True. The change in the CellTags option worked correctly, > but the change in the CellOpen option did not. > > After much experimentation, I discovered why: CellTags is a System > symbol, but CellOpen is not -- so my package created its own CellOpen > symbol in its own context. > > This solved my problem, but out of curiosity I then looked at the > intersection (and the complement) of (i) a list of all options for Cell > and (ii) a list of all System symbols. I found that, of the 144 > options for Cell in Mathematica 3.0, 76 are System symbols and the > other 68 are not. > > Does anyone know why this is? > > Robert Lawrence Interestingly enough, I discovered this *just today* under a very similar circumstance. I suspect that this is an error (aka bug) in the implementation of these options in version 3, though I don't have any direct knowledge of this. Similar problems occur as well for some of the allowed options to Notebook. My quick solution to this problem was to put commands such as System`CellOpen; at the begining of my package prior to the Private` context for those options that I needed for my package. These have the effect of creating the needed symbols in the System` context, but will have no effect in any future version of Mathematica where they have already been created in the System` context. A more elegant solution to this would be to take the complement of the union of lists for Cell and Notebook options with the list for System`* symbols and then to execute that list prior to the Private` context. This would provide general protection against this. Cheers, David -- ---------------------------------------- Scientific Arts: Creative Services and Consultation for the Applied and Pure Sciences David Reiss Email: dreiss at !SPAMscientificarts.com ---------------------------------------- Remove the !SPAM to send email