[Blotter-commits] r154 - pkg/FinancialInstrument/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Jan 14 19:18:15 CET 2010


Author: braverock
Date: 2010-01-14 19:18:15 +0100 (Thu, 14 Jan 2010)
New Revision: 154

Modified:
   pkg/FinancialInstrument/R/instrument.R
Log:
- only create environment if it doesn't exist

Modified: pkg/FinancialInstrument/R/instrument.R
===================================================================
--- pkg/FinancialInstrument/R/instrument.R	2010-01-14 18:14:42 UTC (rev 153)
+++ pkg/FinancialInstrument/R/instrument.R	2010-01-14 18:18:15 UTC (rev 154)
@@ -12,7 +12,8 @@
 ###############################################################################
 
 .onLoad <- function(lib, pkg) {
-    .instrument <<- new.env()
+    if(!exists('.instrument'))
+        .instrument <<- new.env()
 }
 
 ## we should probably assign instruments into a special namespace and create get* functions.  Jeff?
@@ -219,4 +220,5 @@
 
 getInstrument <- function(x){
   get(x,pos=.instrument) #removed inherits=TRUE
+  #TODO add Date support to instrument, to get the proper value given a specific date
 }
\ No newline at end of file



More information about the Blotter-commits mailing list