Re: [Rd] Improving user-friendliness of S4 dispatch failure when mis-naming arguments?

2023-08-11 Thread Michael Chirico via R-devel
> I'm not entirely sure about the extra call. = FALSE My thinking is the signature of the internal .InheritForDispatch() is not likely to help anyone, in fact having the opposite effect for beginners unsure how to use that info. > Now I'd like to find an example that only uses packages with

Re: [Rd] Improving user-friendliness of S4 dispatch failure when mis-naming arguments?

2023-08-11 Thread Martin Maechler
> Michael Chirico via R-devel > on Thu, 10 Aug 2023 23:56:45 -0700 writes: > Here's a trivial patch that offers some improvement: > Index: src/library/methods/R/methodsTable.R > === > ---

Re: [Rd] Improving user-friendliness of S4 dispatch failure when mis-naming arguments?

2023-08-11 Thread Michael Chirico via R-devel
Here's a trivial patch that offers some improvement: Index: src/library/methods/R/methodsTable.R === --- src/library/methods/R/methodsTable.R (revision 84931) +++ src/library/methods/R/methodsTable.R (working copy) @@ -752,11 +752,12

Re: [Rd] Improving user-friendliness of S4 dispatch failure when mis-naming arguments?

2023-08-10 Thread Gabriel Becker
I just want to add my 2 cents that I think it would be very useful and beneficial to improve S4 to surface that information as well. More information about the way that the dispatch failed would be of great help in situations like the one Michael pointed out. ~G On Thu, Aug 10, 2023 at 9:59 AM

Re: [Rd] Improving user-friendliness of S4 dispatch failure when mis-naming arguments?

2023-08-10 Thread Michael Chirico via R-devel
I forwarded that along to the original reporter with positive feedback -- including the argument names is definitely a big help for cuing what exactly is missing. Would a patch to do something similar for S4 be useful? On Thu, Aug 10, 2023 at 6:46 AM Hadley Wickham wrote: > > Hi Michael, > > I

Re: [Rd] Improving user-friendliness of S4 dispatch failure when mis-naming arguments?

2023-08-10 Thread Hadley Wickham
Hi Michael, I can't help with S4, but I can help to make sure this isn't a problem with S7. What do you think of the current error message? Do you see anything obvious we could do to improve? library(S7) dbGetQuery <- new_generic("dbGetQuery", c("conn", "statement")) dbGetQuery(connection =

[Rd] Improving user-friendliness of S4 dispatch failure when mis-naming arguments?

2023-08-09 Thread Michael Chirico via R-devel
I fielded a debugging request from a non-expert user today. At root was running the following: dbGetQuery(connection = conn, query = query) The problem is that they've named the arguments incorrectly -- it should have been [1]: dbGetQuery(conn = conn, statement = query) The problem is that the