Fix small typo in ELC list.
[ess.git] / etc / ess-s4.S
blob4e744adf7f2b6210109617f12415c4e5d4136b56
1 #### This is a dump of the S library used by S-mode with Version 4 of S.
2 #### (from John Chambers ??)
4 #### S-mode session functions.
5 #### assign(..., where=0) makes them last only for the current session.
7 ### Martin Maechler:  see also ./ess-sp3.S
8 ###                   which uses assign(.., wh=0) which seems better
10 ".SmodeDump" <- function(x, name)
12     ## dump function for S-mode
13     assign(".SmodeTmp", options(error = dump.calls), where = 0, i = T)
14     on.exit( {
15         options(.SmodeTmp)
16         remove(".SmodeTmp", where = 0)
17     } )
18     dump(x, file = name)
20 ".SmodeLoad" <- function(x)
22     ## skeleton of a dump.calls interface, enough to keep s-mode
23     ## informed that an error took place.
24     pseudo <- function()
25         cat(get.message(), "Dumped\n", sep = "", file = "|stderr")
26     ## source function for S-mode
27     assign(".SmodeTmp", options(error = pseudo), where = 0, i = T)
28     on.exit( {
29         options(.SmodeTmp)
30         remove(".SmodeTmp", where = 0)
31     } )
32     invisible(source(x))
35 ".SmodeObs" <- function(where, pattern)
37     if(pattern == "") objects(where) else objects(where, pattern)
40 ".SmodePaths" <- function()
42     ## the paths for the directories in the search list
43     temp <- search()
44     value <- character(length(temp))
45     for(i in seq(along.with = temp)) {
46         obj <- database.object(i)
47         if(is.character(obj) && length(obj) == 1)
48             value[[i]] <- obj
49     }
50     value
53 "smode.lvsave" <-
54     c(".Last.value",
55       ".SmodeDump", ".SmodeLoad", ".SmodeObs", ".SmodePaths",
56       "smode.lvsave")