#### S-mode session functions.1#### assign(..., where=0) makes them last only for the current session.23#### Well, turns out we have two slightly different versions of the S code.4#### This is the one that I think gets used with S-Plus; I'll send along5#### the other version as well, but morally they should be equivalent, there6#### are just a couple of changes I seem to have made for S4. /John78### Martin Maechler: see also ./ess-s4.S9### which does *not* use assign (why?)10assign(".SmodeObs",11function(where, pattern) {12if(pattern == "") objects(where)13else objects(where, pattern)14}, where=0)1516assign(".SmodeLoad",17function(x)18## source function for S-mode19{20assign(".SmodeTmp", options(error=dump.calls), where=0, i=T)21on.exit({options(.SmodeTmp); remove(".SmodeTmp",where=0)})22source(x)23},24where = 0)2526assign(".SmodeDump",27function(x, name)28## dump function for S-mode29{30assign(".SmodeTmp", options(error=dump.calls), where=0, i=T)31on.exit({options(.SmodeTmp); remove(".SmodeTmp",where=0)})32dump(x, file=name)33},34where = 0)35assign(".SmodePaths",36function()37## the paths for the directories in the search list38{39temp <- search()40value <- character(length(temp))41for(i in seq(along.with = temp)) {42obj <- database.object(i)43if(is.character(obj) && length(obj) == 1)44value[[i]] <- obj45}46value47},48where = 0)495051