[Rd] S4 group generic Complex not working (PR#4483)

saikat at stat.wisc.edu saikat at stat.wisc.edu
Thu Oct 9 18:18:16 MEST 2003


The Complex group generic for S4 methods is not working:

 > setClass('foo', representation(z='complex'))
[1] "foo"
 > setMethod('Complex', 'foo', function(z) callGeneric(z at z))
[1] "Complex"
 > Arg(new('foo', z=1+0i))
Error in Arg(new("foo", z = 1 + (0+0i))) :
         non-numeric argument to function
 >

The fix is to add

     if (DispatchGroup("Complex", call, op, args, env, &x))
	return x;

near the beginning of do_cmathfuns in complex.c.

--please do not edit the information below--

Version:
  platform = i686-pc-linux-gnu
  arch = i686
  os = linux-gnu
  system = i686, linux-gnu
  status =
  major = 1
  minor = 8.0
  year = 2003
  month = 10
  day = 08
  language = R

Search Path:
  .GlobalEnv, package:methods, package:ctest, package:mva, 
package:modreg, package:nls, package:ts, Autoloads, package:base



More information about the R-devel mailing list