Re: [Rd] Autocompletion for the new S3 generic @ method?

2023-04-06 Thread Deepayan Sarkar
This should be enabled now in R-devel and R 4.3.0 by writing
.AtNames() methods.

findMatches() is also exported now; this is basically grep(), but will
do fuzzy matching if it's activated.

Best,
-Deepayan

On Mon, Apr 3, 2023 at 9:37 AM Deepayan Sarkar
 wrote:
>
> Thanks, we are discussing the details, but we will definitely add
> something along those lines before 4.3.0 is released.
>
> Best,
> -Deepayan
>
> On Sun, Apr 2, 2023 at 6:39 PM Tomasz Kalinowski  
> wrote:
> >
> > I agree, this is a good idea and would be very helpful in interactive 
> > contexts.
> >
> > I have a draft patch implementing this feature here: 
> > https://github.com/r-devel/r-svn/pull/122
> > (Append  “.patch” to the URL to get a raw patch.)
> >
> > Regards,
> > Tomasz
> >
> > > On Mar 31, 2023, at 2:11 PM, Karolis K  
> > > wrote:
> > >
> > > Hello,
> > >
> > > In the current R-devel @ is S3 generic, so we can do things like - for 
> > > example - use it to extract matrix rows by name:
> > >
> > >.S3method("@", "mm", function(object, name) object[name,])
> > >m <- structure(matrix(rnorm(20), ncol=2), dimnames=list(paste0("row", 
> > > 1:10), paste("col", 1:2)), class="mm")
> > >
> > >m@row1
> > >
> > > However, seems like currently it does not support autocompletion.
> > >
> > > Wouldn’t it make sense to add a method like .EtaNames() which would 
> > > provide tab autocompletions for x@ in the same way current 
> > > .DollarNames() does for x$?
> > >
> > > Regards,
> > > Karolis K.
> > > __
> > > R-devel@r-project.org mailing list
> > > https://stat.ethz.ch/mailman/listinfo/r-devel
> >
> > __
> > R-devel@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-devel

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Autocompletion for the new S3 generic @ method?

2023-04-02 Thread Deepayan Sarkar
Thanks, we are discussing the details, but we will definitely add
something along those lines before 4.3.0 is released.

Best,
-Deepayan

On Sun, Apr 2, 2023 at 6:39 PM Tomasz Kalinowski  wrote:
>
> I agree, this is a good idea and would be very helpful in interactive 
> contexts.
>
> I have a draft patch implementing this feature here: 
> https://github.com/r-devel/r-svn/pull/122
> (Append  “.patch” to the URL to get a raw patch.)
>
> Regards,
> Tomasz
>
> > On Mar 31, 2023, at 2:11 PM, Karolis K  
> > wrote:
> >
> > Hello,
> >
> > In the current R-devel @ is S3 generic, so we can do things like - for 
> > example - use it to extract matrix rows by name:
> >
> >.S3method("@", "mm", function(object, name) object[name,])
> >m <- structure(matrix(rnorm(20), ncol=2), dimnames=list(paste0("row", 
> > 1:10), paste("col", 1:2)), class="mm")
> >
> >m@row1
> >
> > However, seems like currently it does not support autocompletion.
> >
> > Wouldn’t it make sense to add a method like .EtaNames() which would provide 
> > tab autocompletions for x@ in the same way current .DollarNames() does 
> > for x$?
> >
> > Regards,
> > Karolis K.
> > __
> > R-devel@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-devel
>
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Autocompletion for the new S3 generic @ method?

2023-04-02 Thread Gabriel Becker
Hi Tomasz,

I haven't had a chance to look at your patch yet (also I can't accept it as
I'm not on R-core), but patches for consideration should be submitted to
bugzilla (https://bugs.r-project.org), not the unofficial github mirror of
the the SVN repo.

Best,
~G

On Sun, Apr 2, 2023 at 6:09 AM Tomasz Kalinowski 
wrote:

> I agree, this is a good idea and would be very helpful in interactive
> contexts.
>
> I have a draft patch implementing this feature here:
> https://github.com/r-devel/r-svn/pull/122
> (Append  “.patch” to the URL to get a raw patch.)
>
> Regards,
> Tomasz
>
> > On Mar 31, 2023, at 2:11 PM, Karolis K 
> wrote:
> >
> > Hello,
> >
> > In the current R-devel @ is S3 generic, so we can do things like - for
> example - use it to extract matrix rows by name:
> >
> >.S3method("@", "mm", function(object, name) object[name,])
> >m <- structure(matrix(rnorm(20), ncol=2), dimnames=list(paste0("row",
> 1:10), paste("col", 1:2)), class="mm")
> >
> >m@row1
> >
> > However, seems like currently it does not support autocompletion.
> >
> > Wouldn’t it make sense to add a method like .EtaNames() which would
> provide tab autocompletions for x@ in the same way current
> .DollarNames() does for x$?
> >
> > Regards,
> > Karolis K.
> > __
> > R-devel@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-devel
>
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

[[alternative HTML version deleted]]

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Autocompletion for the new S3 generic @ method?

2023-04-02 Thread Tomasz Kalinowski
I agree, this is a good idea and would be very helpful in interactive contexts. 

I have a draft patch implementing this feature here: 
https://github.com/r-devel/r-svn/pull/122
(Append  “.patch” to the URL to get a raw patch.)

Regards,
Tomasz

> On Mar 31, 2023, at 2:11 PM, Karolis K  wrote:
> 
> Hello,
> 
> In the current R-devel @ is S3 generic, so we can do things like - for 
> example - use it to extract matrix rows by name:
> 
>.S3method("@", "mm", function(object, name) object[name,])
>m <- structure(matrix(rnorm(20), ncol=2), dimnames=list(paste0("row", 
> 1:10), paste("col", 1:2)), class="mm")
> 
>m@row1
> 
> However, seems like currently it does not support autocompletion.
> 
> Wouldn’t it make sense to add a method like .EtaNames() which would provide 
> tab autocompletions for x@ in the same way current .DollarNames() does 
> for x$?
> 
> Regards,
> Karolis K.
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] Autocompletion for the new S3 generic @ method?

2023-03-31 Thread Karolis K
Hello,

In the current R-devel @ is S3 generic, so we can do things like - for example 
- use it to extract matrix rows by name:

.S3method("@", "mm", function(object, name) object[name,])
m <- structure(matrix(rnorm(20), ncol=2), dimnames=list(paste0("row", 
1:10), paste("col", 1:2)), class="mm")

m@row1

However, seems like currently it does not support autocompletion.

Wouldn’t it make sense to add a method like .EtaNames() which would provide tab 
autocompletions for x@ in the same way current .DollarNames() does for 
x$?

Regards,
Karolis K.
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel