From: Luis Lavena Date: 2008-04-05T02:23:49+09:00 Subject: Re: RUBY_IMPLEMENTATION On Fri, Apr 4, 2008 at 2:15 PM, Chris Cummer wrote: > On 4-Apr-08, at 3:05 AM, Eleanor McHugh wrote: > > > > Well RUNTIME makes more sense to me than ENGINE, but it still suggests > that code should be written to suit a particular runtime when what coders > really want to know is what FEATURES are available on the platform. > > > > I therefore favour a constant RUBY_FEATURES > > > > This is the first time I've seen this particular suggestion put forth and > at the risk of being heretical, what about both? > > I see merit in Alex's use-case (though I'm not fond of the over-loading of > "require"; perhaps feature_exists?() instead?): > > > > begin > > feature_exists?( Features.threading.native ) > > > > setup_code_for_native_threads() > > FeatureSet::Threading::Native # => true > > rescue LoadError > > feature_exists?( Features.threading.green ) # or let this be a default > > > > setup_code_for_green_threads() > > FeatureSet::Threading::Green # => true > > FeatureSet::Threading::Native # => false > > end > > > > yet at the same time it feels right to be able to "know" as much as > possible about the actual environment in which the code is running. Of all > the proposed suggestions I find RUNTIME to be the most palatable. > Mmm, why don't use the current available keywords? if defined? FeatureSet::Threading::Native # ... else # ... end Now we are under that road, what about the dread fork() on Windows? NotImplementedError: fork() function is unimplemented on this machine fork { ... } if defined? FeatureSet::Process:Fork -- Luis Lavena Multimedia systems - Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so. Douglas Adams