Forum: Ruby Re: Smoking out C extension mistakes

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
F3b7b8756d0c7f71cc7460cc33aefaee?d=identicon&s=25 Berger, Daniel (Guest)
on 2006-01-11 17:10
(Received via mailing list)
> 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
956f185be9eac1760a2a54e287c4c844?d=identicon&s=25 ts (Guest)
on 2006-01-11 17:24
(Received via mailing list)
>>>>> "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
This topic is locked and can not be replied to.