This is completely undocumented use of options, but it does cause a segfault with r-patched and r-devel on Linux: options(list('digits', 'scipen')) Strangely enough, options(list('digits')) and options(list(digits = 10, scipen = 2)) work as might be expected. Deepayan
Thank you, Deepayan:>>>>> "Deepayan" == Deepayan Sarkar <deepayan@stat.wisc.edu> >>>>> on Mon, 12 Jul 2004 05:46:08 +0200 (CEST) writes:Deepayan> This is completely undocumented use of options, Deepayan> but it does cause a segfault with r-patched and Deepayan> r-devel on Linux: Deepayan> options(list('digits', 'scipen')) Deepayan> Strangely enough, Deepayan> options(list('digits')) Deepayan> and Deepayan> options(list(digits = 10, scipen = 2)) Deepayan> work as might be expected. I think I've seen where and how the problem occurs and am currently testing an easy patch. That will however give an error message for all calls options( mylist ) when mylist is a list that has length(names(mylist)) != length(mylist) You weren't making a "feature request" in the other direction where you? Regards, Martin Maechler
On Monday 12 July 2004 11:37, Martin Maechler wrote:> Thank you, Deepayan: > >>>>> "Deepayan" == Deepayan Sarkar <deepayan@stat.wisc.edu> > >>>>> on Mon, 12 Jul 2004 05:46:08 +0200 (CEST) writes: > > Deepayan> This is completely undocumented use of options, > Deepayan> but it does cause a segfault with r-patched and > Deepayan> r-devel on Linux: > > Deepayan> options(list('digits', 'scipen')) > > Deepayan> Strangely enough, > > Deepayan> options(list('digits')) > > Deepayan> and > > Deepayan> options(list(digits = 10, scipen = 2)) > > Deepayan> work as might be expected. > > I think I've seen where and how the problem occurs and am > currently testing an easy patch. > > That will however give an error message for all calls > options( mylist ) > when mylist is a list that has > length(names(mylist)) != length(mylist) > > You weren't making a "feature request" in the other direction > where you?No. I'm playing around with the possibility of having similarly behaved functions like lattice.options() and lattice.getOption(), and I was checking the behaviour of options() when I encountered the segfault. Should options( mylist ) work at all? It's not documented, at least not in ?options. Is that a documentation oversight? Deepayan
On Mon, 12 Jul 2004 18:54:22 +0200 (CEST), deepayan@stat.wisc.edu wrote :>Should options( mylist ) work at all?Yes, that's used fairly often in the pattern save <- options( <something new> ) on.exit(options(save))> It's not documented, at least not >in ?options. Is that a documentation oversight?Looks like it. ?par, which uses similar syntax, documents ... as ...: arguments in 'tag = value' form, or a list of tagged values. The tags must come from the graphical parameters described below. as opposed to ?options, which leaves off the "or a list" part. Duncan Murdoch