[ruby-core:72838] Re: [Ruby trunk - Bug #11973] IO#advise should raise NotImplementedError on platforms that do not support that call

From: KOSAKI Motohiro <kosaki.motohiro@...>
Date: 2016-01-13 08:25:30 UTC
List: ruby-core #72838
On Tue, Jan 12, 2016 at 7:06 PM, Eric Wong <normalperson@yhbt.net> wrote:
> git@chuckremes.com wrote:
>> 3. If the platform DOES NOT SUPPORT posix_fadvise, then it should
>> raise NotImplementedError in all cases.
>>
>> I hope that is more clear. These rules should make IO#advise MORE CONSISTENT.
>
> I disagree.  File#link is not analogous, nor are any other methods in
> Ruby.  Unlike existing methods, IO#advise is a hint, not an imperative
> command.
>
> Things are supposed to go horribly wrong if errors to imperative
> commands are not reported properly.  However, advice should be safely
> ignorable without catastrophe.
>
> Furthermore, if (and a big "if") we were to start raising
> NotImplementedError, it would break existing users who (perhaps
> unknowingly) rely on that behavior.

Currently, I stand aside Eric.
Chuck, do you have any specific and useful use cases of your proposal?
That is extremely important for introducing an incompatibility.

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next