Closed kbrock closed 9 years ago
Um, but Object.const_defined?(:RUBY_ENGINE)
works as expected?
https://github.com/mruby/mruby/issues/1696#issuecomment-34826066
In the referenced ticket, it is recommended to use const_defined? over defined? rather than saying const_defined? does not work.
@cremno thanks. I was trying the non symbol form Object.const_defined?(RUBY_ENGINE)
This works for both mruby and mri 2.0.
Will reformat. this is great
I see. But now you've introduced a typo (RUBY_ENINE
).
Thanks @cremno
This looks good to me. Should it be Module.const_defined?(:RUBY_ENGINE)
though?
I prefer Object
since RUBY_ENGINE
(and global constants in general) is defined on it.
Hi,
mruby
does not providedefined?
and it looks like it won't mruby/mruby#1696As of Mar 21, 2015, mruby-dev does no supportconst_defined?
ordefined?
.How about usingEDIT: How about usingrescue
instead ofdefined?
to determineRUBY_ENGINE
.Object.const_defined?
to determineRUBY_ENGINE
Thanks --K