emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why (substring "abc" 0 4) does not return "abc" instead of an error?


From: Pascal J. Bourguignon
Subject: Re: Why (substring "abc" 0 4) does not return "abc" instead of an error?
Date: Mon, 16 Jul 2012 22:19:54 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux)

Bastien <address@hidden> writes:

> Stefan Monnier <address@hidden> writes:
>
>> We have general functionality when you want to ignore some errors, such
>> as condition-case.
>
> Also, I'm fine with
>
>   (substring "abc" -1 1)
>     => #ERROR
>
> so using ̀€condition-case' would not help me distinguish
> between the case above and (substring "abc" 0 4), which
> is what I want.
>
> I see the benefit of having 
>
>   (substring "abc" 0 4)
>     => "abc"
>
> in terms of simplifying Elisp writing -- and I still fail
> to see the harm (but maybe Pascal will tell me where he has
> been bitten by this.)

There would have been no harm if the language/library had been designed
that way.  It's arbitrary.  But since it has been designed the other
way, there would be harm if that changed.  There are a ton of code that
expects the original behavior.

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
A bad day in () is better than a good day in {}.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]