Re: [Swig-user] enum constants vs. functions returning an enum value

2006-10-18 Thread Chris Shoemaker
On Sat, Aug 19, 2006 at 06:57:00PM -0500, John Lenz wrote: > > Ok, I just committed it to CVS. I added the feature as "constasvar", > and it works on all constants (including enums). You can apply it > globally by adding > > %feature("constasvar", "1"); > > or by using -features constasvar on

Re: [Swig-user] enum constants vs. functions returning an enum value

2006-08-16 Thread Chris Shoemaker
On Wed, Aug 16, 2006 at 10:08:44PM -0500, John Lenz wrote: > On 08/16/06 20:19, Chris Shoemaker wrote: > > Assuming this behavior makes as much sense to other people as it does > > to me, I think the idea of using a static variable and a > > scm_c_define() is a good change. And we can wait for a f

Re: [Swig-user] enum constants vs. functions returning an enum value

2006-08-16 Thread Chris Shoemaker
On Wed, Aug 16, 2006 at 12:06:39AM -0500, John Lenz wrote: > On 08/15/06 23:14, Chris Shoemaker wrote: > > > > And I was wrong about that last part. G-wrap does it right from C. > > > > So, SWIG uses scm_c_define_gsubr() to convert the enum value to a > > _function_ returning the enum value. > >

Re: [Swig-user] enum constants vs. functions returning an enum value

2006-08-15 Thread Chris Shoemaker
On Mon, Aug 14, 2006 at 12:01:53PM -0400, Chris Shoemaker wrote: > On Mon, Aug 14, 2006 at 08:51:35AM -0400, Reed Hedges wrote: > > Chris Shoemaker wrote: > > > However, the wrapper for gncOwnerGetType() returns the enum value > > > immediately, not a thunk. E.g. "(gncOwnerGetType employee)" evalu

Re: [Swig-user] enum constants vs. functions returning an enum value

2006-08-14 Thread Chris Shoemaker
On Mon, Aug 14, 2006 at 08:51:35AM -0400, Reed Hedges wrote: > Chris Shoemaker wrote: > > However, the wrapper for gncOwnerGetType() returns the enum value > > immediately, not a thunk. E.g. "(gncOwnerGetType employee)" evaluates > > to 1. > > > > This means that the return value of the wrapper f

Re: [Swig-user] enum constants vs. functions returning an enum value

2006-08-14 Thread Reed Hedges
Chris Shoemaker wrote: > However, the wrapper for gncOwnerGetType() returns the enum value > immediately, not a thunk. E.g. "(gncOwnerGetType employee)" evaluates > to 1. > > This means that the return value of the wrapper for the function that > returns an enum value is not comparable to the enu