Re: [Rd] [External] API for converting LANGSXP to LISTSXP?

2024-07-06 Thread luke-tierney--- via R-devel
We have long been discouraging the use of pairlists. So no, we will not do anything to facilitate this conversion; if anything the opposite. SET_TYPEOF is used more than it should be in the sources. It is something I would like us to fix sometime, but isn't high priority. Best, luke On Fri, 5

Re: [Rd] [External] Non-API updates

2024-06-25 Thread luke-tierney--- via R-devel
On Tue, 25 Jun 2024, Josiah Parry wrote: Hey folks, I'm sure many of you all woke to the same message I did: "Please correct before 2024-07-09 to safely retain your package on CRAN" caused by Non-API changes to CRAN. This is quite unexpected as Luke Tierney's June 6th email writes

[Rd] non-API entry point Rf_findVarInFrame3 will be removed

2024-06-19 Thread luke-tierney--- via R-devel
will be provided. Best, luke -- Luke Tierney Ralph E. Wareham Professor of Mathematical Sciences University of Iowa Phone: 319-335-3386 Department of Statistics andFax: 319-335-3017 Actuarial Science 241 Schaeffer Hall email: luke-tier

Re: [Rd] clarifying and adjusting the C API for R

2024-06-18 Thread luke-tierney--- via R-devel
' that should help with adapting to these changes. Best, luke On Thu, 6 Jun 2024, luke-tier...@uiowa.edu wrote: This is an update on some current work on the C API for use in R extensions. The internal R implementation makes use of tens of thousands of C entry points. On Linux and Windows, which

Re: [Rd] [External] Re: changes in R-devel and zero-extent objects in Rcpp

2024-06-08 Thread luke-tierney--- via R-devel
writable pointer to STRSXP and VECSXP data and that is too dangerous for memory manager integrity. I'm not sure exactly how this will be resolve, but be prepared for changes. Best, luke cheers Ben On 2024-06-08 6:39 p.m., Kevin Ushey wrote: IMHO, this should be changed in both Rcpp and downstr

Re: [Rd] [External] Re: clarifying and adjusting the C API for R

2024-06-07 Thread luke-tierney--- via R-devel
ve it at that please? luke On Fri, Jun 7, 2024 at 7:30 AM luke-tierney--- via R-devel wrote: On Fri, 7 Jun 2024, Steven Dirkse wrote: You don't often get email from sdir...@gams.com. Learn why this is important Thanks for sharing this overview of an interesting and much-needed project. You me

Re: [Rd] [External] Re: clarifying and adjusting the C API for R

2024-06-07 Thread luke-tierney--- via R-devel
On Fri, 7 Jun 2024, Hadley Wickham wrote: Thanks for working on this Luke! We appreciate your efforts to make it easier to tell what's in the exported API and we're very happy to work with you on any changes needed to tidyverse/r-lib packages. Hadley Thanks. Glad to hear -- I may be reminding

Re: [Rd] [External] Re: clarifying and adjusting the C API for R

2024-06-07 Thread luke-tierney--- via R-devel
at present.  So I conclude that R exports extra (i.e. non-API) symbols.  Is part of the goal to remove these extra exports? No. We'll hide what we can, but base packages for one need access to some entry points that should not be in the API, so those have to stay un-hidden. Best, luke -Steve

[Rd] clarifying and adjusting the C API for R

2024-06-06 Thread luke-tierney--- via R-devel
o a blog post that will include some examples of moving non-API entry point uses into compliance. Best, luke -- Luke Tierney Ralph E. Wareham Professor of Mathematical Sciences University of Iowa Phone: 319-335-3386 Department of Statistics andFax:

Re: [Rd] [External] R hang/bug with circular references and promises

2024-05-13 Thread luke-tierney--- via R-devel
On Mon, 13 May 2024, Ivan Krylov wrote: [You don't often get email from ikry...@disroot.org. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ] On Mon, 13 May 2024 09:54:27 -0500 (CDT) luke-tierney--- via R-devel wrote: Looks like I added that warning 22 years

Re: [Rd] [External] R hang/bug with circular references and promises

2024-05-13 Thread luke-tierney--- via R-devel
On Sat, 11 May 2024, Peter Langfelder wrote: On Sat, May 11, 2024 at 9:34 AM luke-tierney--- via R-devel wrote: On Sat, 11 May 2024, Travers Ching wrote: The following code snippet causes R to hang. This example might be a bit contrived as I was experimenting and trying to understand

Re: [Rd] [External] R hang/bug with circular references and promises

2024-05-10 Thread luke-tierney--- via R-devel
uld create a cycle and throw an error if it would. Need to think a bit about exactly where the check should go. Best, luke __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel -- Luke Tierney Ralph E. Wareha

Re: [R-pkg-devel] [External] SETLENGTH()

2024-05-04 Thread luke-tierney
, but you should still look for other options if you want your code to continue to work.] Best, luke thank you very much Vladimir Dergachev __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel -- Luke

Re: [R-pkg-devel] [External] May .External2() be used in packages?

2024-05-01 Thread luke-tierney
() at the point where you would call .External2. So instead of .External2("foo", x, y) do .External("foo", quote(.External2("foo", x, y)), environment(), x, y) and adjust your C function accordingly. Best, luke -- Konrad Rudolph // @klmr -- Luke Tierney Ralph E. War

Re: [R-pkg-devel] [External] May .External2() be used in packages?

2024-05-01 Thread luke-tierney
for historical reason to ease moving things that used to be primitives in base out into packages where they fit more naturally. It could be removed now, but I don't think that is high on anyone's priority list.] Best, luke On Wed, 1 May 2024, Konrad Rudolph wrote: Hello, Is the `.External2

Re: [Rd] [External] Re: Patches for CVE-2024-27322

2024-04-30 Thread Tierney, Luke via R-devel
l 2024 at 11:59, peter dalgaard wrote: | svn diff -c 86235 ~/r-devel/R Which is also available as https://github.com/r-devel/r-svn/commit/f7c46500f455eb4edfc3656c3fa20af61b16abb7 Dirk | (or 86238 for the port to the release branch) should be easily backported. | | (CC Luke in case there i

Re: [Rd] [External] View() segfaulting ...

2024-04-25 Thread luke-tierney--- via R-devel
I saw it also on some of my Ubuntu builds, but the issue went away after a make clean/make, so maybe give that a try. Best, luke On Wed, 24 Apr 2024, Ben Bolker wrote: I'm using bleeding-edge R-devel, so maybe my build is weird. Can anyone else reproduce this? View() seems to crash

Re: [Rd] [External] Re: Is ALTREP "non-API"?

2024-04-24 Thread luke-tierney--- via R-devel
. There is really no upside to re-litigating this now. Best, luke Hadley [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel -- Luke Tierney Ralph E. Wareham Professor

Re: [Rd] [External] Re: Is ALTREP "non-API"?

2024-04-24 Thread luke-tierney--- via R-devel
could be programmatically generated, for example by parsing installed headers for declarations and caveats as above. Which would be possible with changes like the ones listed above. Best, luke Hadley -- Luke Tierney Ralph E. Wareham Professor of Mathematical Sciences University of Iowa

Re: [Rd] [External] Calling applyClosure from a package?

2024-04-14 Thread luke-tierney--- via R-devel
e internal functions related to promises. For the ones on CRAN we will work with the maintainers to find alternate approaches. This may mean adding some functions to the API for dealing with some lazy-evaluation-related features at a higher level. Best, luke But I will humbly suggest that it would be r

Re: [Rd] [External] Re: Repeated library() of one package with different include.only= entries

2024-04-11 Thread luke-tierney--- via R-devel
argument to library() has been a *relatively* recent addition {given the 25+ years of R history}: It was part of the extensive new features by Luke Tierney for R 3.6.0 [r76248 | luke | 2019-03-18 17:29:35 +0100], with NEWS entry • library() and require() now allow more control over

Re: [Rd] [External] Bug in out-of-bounds assignment of list object to expression() vector

2024-04-05 Thread luke-tierney--- via R-devel
Best, June [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel -- Luke Tierney Ralph E. Wareham Professor of Mathematical Sciences University of Iowa Phone:

Re: [Rd] [External] Re: Bug in out-of-bounds assignment of list object to expression() vector

2024-04-05 Thread luke-tierney--- via R-devel
rly and the other late. The early one is explicitly letting this one through and shouldn't. So a one line change would address this particular problem. But it would be a good idea to review why we the late checks are needed at all and maybe change that. I'll look into it. Best, luke -- Luke Tierney Ralp

[Rd] Ordered comparison operators on language objects will signal errors

2024-03-04 Thread luke-tierney--- via R-devel
1 : comparison (>) is not possible for language types Best, luke -- Luke Tierney Ralph E. Wareham Professor of Mathematical Sciences University of Iowa Phone: 319-335-3386 Department of Statistics andFax: 319-335-3017 Actuarial Sc

Re: [Rd] [External] Get list of active calling handlers?

2024-02-07 Thread luke-tierney--- via R-devel
a fair bit of work to design and I don't think would be of enough value to justify that. The original SO question would be better addressed to Posit/RStudio. Someone with enough motivation might also be able to figure out an answer by looking at the source code at https://github.com/rstudio/rstudio. B

Re: [Rd] [External] readChar() could read the whole file by default?

2024-01-26 Thread luke-tierney--- via R-devel
hers might) but someone would need to write a patch to implement that. Best, luke For my own purposes the incantation readChar(file, file.size(file)) is ubiquitous. Taking CRAN code[3] as a sample[4], 41% of readChar() calls use either readChar(f, file.info(f)$size) or readChar(f, file.size(f))[5

Re: [Rd] [External] Re: Choices to remove `srcref` (and its buddies) when serializing objects

2024-01-18 Thread luke-tierney--- via R-devel
ng access" error then it would be good to have more details. Best, luke Dropping the (already violated) requirement to be compatible with R serialization bitstream will make it possible to simplify the code further. Finally: a <- new.env() b <- new.env() a$x <- b$x <- 42 identi

[Rd] UseMethod forwarding of local variables

2023-10-20 Thread luke-tierney
getting a value from somewhere else that may or may not be right. Affected as revdeps of optmatch: - cobalt - htetree - jointVIP - MatchIt - PCAmatchR - rcbalance - rcbsubset - RItools - stratamatch Affected as revdeps of texmex: - lax - mobirep Best, luke -- Luke Tierney Ralph E. W

Re: [Rd] [External] On PRINTNAME() encoding, EncodeChar(), and being painted into a corner

2023-09-22 Thread luke-tierney
like Lua or SQLite) provide a special printf specifier (typically %q) to create quoted/escaped string representations, but we're not yet at the point of providing a C-level printf implementation. Not clear it is worth it. But the situation now is not good, because sometimes we encode and sometimes we don't

Re: [Rd] [External] Re: Calling a replacement function in a custom environment

2023-08-27 Thread luke-tierney
disallowing it in complex assignment expressions may be necessary to prevent mutations that should not happen. (There are open bug reports that boil down to this.) In any case, complicating the complex assignment code, which is already barely maintainable, would be a very bad idea. Best, luke If you

Re: [R-pkg-devel] [External] Another DLL requires the use of native symbols thread

2023-03-25 Thread luke-tierney
ode)) So you can either fix your .Fortran call to be consistent with what you have asked R to use, or drop the R_forceSymbols call. Best, luke On Sat, 25 Mar 2023, Shawn Way wrote: Sorry to kind of repeat this but I really didn't understand the issues with the prior thread and how it relate

Re: [Rd] [External] Time to drop globalenv() from searches in package code?

2022-09-17 Thread luke-tierney
On Sat, 17 Sep 2022, Kurt Hornik wrote: luke-tierney writes: On Thu, 15 Sep 2022, Duncan Murdoch wrote: The author of this Stackoverflow question https://stackoverflow.com/q/73722496/2554330 got confused because a typo in his code didn't trigger an error in normal circumstances, but it did

Re: [Rd] [External] assignment

2021-12-27 Thread luke-tierney
in https://bugs.r-project.org/show_bug.cgi?id=18269 Best, luke -- Luke Tierney Ralph E. Wareham Professor of Mathematical Sciences University of Iowa Phone: 319-335-3386 Department of Statistics andFax: 319-335-3017 Actuarial Science 241 Schaef

Re: [Rd] [External] Re: hashtab address arg

2021-12-22 Thread luke-tierney
packages). (Perhaps this topic could be a better fit for R-help.) R-devel is the right place for this. Best, luke -- Luke Tierney Ralph E. Wareham Professor of Mathematical Sciences University of Iowa Phone: 319-335-3386 Department of Statistics andFax:

Re: [Rd] [External] Status of '=>'

2021-12-20 Thread luke-tierney
It's still work in progress. Probably => will be dropped in favor of limited use of _ for non-first-argument passing. Best, luke On Mon, 20 Dec 2021, Dirk Eddelbuettel wrote: R 4.1.0 brought the native pipe and the related ability to use '=>' if one opted into it by setting _R_USE_PIP

Re: [Rd] [External] DOCS: Exactly when, in the signaling process, is option 'warn' applied?

2021-11-18 Thread luke-tierney
("boom")? In the default handler; it doesn't affect signaling. Much of the documentation pre-dates the condition system; happy to consider patches. Best, luke I think the docs, including ?options, would benefit from clarifying that. To the best of my understanding, it should al

Re: [Rd] [External] GC: speeding-up the CHARSXP cache maintenance, 2nd try

2021-11-04 Thread luke-tierney
, but I am exploring a different approach to avoid scanning old generations that may be simpler. Best, luke On Wed, 3 Nov 2021, Andreas Kersting wrote: Hi, In https://stat.ethz.ch/pipermail/r-devel/2021-October/081147.html I proposed to speed up the CHARSXP cache maintenance during GC using

Re: [Rd] [External] Re: Wrong number of names?

2021-11-02 Thread luke-tierney
(ds))) ## 1488 744 dput(ds) # -> ## *** caught segfault *** ## address (nil), cause 'memory not mapped' If I'm reading this right then dput is where the segfault is happening, so that could use some more bulletproofing. Best, luke

Re: [Rd] [External] GC: improving the marking performance for STRSXPs

2021-10-18 Thread luke-tierney
the complexity of threads. Best, luke On Thu, 7 Oct 2021, Andreas Kersting wrote: Hi all, in GC (in src/main/memory.c), FORWARD_CHILDREN() (called by PROCESS_NODES()) treats STRSXPs just like VECSXPs, i.e. it calls FORWARD_NODE() for all its children. I claim that this is unnecessarily

Re: [Bioc-devel] [External] Re: Strange "internal logical NA value has been modified" error

2021-10-13 Thread luke-tierney
more that that the problem happened sometime before it was detected. Best, luke On Wed, 13 Oct 2021, Martin Morgan wrote: The problem with using gdb is you'd find yourself in the garbage collector, but perhaps quite removed from where the corruption occurred, e.g., gc() might / will likely

Re: [Rd] [External] Re: Workaround very slow NAN/Infinities arithmetic?

2021-09-30 Thread luke-tierney
documents on internals, as well as serialized objects. The work needed to sort that out is probably not worth the effort. It also doesn't seem to affect the performance issue here since setting b[1] <- NA_real_ + 0 produces the same slowdown (at least on my current Intel machine). Best, luk

Re: [Rd] [External] Re: Is it a good choice to increase the NCONNECTION value?

2021-08-24 Thread luke-tierney
at their own risk and may need to know how to adjust the soft limit on the process. Best, luke On Wed, 25 Aug 2021, Simon Urbanek wrote: Martin, I don't think static connection limit is sensible. Recall that connections can be anything, not just necessarily sockets or file descriptions so

Re: [Rd] [External] Re: Update on rtools4 and ucrt support

2021-08-23 Thread luke-tierney
chain may be a better investment of time. Best, luke __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel -- Luke Tierney Ralph E. Wareham Professor of Mathematical Sciences University of Iowa Phone:

Re: [Rd] [External] Re: JIT compiler does not compile closures with custom environments

2021-08-18 Thread luke-tierney
lt is to byte compile on source install, or explicitly calling compiler::cmpfun are options. Best, luke Duncan Murdoch __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel -- Luke Tierney Ralph E. Wareham

Re: [Rd] [External] svd For Large Matrix

2021-08-13 Thread luke-tierney
() to see what you are using and consider switching to another BLAS/LAPACK if necessary. Running under gdb may help tracking down where the issue is and reporting it for the BLAS/LAPACK you are using. Best, luke On Fri, 13 Aug 2021, Dario Strbenac via R-devel wrote: Good day, I have a real scenario

Re: [Rd] [External] difference of m1 <- lm(f, data) and update(m1, formula=f)

2021-08-11 Thread luke-tierney
h a call produces when evaluated is the class and environment attributes the call adds, and most code that works with expressions, like eval(), ignores attributes. It would seem somewhat more consistent if update.default put the expression that would produce the formula into the call (i.e. stripped o

Re: [Rd] [External] problem with pipes, textConnection and read.dcf

2021-08-10 Thread luke-tierney
s somewhere in textConnection(). This produces a similar message: read.dcf(textConnection(c(L, "aa", "", "", "ddd"))) File a bug report and someone who understands the textConnection(

Re: [Rd] [External] Re: [R-pkg-devel] Tracking down inconsistent errors and notes across operating systems

2021-07-22 Thread luke-tierney
Thanks; fix committed in r80654. Best, luke On Thu, 22 Jul 2021, Bill Dunlap wrote: A small example of the problem is  #define USE_RINTERNALS 1 #include #include #include static s_object* obj = NULL; Prior to 2021-07-20, with svn 80639, this compiled but after, svn 80647, that I get

[Rd] changes in some header files

2021-07-20 Thread luke-tierney
to review what you are doing and to try to revise your code to work within the API. If you feel there are features missing in the API then you can suggest additions on this mailing list or bugzilla. Best, luke -- Luke Tierney Ralph E. Wareham Professor of Mathematical Sciences University of Iowa

Re: [Rd] [External] Clearing attributes returns ALTREP, serialize still saves them

2021-07-03 Thread luke-tierney
Please do not cross post. You have already rased this on bugzilla. I will follow up there later today. luke On Sat, 3 Jul 2021, Zafer Barutcuoglu wrote: Hi all, Setting names/dimnames on vectors/matrices of length>=64 returns an ALTREP wrapper which internally still contains the na

Re: [Rd] [External] SET_COMPLEX_ELT and SET_RAW_ELT missing from Rinternals.h

2021-07-02 Thread luke-tierney
and not in the API. Again, it will probably be removed from the installed headers. Best, luke This seems better, but it's not used in the interpreter anywhere as far as I can tell, presumably because of the setter interface not being complete, as you point out. But should I be avoiding this second

Re: [Rd] [External] Re: ALTREP ALTINTEGER_SUM/MIN/MAX Return Value and Behavior

2021-06-29 Thread luke-tierney
vector Also .Internal(inspect(x)) still shows the compact representation. A different representation (wrapper around a compact sequence). Best, luke -Sebastian On Tue 29. Jun 2021 at 19:43, Bill Dunlap wrote: Adding the dimensions attribute takes away the altrep-ness. Removing

Re: [Rd] [External] Re: ALTREP ALTINTEGER_SUM/MIN/MAX Return Value and Behavior

2021-06-29 Thread luke-tierney
It depends on the size. For a larger vector adding dim will create a wrapper ALTREP. Currently the wrapper does not try to use the payload's sum method; this could be added. Best, luke On Tue, 29 Jun 2021, Bill Dunlap wrote: Adding the dimensions attribute takes away the altrep-ness

Re: [Rd] [External] ALTREP ALTINTEGER_SUM/MIN/MAX Return Value and Behavior

2021-06-29 Thread luke-tierney
ALTINTEGER_SUM and friends are _not_ intended for use in package code. Once we get some time to clean up headers they will no longer be visible to packages. Best, luke On Tue, 29 Jun 2021, Sebastian Martin Krantz wrote: Hello together, I'm working on some custom (grouped, weighted) sum, min

Re: [Rd] [External] SET_COMPLEX_ELT and SET_RAW_ELT missing from Rinternals.h

2021-06-28 Thread luke-tierney
The setter interface for atomic types is not yer implemented. It may be some day. Best, luke On Fri, 25 Jun 2021, Konrad Siek wrote: Hello, I am working on a package that works with various types of R vectors, implemented in C. My code has a lot of SET_*_ELT operations in it for various

Re: [Rd] [External] Possible ALTREP bug

2021-06-17 Thread luke-tierney
large object in order to get a pointer to its data with REAL(x). If you are iterating over a whole object you may want to get data in chunks. There are iteration macros that help. Some examples are in src/main/summary.c. Best, luke On Wed, Jun 16, 2021 at 4:29 PM Simon Urbanek wrote

Re: [Rd] [External] Possible ALTREP bug

2021-05-28 Thread luke-tierney
assumes will not do that. Catching those jumps is possible but expensive; doing anything sensible if one is caught is really not possible. Best, luke On Fri, 28 May 2021, Gabriel Becker wrote: Hi Jim et al, Just to hopefully add a bit to what Luke already answered, from what I am recalling

Re: [Rd] [External] Possible ALTREP bug

2021-05-28 Thread luke-tierney
integer and real Elt methods are not expected to allocate. You would have to suspend GC to be able to do that. This currently can't be done from package code. Best, luke On Fri, 28 May 2021, Gábor Csárdi wrote: I have found some weird SEXP corruption behavior with ALTREP, which could

Re: [Rd] [External] Re: 1954 from NA

2021-05-25 Thread luke-tierney
those maintaining R. After all, the NA is nothing but a tagged NaN. And we are now paying a price for what was, in hindsight, an unfortunate decision. Best, luke All the best, Adrian On Tue, May 25, 2021 at 7:05 AM Avi Gross via R-devel wrote: I was thinking about how one does

Re: [Rd] [External] Re: 1954 from NA

2021-05-24 Thread luke-tierney
is. If you need operations to preserve attributes across subsetting you can define subsetting methods that do that. If you are dead set on doing something in C you can try to develop an ALTREP class that provides augmented missing value information. Best, luke The mere thought of implementing

Re: [Rd] [External] Pipe bind restored in R 4.1.0?

2021-04-17 Thread luke-tierney
No. We need more time to resolve issues revealed in testing. Best, luke On Sat, 17 Apr 2021, Brenton Wiernik wrote: Is the pipe bind `=>` operator likely to be restored by default in time for the 4.1 release? Brenton [[alternative HTML version dele

Re: [Rd] [External] memory consumption of nested (un)serialize of sys.frames()

2021-04-08 Thread luke-tierney
your best bet. Having an option to serialize without source references might be nice but would probably not be high enough on anyone's priority list to get done anytime soon. Best, luke On Thu, 8 Apr 2021, luke-tier...@uiowa.edu wrote: I see that now also. Not sure yet what is going on. One

Re: [Rd] [External] memory consumption of nested (un)serialize of sys.frames()

2021-04-08 Thread luke-tierney
I see that now also. Not sure yet what is going on. One work-around that may work for you is to create a fresh crash dump in a .onLoad function; somehting like crash_dumps <- NULL .onLoad <- function(...) crash_dumps <<- new.env() Best, luke On Wed, 7 Apr 2021, Andreas Kersting

Re: [Rd] [External] memory consumption of nested (un)serialize of sys.frames()

2021-04-07 Thread luke-tierney
No issues here with that either. Looks like something is different on your end. Best, luke On Wed, 7 Apr 2021, Andreas Kersting wrote: Hi Luke, Please see https://github.com/akersting/dumpTest for the package. Here a session showing my issue: library(dumpTest) sessionInfo() R version

Re: [Rd] [External] memory consumption of nested (un)serialize of sys.frames()

2021-04-07 Thread luke-tierney
-devel on Ubuntu). You will need to provide a more complete reproducible example if you want help with what you are trying to do; also sessionInfo() would help. Best, luke crash_dumps <- new.env() f <- function() { x <- runif(1e5) dump <- lapply(1:2, function(i) unserialize(serializ

Re: [Rd] [External] brief update on the pipe operator in R-devel

2021-01-12 Thread luke-tierney
e balance between making these non-standard cases easy to see but still easy to write. This is now committed to R-devel. Best, luke On Tue, 22 Dec 2020, luke-tier...@uiowa.edu wrote: It turns out that allowing a bare function expression on the right-hand side (RHS) of a pipe creates oppo

[Rd] brief update on the pipe operator in R-devel

2020-12-22 Thread luke-tierney
likelihood of making mistakes that are hard to track down is too high. So we will disallow the use of bare function expressions on the right hand side of a pipe. Best, luke -- Luke Tierney Ralph E. Wareham Professor of Mathematical Sciences University of Iowa Phone: 31

Re: [Rd] [External] setting .libPaths() with parallel::clusterCall

2020-12-22 Thread luke-tierney
n between providing a function value or a character string as the function argument to clusterCall and others could probably use a paragraph in the help file; happy to consider a patch if anyone wants to take a crack at it. Best, luke If this is indeed a bug, I'm happy to file it at bugzilla. Tested on

Re: [Rd] [External] R crashes when using huge data sets with character string variables

2020-12-12 Thread luke-tierney
in ?Memory; that only affects the R heap, not malloc() done elsewhere. Best, luke On Sat, 12 Dec 2020, Arne Henningsen wrote: When working with a huge data set with character string variables, I experienced that various commands let R crash. When I run R in a Linux/bash console, R terminates

Re: [Rd] [External] Re: New pipe operator

2020-12-07 Thread luke-tierney
e lived in a world where most RHS functions take one argument and only a few needed currying. That is the case in many functional languages, but not for R. Making the common case of multiple arguments easy means you have to work at the source level, either in the parser or with some form of NSE.

Re: [Rd] [External] anonymous functions

2020-12-07 Thread luke-tierney
are compatible within tidyverse but not with others). And of course none work in sapply or lapply. Providing a shorthand in base may help to improve this. You don't have to use it if you don't want to, and you can establish coding standards that disallow it if you like. Best, luke On Mon, 7 Dec

Re: [Rd] [External] Re: New pipe operator

2020-12-07 Thread luke-tierney
ext = x) Using named arguments to redirect to the implicit first does work, also in magrittr, but for me at least it is the kind of thing I would probably regret a month later when trying to figure out the code. Best, luke On Mon, 7 Dec 2020, Gabor Grothendieck wrote: On Sat, Dec 5, 2020

Re: [Rd] [External] Re: New pipe operator

2020-12-06 Thread luke-tierney
On Sun, 6 Dec 2020, Gabor Grothendieck wrote: Why is that ambiguous? It works in magrittr. For now, all functions marked internally as syntactically special are disallowed. Not all of these lead to ambiguities. Best, luke library(magrittr) 1 %>% `+`() [1] 1 On Sun, Dec 6, 2020 a

Re: [Rd] [External] Re: New pipe operator

2020-12-06 Thread luke-tierney
1] 3 1 |> (`+`)() ## [1] 1 The error message suggests that this was intentional. It isn't mentioned in ?"|>" ?"|>" says: To avoid ambiguities, functions in ‘rhs’ calls may not be syntactically special, such as ‘+’ or ‘if’. (used to say lhs; fixed now). Best

Re: [Rd] [External] Re: New pipe operator

2020-12-05 Thread luke-tierney
handling of :: and :::). It's easier to add flexibility and complexity than to restrict it after the fact. Best, luke On Sat, 5 Dec 2020, Hugh Parsonage wrote: I'm surprised by the aversion to mtcars |> nrow over mtcars |> nrow() and I think the decision to disallow the former

Re: [Rd] [External] Re: New pipe operator

2020-12-04 Thread luke-tierney
On Sat, 5 Dec 2020, Duncan Murdoch wrote: On 04/12/2020 2:26 p.m., luke-tier...@uiowa.edu wrote: On Fri, 4 Dec 2020, Dénes Tóth wrote: On 12/4/20 3:05 PM, Duncan Murdoch wrote: ... It's tempting to suggest it should allow something like   mtcars |> subset(cyl == 4) |> lm(mpg

Re: [Rd] [External] Re: New pipe operator

2020-12-04 Thread luke-tierney
e code easier to understand. As a wearer of progressive bifocals and someone whose screen is not always free of small dust particles, having to spot the non-standard pipe stages by seeing a placeholder, especially a . placeholder, is be a bug, not a feature. Best, luke Syntactic sugars work the the bes

Re: [Rd] [External] Re: .Internal(quit(...)): system call failed: Cannot allocate memory

2020-12-01 Thread luke-tierney
The fact that your max resident size isn't affected looks odd. Are you setting the environment variable outside R? When I run env R_MAX_VSIZE=16Gb /usr/bin/time bin/Rscript jg.R 1e9 2e0 0 0 (your code in jg.R). I get a quick failure with 11785524maxresident)k Best, luke On Tue, 1 Dec

Re: [Rd] [External] Re: .Internal(quit(...)): system call failed: Cannot allocate memory

2020-11-27 Thread luke-tierney
On Thu, 26 Nov 2020, Jan Gorecki wrote: Thank you Luke for looking into it. Your knowledge of gc is definitely helpful here. I put comments inline below. Best, Jan On Wed, Nov 25, 2020 at 10:38 PM wrote: On Tue, 24 Nov 2020, Jan Gorecki wrote: As for other calls to system. I avoid

Re: [Rd] [External] Re: .Internal(quit(...)): system call failed: Cannot allocate memory

2020-11-25 Thread luke-tierney
something similar. There may be opportunities for more tuning of the GC to better handle running this close to memory limits, but I doubt the payoff would be worth the effort. Best, luke It would help if gcinfo() could take FALSE/TRUE/2L where 2L will print even more information about gc, like

Re: [Rd] [External] exists, get and get0 accept silently inputs of length > 1

2020-11-23 Thread luke-tierney
ror if the class argument has length > 1. Calls of the form getS2method(generic, class(x)) will now fail if class(x) has length > 1. I believe most CRAN package issues related to this change have already been resolved, but a few may remain. Best, luke On Fri, 13 Nov 2020, Antoine Fabri wrote: Dea

Re: [Rd] [External] Two ALTREP questions

2020-11-21 Thread luke-tierney
BTW, is there any way to contribute to the R source? I know R has a limited resouces, so if possible, I will be happy to fix the matrix issue myself and make some minor contributions to the R community. You can find the suggested process for contributing described in the 'Reporting Bugs' link on t

Re: [Rd] [External] exists, get and get0 accept silently inputs of length > 1

2020-11-16 Thread luke-tierney
the change expanding the domain of get(). luke On Tue, 17 Nov 2020, Gabriel Becker wrote: Hi all, I have used variable values in get() as well, and including, I think, in package code (though pretty infrequently). Perhaps a character.only argument similar to library? ~G On Mon, Nov 16, 2020 at 5

Re: [Rd] [External] exists, get and get0 accept silently inputs of length > 1

2020-11-13 Thread luke-tierney
k to names internally for the environment lookup. Best, luke On Fri, 13 Nov 2020, Antoine Fabri wrote: Dear R-devel, The doc of exists, get and get0 is unambiguous, x should be an object given as a character string. However these accept longer inputs. It can lead an uncareful user to think these

Re: [Rd] [External] Re: Change to I() in R 4.1

2020-10-30 Thread luke-tierney
little less so for an attribute, but using an attribute rules out dispatch on the AsIs property. Best, luke I would also suggest that the "package" attribute of the S4 class be kept around so the code that we use to restore the original object has a way to restore it exactly, includi

Re: [Rd] [External] Something is wrong with the unserialize function

2020-10-29 Thread luke-tierney
I found that also; fixed in r79386 in the trunk. Will port to R-patched shortly. Best, luke On Thu, 29 Oct 2020, Martin Morgan wrote: This Index: src/main/altrep.c === --- src/main/altrep.c (revision 79385) +++ src/main

Re: [Rd] [External] Something is wrong with the unserialize function

2020-10-29 Thread luke-tierney
lemmap) x <- mmap(filePath, "double") saveRDS(x, file = "x.Rds") ## in a separate R process: gctorture() readRDS("x.Rds") Looks like a missing PROTECT somewhere. Best, luke On Thu, 29 Oct 2020, Jiefei Wang wrote: Hi all, I am not able to export an ALTR

Re: [Rd] [External] Re: Coercion function does not work for the ALTREP object

2020-10-08 Thread luke-tierney
ded, Ideally there should be no difference for Coerce. There is a difference because wrappers currently don't delegate the Coerce method when the wrapped object is an ALTREP. I'll look into whether that can be addressed without breaking things. Best, luke On Thu, 8 Oct 2020, Jiefei Wang wrote:

Re: [Rd] [External] Thread-safe R functions

2020-09-13 Thread luke-tierney
, so you need to make sure you have set a top level context in your thread. Best, luke On Sun, 13 Sep 2020, Jiefei Wang wrote: Hi, I am curious about whether there exist thread-safe functions in `Rinternals.h`. I know that R is single-threaded designed, but for the simple and straightforward

Re: [Rd] [External] Re: Operations with long altrep vectors cause segfaults on Windows

2020-09-08 Thread luke-tierney
On Tue, 8 Sep 2020, Martin Maechler wrote: luke-tierney on Tue, 8 Sep 2020 09:42:43 -0500 (CDT) writes: > On Tue, 8 Sep 2020, Martin Maechler wrote: >>>>>>> Martin Maechler >>>>>>> on Tue, 8 Sep 2020 10:40:24 +0200 writes: >>

Re: [Rd] [External] Re: Operations with long altrep vectors cause segfaults on Windows

2020-09-08 Thread luke-tierney
ed on (64-bit) Linux does *not* show on Windows (64-bit), at least not for that case: On Windows, things are fine as long as they remain (compacted aka 'ALTREP') INTSXP: > y <- -1e3:2e9 ;.Internal(inspect(y)) @0x0a285648 13 INTSXP g0c0 [REF(65535)] -1000 : 20 (compact) >

Re: [Rd] [External] Re: Operations with long altrep vectors cause segfaults on Windows

2020-09-08 Thread luke-tierney
e rtools and gdb installed can you run in gdb and see where the segfault is happening? Best, luke On Tue, 8 Sep 2020 at 18:52, Martin Maechler wrote: Martin Maechler on Tue, 8 Sep 2020 10:40:24 +0200 writes: Hugh Parsonage on Tue, 8 Sep 2020 18:08:11 +1000 writes: >>

Re: [Rd] [External] Re: some questions about R internal SEXP types

2020-09-08 Thread luke-tierney
oved wrong. Best, luke Hadley -- Luke Tierney Ralph E. Wareham Professor of Mathematical Sciences University of Iowa Phone: 319-335-3386 Department of Statistics andFax: 319-335-3017 Actuarial Science 241 Schaeffer Hall ema

[Rd] HELPWANTED keyword in bugs.r-project.org

2020-08-05 Thread luke-tierney
level varies; some might be resolved with a small amount of R code; others might need more extensive changes at the C level. Best, luke -- Luke Tierney Ralph E. Wareham Professor of Mathematical Sciences University of Iowa Phone: 319-335-3386 Department of Statistics

Re: [Rd] [External] Re: Invisible names problem

2020-07-22 Thread luke-tierney
or serialization (and install it in the wrapper), but that could be a bad idea of the object is large. A tighter integration of ALTREP serialization with the serialization internals might allow and ALTREP's serialization method to write directly to the serialization stream, but that would make thi

Re: [R-pkg-devel] [External] Re: incomplete gamma function Fortran subroutine

2020-07-21 Thread luke-tierney
Looking at this section of WRE may help: https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Numerical-analysis-subroutines Best, luke On Tue, 21 Jul 2020, Wang, Zhu wrote: Thanks to Ben and John. Perhaps the program should call pgamma in R and pass the number to Fortran. Calling

Re: [R-pkg-devel] [External] Re: Interpret feedback: not write testthat-tests in examples

2020-07-16 Thread luke-tierney
que(substr(as.vector(fsl), 1,5)), format(round(as.vector(sl)/1024, 1 On 7/16/20 2:02 PM, luke-tier...@uiowa.edu wrote: On Thu, 16 Jul 2020, Henrik Bengtsson wrote: If the point of having, say, stopifnot(add(1, 2) == sum(c(1, 2)) is to make it explicit to the reader that your

Re: [R-pkg-devel] [External] Re: Interpret feedback: not write testthat-tests in examples

2020-07-16 Thread luke-tierney
: add(1, 2) == sum(c(1, 2) Using stopifnot just adds clutter that obscures the message for a human reader; testthat::expect_equal even more so. Best, luke Now, if the point of your "assert" statement is only to validate your package/code, then I agree it should not be in the example

Re: [Rd] [External] Re: R-devel internal errors during check produce?

2020-06-30 Thread luke-tierney
Thanks. Fixed in R-devel in r78754. This was related to a fix for PR#17809, not the change to unique.default. Best, luke On Tue, 30 Jun 2020, Jan Gorecki wrote: No packages are being loaded, or even installed. Did you try running the example on R-devel built with flags I have provided

Re: [Rd] [External] Possible ABI change in R 4.0.1

2020-06-29 Thread luke-tierney
tells you the PR this addressed. As it says in Writing R Extensions about defining USE_RINTERNALS: Also be prepared to adjust your code should R internals change. The same goes for any use of non-API macros and functions. Best, luke On Mon, 29 Jun 2020, Gábor Csárdi wrote: Hi all

  1   2   3   4   5   6   >