[Rcpp-commits] r1164 - in pkg/Rcpp: inst/include/Rcpp src
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Tue May 4 17:05:44 CEST 2010
Author: edd
Date: 2010-05-04 17:05:44 +0200 (Tue, 04 May 2010)
New Revision: 1164
Modified:
pkg/Rcpp/inst/include/Rcpp/Formula.h
pkg/Rcpp/src/Formula.cpp
Log:
update to Formula class
Modified: pkg/Rcpp/inst/include/Rcpp/Formula.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/Formula.h 2010-05-04 12:10:40 UTC (rev 1163)
+++ pkg/Rcpp/inst/include/Rcpp/Formula.h 2010-05-04 15:05:44 UTC (rev 1164)
@@ -32,10 +32,10 @@
Formula() ;
- Formula(SEXP lang) ;
+ Formula(SEXP lang) throw(not_compatible) ;
Formula(const Formula& other) ;
- explicit Formula( const std::string& code );
+ explicit Formula( const std::string& code ) throw(not_compatible) ;
Formula& operator=(const Formula& other) ;
Modified: pkg/Rcpp/src/Formula.cpp
===================================================================
--- pkg/Rcpp/src/Formula.cpp 2010-05-04 12:10:40 UTC (rev 1163)
+++ pkg/Rcpp/src/Formula.cpp 2010-05-04 15:05:44 UTC (rev 1164)
@@ -25,7 +25,7 @@
Formula::Formula() : Language(){}
- Formula::Formula(SEXP x) : Language(){
+ Formula::Formula(SEXP x) throw(not_compatible) : Language(){
switch( TYPEOF( x ) ){
case LANGSXP:
if( ::Rf_inherits( x, "formula") ){
@@ -47,7 +47,7 @@
setSEXP( z ) ;
}
} else{
- Rcpp_error( "cannot create formula from empty list or expression" ) ;
+ throw not_compatible( "cannot create formula from empty list or expression" ) ;
}
break;
default:
@@ -56,7 +56,7 @@
}
}
- Formula::Formula( const std::string& code) : Language() {
+ Formula::Formula( const std::string& code) throw(not_compatible) : Language() {
setSEXP( internal::convert_using_rfunction( ::Rf_mkString(code.c_str()), "as.formula") );
}
More information about the Rcpp-commits
mailing list