Skip to content

Commit de18102

Browse files
author
Zhuoer Dong
committed
glob.ls() need a bool argument in quick intro vignette
```r Rcpp::evalCpp('Environment::global_env().ls()') ``` ``` file59666c8ac214.cpp: In function ‘SEXPREC* get_value()’: file59666c8ac214.cpp:6:61: error: no matching function for call to ‘Rcpp::Environment_Impl<Rcpp::PreserveStorage>::ls()’ SEXP get_value(){ return wrap( Environment::global_env().ls() ) ; } ^ In file included from /home/zhuoer/.local/lib/R/Rcpp/include/Rcpp.h:38:0, from file59666c8ac214.cpp:1: /home/zhuoer/.local/lib/R/Rcpp/include/Rcpp/Environment.h:85:14: note: candidate: SEXPREC* Rcpp::Environment_Impl<StoragePolicy>::ls(bool) const [with StoragePolicy = Rcpp::PreserveStorage; SEXP = SEXPREC*] SEXP ls(bool all) const { ^~ /home/zhuoer/.local/lib/R/Rcpp/include/Rcpp/Environment.h:85:14: note: candidate expects 1 argument, 0 provided make: *** [file59666c8ac214.o] Error 1 g++ -I"/usr/share/R/include" -DNDEBUG -I"/home/zhuoer/.local/lib/R/Rcpp/include" -I"/tmp/RtmpXtPnoL/sourceCpp-x86_64-pc-linux-gnu-1.0.0" -fpic -g -O2 -fdebug-prefix-map=/build/r-base-oUvOgu/r-base-3.5.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c file59666c8ac214.cpp -o file59666c8ac214.o /usr/lib/R/etc/Makeconf:168: recipe for target 'file59666c8ac214.o' failed Error in sourceCpp(code = code, env = env, rebuild = rebuild, cacheDir = cacheDir, : Error 1 occurred building shared library. ``` ```r Rcpp::evalCpp('Environment::global_env().ls(TRUE)') ``` ``` [1] ".Random.seed" ``` eddelbuettel provides another example ```r cppFunction("CharacterVector foo() { Environment glob=Environment::global_env(); return glob.ls(true); }" ) foo() ``` ``` [1] ".Random.seed" "foo" ```
1 parent 6100a55 commit de18102

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

vignettes/Rcpp-quickref.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ std::string x = glob["x"];
458458
glob.assign( "foo" , 3 );
459459
int foo = glob.get( "foo" );
460460
int foo = glob.find( "foo" );
461-
CharacterVector names = glob.ls()
461+
CharacterVector names = glob.ls(TRUE)
462462
bool b = glob.exists( "foo" );
463463
glob.remove( "foo" );
464464

0 commit comments

Comments
 (0)