From edd at debian.org  Tue Jan 16 22:02:08 2007
From: edd at debian.org (Dirk Eddelbuettel)
Date: Tue, 16 Jan 2007 15:02:08 -0600
Subject: [Rd] on.exit called on loading ?
Message-ID: <17837.15696.636229.572815@basebud.nulle.part>


I just found out that an .onLoad() function such as this stylized one (where
I just renamed some identifiers)


.onLoad <- function(lib, pkg) {
  require(zoo, quiet=TRUE, warn.conflicts=FALSE)
  library.dynam("foolib", pkg, lib )
  if (.Platform$OS.type != "windows") {
    initSomeServices()
  }
  if (.Platform$OS.type != "windows") {
    on.exit(closeSomeServices())
  }
}

actually triggers a call of 'closeSomeServices()'. I am probably
misunderstanding something here -- but I thought on.exit() would only be
called on, well, exit ?

Dirk

-- 
Hell, there are no rules here - we're trying to accomplish something. 
                                                  -- Thomas A. Edison



[Rd] on.exit called on loading ?
Dirk Eddelbuettel