This is the mail archive of the
gsl-discuss@sourceware.cygnus.com
mailing list for the GSL project.
Re: complex number API
Gerard> I would like to add another form as well, of the suggested
Gerard> 'return z' type, since that looks like it would be nicer
Gerard> to type. I'm thinking something contructor-like
Gerard> GSL_COMPLEX(x,y)
Gerard> which could be used like
Gerard> gsl_complex foo_z = GSL_COMPLEX(x,y);
Gerard> Trivial as an inline function, but is it possible to do as
Gerard> a macro too?
I would also like such a function, but I can't figure out how to do it
with a macro. James's cute trick of using the do { stuff } while(0)
won't work if you have to return a value. You do need a block to
allocate a variable for the result, but I don't know how to return
something.
James, do you have any cute tricks?
Maybe we could go with an autoconf/ifdef-ed use of GCC's inline
functions across module boundaries, but they are a bit annoying.