[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: Smoking out C extension mistakes

Berger, Daniel

1/11/2006 4:09:00 PM



> -----Original Message-----
> From: ts [mailto:decoux@moulon.inra.fr]
> Sent: Tuesday, January 10, 2006 10:10 AM
> To: ruby-talk ML
> Cc: ruby-talk@ruby-lang.org
> Subject: Re: Smoking out C extension mistakes
>
>
> >>>>> "P" == Paul Brannan <pbrannan@atdesk.com> writes:
>
> P> You could use:
> P> if(foo == Qnil)
> P> instead of using the NIL_P macro.
>
> #define NIL_P(v) ((VALUE)(v) == Qnil)
>
> :-)
>
>
> Guy Decoux

So, is there a way to catch my mistake or not Guy?

- Dan


1 Answer

ts

1/11/2006 4:22:00 PM

0

>>>>> "B" == Berger, Daniel <Daniel.Berger@qwest.com> writes:

B> So, is there a way to catch my mistake or not Guy?

You can't have a problem with NIL_P(), it just use ==

But you can have problems with other macros, like

RSTRING(str)

str must be a valid struct RString, otherwise just expect that ruby
crash when it use the result :-)



Guy Decoux