[Rd] slots of type double

2007-11-13 Thread hpages
Hi, Any idea why S4 doesn't allow slots of type double? setClass(A, representation(a=double)) Error in makePrototypeFromClassDef(properties, ClassDef, immediate, where) : in making the prototype for class A elements of the prototype failed to match the corresponding slot class: a

[Rd] How to overload the assignment operator?

2007-11-13 Thread Jens Oehlschlägel
Dear all, what is the proper way to make the assignment operator generic and define methods depending on the class of the assigned value? Best regards Jens Oehlschlägel P.S. I vaguely remember that this was possible in S+. In R I tried to no avail: # using this like h-1:3 gives Error: in

Re: [Rd] How to overload the assignment operator?

2007-11-13 Thread Matthias Kohl
are you looking for setReplaceMethod? hth Matthias Jens Oehlschlägel wrote: Dear all, what is the proper way to make the assignment operator generic and define methods depending on the class of the assigned value? Best regards Jens Oehlschlägel P.S. I vaguely remember that this was

Re: [Rd] How to overload the assignment operator?

2007-11-13 Thread Oleg Sklyar
I think the question is not about setReplaceMethod, here is the idea: ## setReplaceMethod-like situation: names(x) - c(a,b) ## the question of interest class(x) [1] myClass y - x ## this to run a user-defined clone method for class 'myClass' Why is this important - if x contains data that

Re: [Rd] How to overload the assignment operator?

2007-11-13 Thread Jens Oehlschlägel
Thanks Matthias, are you looking for setReplaceMethod? So far the package I m writing has avoided using anything from S4 and the implications of touching S4 are not clear to me. The package aims on providing an alternative to 'atomic' data stored in ram, i.e. large atomic data stored on

Re: [Rd] slots of type double

2007-11-13 Thread Simon Urbanek
On Nov 13, 2007, at 3:36 AM, [EMAIL PROTECTED] wrote: Any idea why S4 doesn't allow slots of type double? Type (as in storage type and double is a storage type) has nothing to do with classes. You cannot create slots for types, only for classes. setClass(A, representation(a=double))

Re: [Rd] How to overload the assignment operator?

2007-11-13 Thread Simon Urbanek
On Nov 13, 2007, at 9:19 AM, Jens Oehlschlägel wrote: Thanks Matthias, are you looking for setReplaceMethod? So far the package I m writing has avoided using anything from S4 and the implications of touching S4 are not clear to me. The package aims on providing an alternative to

Re: [Rd] How to overload the assignment operator?

2007-11-13 Thread Prof Brian Ripley
On Tue, 13 Nov 2007, Jens Oehlschlägel wrote: Thanks Matthias, are you looking for setReplaceMethod? So far the package I m writing has avoided using anything from S4 and the implications of touching S4 are not clear to me. The package aims on providing an alternative to 'atomic' data

Re: [Rd] How to overload the assignment operator?

2007-11-13 Thread Gabor Grothendieck
Check out the g.data package in case that's what you are looking for. It uses promises until the data is actually used. On Nov 13, 2007 9:19 AM, Jens Oehlschlägel [EMAIL PROTECTED] wrote: Thanks Matthias, are you looking for setReplaceMethod? So far the package I m writing has avoided

Re: [Rd] slots of type double

2007-11-13 Thread Prof Brian Ripley
On Tue, 13 Nov 2007, Simon Urbanek wrote: On Nov 13, 2007, at 3:36 AM, [EMAIL PROTECTED] wrote: Any idea why S4 doesn't allow slots of type double? Type (as in storage type and double is a storage type) has nothing to do with classes. You cannot create slots for types, only for classes.

Re: [Rd] How to overload the assignment operator?

2007-11-13 Thread Jens Oehlschlägel
Thank you Brian, setReplaceMethod() is just syntactic sugar for setting an S4 method on a replacement function (read the function definition to see so). You can set S3 replacement methods, and the S4 mechanism just piggy-backs on that. So I understand that setReplaceMethod will not help.

Re: [Rd] How to overload the assignment operator?

2007-11-13 Thread Jens Oehlschlägel
Thanks Simon, You cannot use S3 here, because you want to dispatch on the *second* argument. - - function(x, value)UseMethod(-, value) DOES dispatch on the second argument (see the dispatchsecond example below) Why don't you take the external pointer approach that many others take to

Re: [Rd] How to overload the assignment operator?

2007-11-13 Thread Jens Oehlschlägel
Thanks Simon, You cannot use S3 here, because you want to dispatch on the *second* argument. - - function(x, value)UseMethod(-, value) DOES dispatch on the second argument (see the dispatchsecond example below) Why don't you take the external pointer approach that many others take to

Re: [Rd] slots of type double

2007-11-13 Thread John Chambers
What's the proposal here? To eliminate double as a class? No objection from this corner. As I remember, it was put in early in the implementation of methods, when I was confused about what R intended in this area (well, I'm not totally unconfused even now). If this is the proposal, we could

Re: [Rd] slots of type double

2007-11-13 Thread Prof Brian Ripley
On Tue, 13 Nov 2007, John Chambers wrote: What's the proposal here? To eliminate double as a class? No objection Eliminate double and single. from this corner. As I remember, it was put in early in the implementation of methods, when I was confused about what R intended in this area

Re: [Rd] How to overload the assignment operator?

2007-11-13 Thread Prof Brian Ripley
On Tue, 13 Nov 2007, Jens Oehlschlägel wrote: Thank you Brian, setReplaceMethod() is just syntactic sugar for setting an S4 method on a replacement function (read the function definition to see so). You can set S3 replacement methods, and the S4 mechanism just piggy-backs on that. So I

Re: [Rd] R 2.6.0 make check fails on SGI origin 350 and

2007-11-13 Thread kamil Marcinkowski
Hello list Thank you for your help with the d-p-q-r-tests on Irix. After patching d-p-q-r-tests.R, and d-p-q-r-tests.Rout.save file to reflect the change, d-p-q-r tests succeed but make check still fails: comparing 'complex.Rout' to './complex.Rout.save' ...188c188 [1] 0+0i --- [1]

Re: [Rd] R 2.6.0 make check fails on SGI origin 350 and

2007-11-13 Thread Prof Brian Ripley
The perl-related warnings have gone in R-devel: we now take the view that since we need perl to make the test suite, perl = 5.8.0 is compulsory. (5.6.1 is now over 7 years' old, and 5.8.0 is more than 5.) The make check failure is in reg-tests-1.R and so will show up in reg-tests-1.Rout.fail.

Re: [Rd] R 2.6.0 make check fails on SGI origin 350 and

2007-11-13 Thread kamil Marcinkowski
Hello List, Prof Brian Ripley How would the inefficiencies in IEC60559 arithmetic handling affect a user, Slow computations or compromised data and calculations? Here are the last 50 lines of the reg-tests-1.Rout.fail file. [EMAIL PROTECTED]:70# tail -50 reg-tests-1.Rout.fail ## first two

Re: [Rd] R 2.6.0 make check fails on SGI origin 350 and

2007-11-13 Thread Prof Brian Ripley
On Tue, 13 Nov 2007, kamil Marcinkowski wrote: Hello List, Prof Brian Ripley How would the inefficiencies in IEC60559 arithmetic handling affect a user, Slow computations or compromised data and calculations? Just a loss of accuracy. There have been systems in which using extreme values