Thread overview | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
August 20, 2004 DMD 0.99 release | ||||
---|---|---|---|---|
| ||||
Lots more bug fixes. Added special 'length' inside array [ ]'s. http://www.digitalmars.com/d/changelog.html |
August 20, 2004 Re: DMD 0.99 release | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | In article <cg3n60$2oap$1@digitaldaemon.com>, Walter says... > >Added special 'length' inside array [ ]'s. > meaning ? ... (example please) |
August 20, 2004 Re: DMD 0.99 release | ||||
---|---|---|---|---|
| ||||
Posted in reply to kinghajj | "kinghajj" <kinghajj_member@pathlink.com> escribió en el mensaje news:cg3oju$2p20$1@digitaldaemon.com | In article <cg3n60$2oap$1@digitaldaemon.com>, Walter says... || || Added special 'length' inside array [ ]'s. || | | meaning ? ... (example please) Look for "Array Length" in arrays.html: "Within the [ ] of a static or a dynamic array, the variable length is implicitly declared and set to the length of the array." ----------------------- Carlos Santander Bernal |
August 20, 2004 Re: DMD 0.99 release | ||||
---|---|---|---|---|
| ||||
Posted in reply to kinghajj | On Fri, 20 Aug 2004 02:45:18 +0000 (UTC), kinghajj wrote: > In article <cg3n60$2oap$1@digitaldaemon.com>, Walter says... >> >>Added special 'length' inside array [ ]'s. >> > > meaning ? ... (example please) char[] myarray = "abcdefghij"; writef(myarray[length-3 .. length ] output ==> "hij" -- Derek Melbourne, Australia 20/Aug/04 12:47:50 PM |
August 20, 2004 Re: DMD 0.99 release | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | Walter wrote:
> Lots more bug fixes. Added special 'length' inside array [ ]'s.
>
> http://www.digitalmars.com/d/changelog.html
I don't suppose there's any way to get that sugar for things that implement opIndex, opSlice, etc. Or that that work already? I'm thinking that if x is an instance of class Foo and Foo defined opIndex and length() then x[length-1] is the same as x.opIndex(x.length-1).
|
August 20, 2004 Re: DMD 0.99 release | ||||
---|---|---|---|---|
| ||||
Posted in reply to Derek Parnell | In article <cg3or0$2p3k$1@digitaldaemon.com>, Derek Parnell says... > >On Fri, 20 Aug 2004 02:45:18 +0000 (UTC), kinghajj wrote: > >> In article <cg3n60$2oap$1@digitaldaemon.com>, Walter says... >>> >>>Added special 'length' inside array [ ]'s. >>> >> >> meaning ? ... (example please) > >char[] myarray = "abcdefghij"; > >writef(myarray[length-3 .. length ] > >output ==> "hij" > >-- >Derek >Melbourne, Australia >20/Aug/04 12:47:50 PM Oh, ok, that's cool! |
August 20, 2004 Re: DMD 0.99 release | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ben Hinkle | "Ben Hinkle" <bhinkle4@juno.com> wrote in message news:cg3oug$2ond$1@digitaldaemon.com... > Walter wrote: > > > Lots more bug fixes. Added special 'length' inside array [ ]'s. > > > > http://www.digitalmars.com/d/changelog.html > > I don't suppose there's any way to get that sugar for things that implement > opIndex, opSlice, etc. Or that that work already? I'm thinking that if x is > an instance of class Foo and Foo defined opIndex and length() then > x[length-1] is the same as x.opIndex(x.length-1). That does need to be done. I was thinking that an implicit 'with' statement could happen, and then all the members of the class instance would be usable. |
August 20, 2004 Re: DMD 0.99 release | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | > Added special 'length' inside array [ ]'s.
>
I think it's pretty cool, but might cause logic bugs. I'm just glad I've been lazy in naming my variables len instead of length. Perhaps it should be illegal to name something length, and just allow classes/structs/unions to have an opLength() ? It would also be helpful for people porting from another language. length is a pretty popular name.
|
August 20, 2004 Re: DMD 0.99 release | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | >Added special 'length' inside array [ ]'s.
Excellent. I really can't imagine this causing more than a very few faltering steps for each developer, and a considerable, albiet sugary, syntactic simplification.
Now, how do I go about raising the issue of D providing thread-agnostic implicit reg-exp, a la Perl and Ruby?
(I'm not kidding!)
|
August 20, 2004 Re: DMD 0.99 release | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ben Hinkle | "Ben Hinkle" <bhinkle4@juno.com> wrote in message news:cg3oug$2ond$1@digitaldaemon.com... > Walter wrote: > > > Lots more bug fixes. Added special 'length' inside array [ ]'s. > > > > http://www.digitalmars.com/d/changelog.html > > I don't suppose there's any way to get that sugar for things that implement opIndex, opSlice, etc. Or that that work already? I'm thinking that if x is an instance of class Foo and Foo defined opIndex and length() then x[length-1] is the same as x.opIndex(x.length-1). I never considered that that was _not_ the case. Please say that is indeed how it works, big-W. If not, count this a loud vote for that consistency. :) |
Copyright © 1999-2021 by the D Language Foundation