Re: [Rd] [External] R C api for 'inherits' S3 and S4 objects

2019-11-01 Thread Jan Gorecki
Thank you all for your valuable comments. Best, Jan On Fri, Nov 1, 2019 at 8:15 PM Tierney, Luke wrote: > > On Fri, 1 Nov 2019, Jan Gorecki wrote: > > > Thank you Luke. > > That is why I don't use Rf_inherits but INHERITS which does not > > allocate, provided in the email body. > > Your definitio

Re: [Rd] [External] R C api for 'inherits' S3 and S4 objects

2019-11-01 Thread Tierney, Luke
On Fri, 1 Nov 2019, Jan Gorecki wrote: > Thank you Luke. > That is why I don't use Rf_inherits but INHERITS which does not > allocate, provided in the email body. Your definition can allocate because STING_ELT can allocate. getAttrib can GC in general. Currently it would not GC or allocate in thi

Re: [Rd] [External] R C api for 'inherits' S3 and S4 objects

2019-11-01 Thread Simon Urbanek
Note that your desire is by definition impossible - as your example also shows checking for S4 inheritance involves evaluation and thus allocation which cannot be avoided by the dynamic design of S4 inheritance. Cheers, Simon > On Nov 1, 2019, at 9:23 AM, Jan Gorecki wrote: > > Thank you Luk

Re: [Rd] [External] R C api for 'inherits' S3 and S4 objects

2019-11-01 Thread Gábor Csárdi
AFAIR getAttrib() can allocate as well. Also, R API functions that do not allocate today, may allocate in the future. Gabor On Fri, Nov 1, 2019 at 1:24 PM Jan Gorecki wrote: > > Thank you Luke. > That is why I don't use Rf_inherits but INHERITS which does not > allocate, provided in the email bo

Re: [Rd] [External] R C api for 'inherits' S3 and S4 objects

2019-11-01 Thread Jan Gorecki
Thank you Luke. That is why I don't use Rf_inherits but INHERITS which does not allocate, provided in the email body. I cannot do similarly for S4 classes, thus asking for some API for that. On Fri, Nov 1, 2019 at 5:56 PM Tierney, Luke wrote: > > On Fri, 1 Nov 2019, Jan Gorecki wrote: > > > Dear

Re: [Rd] [External] R C api for 'inherits' S3 and S4 objects

2019-11-01 Thread Tierney, Luke
On Fri, 1 Nov 2019, Jan Gorecki wrote: > Dear R developers, > > Motivated by discussion about checking inheritance of S3 and S4 > objects (in head matrix/array topic) I would light to shed some light > on a minor gap about that matter in R C API. > Currently we are able to check inheritance for S3