[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: .substring bug - indicies don't work as documented(?)
From: |
Werner LEMBERG |
Subject: |
Re: .substring bug - indicies don't work as documented(?) |
Date: |
Sun, 28 Oct 2001 14:12:33 +0100 (CET) |
> Languages seem to do it all kinds of ways.
>
> % python
> >>> s = 'abcdefg'
> >>> s[1]
> 'b'
> >>> s[1:1]
> ''
> >>> s[1:2]
> 'b'
> >>> s[0:2]
> 'ab'
> >>> s[-2]
> 'f'
> >>> s[-2:]
> 'fg'
Emacs Lisp's `substring' command behaves identically. I'm more and
more convinced that it is a good idea to make groff's .substring
request work similar.
While this is an incompatible change, it is an improvement IMHO. Any
objections?
Werner
Re: .substring bug - indicies don't work as documented(?), Werner LEMBERG, 2001/10/27