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

2024-01-18 Thread luke-tierney--- via R-devel
On Thu, 18 Jan 2024, Ivan Krylov via R-devel wrote: В Tue, 16 Jan 2024 14:16:19 -0500 Dipterix Wang пишет: Could you recommend any packages/functions that compute hash such that the source references and sexpinfo_struct are ignored? Basically a version of `serialize` that convert R objects to

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

2024-01-26 Thread luke-tierney--- via R-devel
On Fri, 26 Jan 2024, Michael Chirico wrote: I am curious why readLines() has a default (n=-1L) to read the full file while readChar() has no default for nchars= (i.e., readChar(file) is an error). Is there a technical reason for this? I often[1] see code like paste(readLines(f), collapse="\n")

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

2024-02-07 Thread luke-tierney--- via R-devel
On Tue, 6 Feb 2024, Duncan Murdoch wrote: The SO post https://stackoverflow.com/q/77943180 tried to call globalCallingHandlers() from a function, and it failed with the error message "should not be called with handlers on the stack". A much simpler illustration of the same error comes from th

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

2024-03-04 Thread luke-tierney--- via R-devel
Comparison operators == and != can be used on language objects (i.e. call objects and symbols). The == operator in particular often seems to be used as a shorthand for calling identical(). The current implementation involves comparing deparsed calls as strings. This has a number of drawbacks and w

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
On Fri, 5 Apr 2024, Ivan Krylov via R-devel wrote: On Fri, 5 Apr 2024 08:15:20 -0400 June Choe wrote: When assigning a list to an out of bounds index (ex: the next, n+1 index), it errors the same but now changes the values of the vector to NULL: ``` x <- expression(a,b,c) x[[4]] <- list() #

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

2024-04-05 Thread luke-tierney--- via R-devel
Thanks for the report. Fixed in R-devel and R-patched (both R-4-4-branch and R-4-3-branch). On Fri, 5 Apr 2024, June Choe wrote: [You don't often get email from jchoe...@gmail.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ] There seems to be a bug in out-of

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

2024-04-11 Thread luke-tierney--- via R-devel
On Thu, 11 Apr 2024, Duncan Murdoch wrote: On 11/04/2024 7:04 a.m., Martin Maechler wrote: Michael Chirico on Mon, 8 Apr 2024 10:19:29 -0700 writes: > Right now, attaching the same package with different include.only= has no > effect: > library(Matrix, include.only="fac

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

2024-04-14 Thread luke-tierney--- via R-devel
On Sun, 14 Apr 2024, Matthew Kay wrote: [You don't often get email from matthew@u.northwestern.edu. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ] Hi, Short version of my question: Rf_applyClosure was marked attribute_hidden in Oct 2023, and I am curious wh

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

2024-04-24 Thread luke-tierney--- via R-devel
On Wed, 24 Apr 2024, Hadley Wickham wrote: That is not true at all - the presence of header does not constitute declaration of something as the R API. There are cases where internal functions are in the headers for historical or other reasons since the headers are used both for the internal

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

2024-04-24 Thread luke-tierney--- via R-devel
On Wed, 24 Apr 2024, Hadley Wickham wrote: A few more thoughts based on a simple question: how do you determine the length of a vector? Rf_length() is used in example code in R-exts, but I don't think it's formally documented anywhere (although it's possible I missed it). Is using in an example

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 on jus

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

2024-05-10 Thread luke-tierney--- via R-devel
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 promises, but uses only base R. It looks like it is looking for "not_a_variable" recursively but since it doesn't exist it

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-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

[Rd] clarifying and adjusting the C API for R

2024-06-06 Thread luke-tierney--- via R-devel
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 support visibility restrictions, most of these are visible only within the R executble or shared library. About

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

2024-06-07 Thread luke-tierney--- via R-devel
n. Best, luke -Steve On Thu, Jun 6, 2024 at 10:47 AM luke-tierney--- via R-devel 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 a

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

2024-06-07 Thread luke-tierney--- via R-devel
reminding you when we hit some of the tougher challenges down the road :-) Best, luke On Thu, Jun 6, 2024 at 9:47 AM luke-tierney--- via R-devel wrote: This is an update on some current work on the C API for use in R extensions. The internal R implementation makes use

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

2024-06-07 Thread luke-tierney--- via R-devel
uot; Can we leave 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-ne

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

2024-06-08 Thread luke-tierney--- via R-devel
On Sat, 8 Jun 2024, Ben Bolker wrote: The ASAN errors occur *even if the zero-length object is not actually accessed*/is used in a perfectly correct manner, i.e. it's perfectly legal in base R to define `m <- numeric(0)` or `m <- matrix(nrow = 0, ncol = 0)`, whereas doing the equivalent in Rc

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

2024-06-18 Thread luke-tierney--- via R-devel
Another quick update: Over 100 entry points used in packages for which it was safe to do so have now been marked as part of an API (in some cases after adding error checking of arguments). These can be used in package C code, with caveats for ones considered experimental or intended for embedded

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

2024-06-19 Thread luke-tierney--- via R-devel
The non-API entry point Rf_findVarInFrame3 used by some packages will be removed as it is not needed in one use case and not working as intended in the other. The most common use case, Rf_findVarInFrame3(rho, sym, TRUE), is equivalent to the simpler Rf_findVarInFrame(rho, sym). The less common u

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 (emphasis mi

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 J

Re: [Rd] [External] Re: Could .Primitive("[") stop forcing R_Visible = TRUE?

2024-10-25 Thread luke-tierney--- via R-devel
On Fri, 25 Oct 2024, Ivan Krylov via R-devel wrote: В Fri, 25 Oct 2024 08:39:39 -0400 Duncan Murdoch пишет: Surely you or they should be the ones to run the test across all of CRAN? That's fair. The question is, is there a fundamental reason I overlooked to deny such a change? Except for po

Re: [Rd] [External] More precise documentation of on.exit() [when leaving function vs. "context"]

2025-02-14 Thread luke-tierney--- via R-devel
On Fri, 14 Feb 2025, Michael Chirico wrote: The current documentation of ?on.exit reads [1] `on.exit` records [`expr`] as needing to be executed when the current function exits... This is almost always how it is used, however I don't see that as explaining this other common way to use on.ex

Re: [Rd] [External] Suppressed "graphical parameter" warnings reviving themselves magically

2025-03-21 Thread luke-tierney--- via R-devel
Warnings are not "reviving themselves magically". Try resizing the window a few times and hitting return in the REPL. That should give you a hint on what is going on. Best, luke On Fri, 21 Mar 2025, Henrik Bengtsson wrote: What's going on here? $ R --vanilla --quiet plot.new(); suppressWarn