----- Original Message ----- 
From: "Shane Caraveo" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, November 01, 2004 1:41 PM
Subject: Re: [PHP-DEV] Re: Negative string offset support


--- snip --

> Having my python hat on...
>

> There also is this which is very useful for the reason that you do not
> have to calcuate length in your script (in the second two examples):
>
> a[:2] (grab the first two chars)
> a[2:] (everything after the first two chars)
> a[-2:] (grab the last two chars)
>
> For python, it's a great construct both for readability and performance.
>   PHP would only benefit from the ability to use this.  However, it
> should be of course, not be in a micro release.  It is also unlikely
> many people will use it since it would not be backwards compatible code.

imo, the reason this is so very useful in python is because you get to use
it with strings, arrays and dictionaries (tuples as well?). while getting it
for strings is better than nothing, having it work with everything would be
very sweet from a syntactic sugar/easy to read/more expressive standpoint.

realizing-that-i-might-just-have-killed-the-feature-request-by-asking-for-mo
re-stuff-ly,
paul

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to