Re: Smoking out C extension mistakes

P> You could use:
P> if(foo == Qnil)
P> instead of using the NIL_P macro.

#define NIL_P(v) ((VALUE)(v) == Qnil)

:slight_smile:

Guy Decoux

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

  • Dan

β€œB” == Berger, Daniel [email protected] 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 :slight_smile:

Guy Decoux

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs