www.digitalmars.com         C & C++   DMDScript  

D - array slicing

reply "Charles" <no email.com> writes:
This has probably already been mentioned , and I know D's not implementing
new features , but what about using negative numbers to indicate starting
from the end of the array

char [] x = "comma,";

char [] y = x[0 .. -1]; // y is 'comma'


No special charaters , no new keywords , no scoping rules ( is length still
a keyword in slicing ? ).

Thoughts ?

Charlie
Dec 16 2004
next sibling parent Benjamin Herr <ben 0x539.de> writes:
Charles wrote:
 using negative numbers to indicate starting from the end of the array

I think the issue is that this would require run time checks for the sign of the array index, which would be unneccessary in a lot of cases. If you require this feature, you might want to use a more sophisticated Array class anyway. -Ben
Dec 16 2004
prev sibling parent reply Stewart Gordon <smjg_1998 yahoo.com> writes:
Charles wrote:
 This has probably already been mentioned , and I know D's not implementing
 new features , but what about using negative numbers to indicate starting
 from the end of the array
 
 char [] x = "comma,";
 
 char [] y = x[0 .. -1]; // y is 'comma'

Been talked to death already, starting from D/24082 As has the fact that the 'group you're posting on is deprecated. Taking to digitalmars.D.... Stewart. -- My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit.
Dec 17 2004
parent reply "Lionello Lunesu" <lionello.lunesu crystalinter.remove.com> writes:
 Been talked to death already, starting from

You mean "it wasn't accepted before so fo'getaboutit!" ? Another reason we need some standard for arguing about suggestions. Everyone with a suggestion gets tired at some point and stops explaining / improving his exception. It's kind of silly to forget about some suggestion just because Walter hasn't had the time to reply/react/implement it. Are we (people interested in D) really satisfied if only bugs got fixed and D remained the way it is now? (I'm not) Lionello (Damn, I know only too well what happens if one person, me in this case, changes the tone of a conversation on a newsgroup. Should I rewrite my post? I didn't accuse anyone, so this post seems clean... to me...)
Dec 17 2004
next sibling parent reply "Ben Hinkle" <bhinkle mathworks.com> writes:
 Are we (people interested in D) really satisfied if only bugs got fixed

 D remained the way it is now?

i am
Dec 17 2004
parent reply Benjamin Herr <ben 0x539.de> writes:
Ben Hinkle wrote:
 Are we (people interested in D) really satisfied if
 only bugs got fixed and D remained the way it is now?

i am

I am not! *troll*
Dec 17 2004
parent reply "Ben Hinkle" <bhinkle mathworks.com> writes:
"Benjamin Herr" <ben 0x539.de> wrote in message
news:cpv0qd$2gju$1 digitaldaemon.com...
 Ben Hinkle wrote:
 Are we (people interested in D) really satisfied if
 only bugs got fixed and D remained the way it is now?

i am

I am not! *troll*

I'm confused. why the *troll*?
Dec 17 2004
next sibling parent reply "Lionello Lunesu" <lionello.lunesu crystalinter.remove.com> writes:
what's troll?? :-&

"Ben Hinkle" <bhinkle mathworks.com> wrote in message 
news:cpv19s$2hao$1 digitaldaemon.com...
 "Benjamin Herr" <ben 0x539.de> wrote in message
 news:cpv0qd$2gju$1 digitaldaemon.com...
 Ben Hinkle wrote:
 Are we (people interested in D) really satisfied if
 only bugs got fixed and D remained the way it is now?

i am

I am not! *troll*

I'm confused. why the *troll*?

Dec 17 2004
parent "Ben Hinkle" <bhinkle mathworks.com> writes:
"Lionello Lunesu" <lionello.lunesu crystalinter.remove.com> wrote in message
news:cpv1pl$2hvc$1 digitaldaemon.com...
 what's troll?? :-&

see http://en.wikipedia.org/wiki/Internet_troll
Dec 17 2004
prev sibling parent reply Benjamin Herr <ben 0x539.de> writes:
Ben Hinkle wrote:
 "Benjamin Herr" <ben 0x539.de> wrote in message
 news:cpv0qd$2gju$1 digitaldaemon.com... 
Ben Hinkle wrote:

Are we (people interested in D) really satisfied if
only bugs got fixed and D remained the way it is now?

i am

I am not! *troll*

I'm confused. why the *troll*?

Because my post was not really contributive :(
Dec 17 2004
parent "Ben Hinkle" <bhinkle mathworks.com> writes:
"Benjamin Herr" <ben 0x539.de> wrote in message
news:cpvb30$2sao$1 digitaldaemon.com...
 Ben Hinkle wrote:
 "Benjamin Herr" <ben 0x539.de> wrote in message
 news:cpv0qd$2gju$1 digitaldaemon.com...
Ben Hinkle wrote:

Are we (people interested in D) really satisfied if
only bugs got fixed and D remained the way it is now?

i am

I am not! *troll*

I'm confused. why the *troll*?

Because my post was not really contributive :(

oh - don't worry about that. My wasn't very deep either. I was worried you were either calling me or the OP a troll, which was why I was confused.
Dec 17 2004
prev sibling parent Stewart Gordon <smjg_1998 yahoo.com> writes:
Lionello Lunesu wrote:
 Been talked to death already, starting from

You mean "it wasn't accepted before so fo'getaboutit!" ?

No. I mean that there has already been a discussion on this idea, and so the OP might as well look at what was said there, rather than just let the debate repeat itself with potentially no new content. Stewart. -- My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit.
Dec 17 2004