On 08.06.2017 14:06, Steven Schveighoffer wrote:
The issue here is that arrays are special. Arrays allow foreach(i, v;
arr) and foreach(v; arr). Ranges in general do not. So there is no way
to forward this capability via the range interface. Not only that, but
foreach(i, v; arr) is much diffe
On 6/7/17 9:57 PM, Andrew Edwards wrote:
Ranges may be finite or infinite but, while the destination may be
unreachable, we can definitely tell how far we've traveled. So why
doesn't this work?
import std.traits;
import std.range;
void main()
{
string[string] aa;
// what others have re
On Thu, 2017-06-08 at 00:23 -0700, Jonathan M Davis via Digitalmars-d-
learn wrote:
> […]
>
> release is a member of SortedRange. You don't have to import it
> separately.
> You have it automatically by virtue of the fact that sort returns a
> SortedRange. And unlike calling array, it doesn't copy
On Thursday, 8 June 2017 at 07:23:27 UTC, Jonathan M Davis wrote:
release is a member of SortedRange. You don't have to import it
separately. You have it automatically by virtue of the fact
that sort returns a SortedRange. And unlike calling array, it
doesn't copy the entire range or allocate
On Wed, 2017-06-07 at 19:39 -0700, Jonathan M Davis via Digitalmars-d-
learn wrote:
>
[…]
> Even better. I hadn't realized that such a function had been added.
>
Another import from Python. :-)
--
Russel.
=
Dr Russel W
On 08.06.2017 03:57, Andrew Edwards wrote:
Ranges may be finite or infinite but, while the destination may be
unreachable, we can definitely tell how far we've traveled. So why
doesn't this work?
import std.traits;
import std.range;
void main()
{
string[string] aa;
// what others h
On Thursday, 8 June 2017 at 01:57:47 UTC, Andrew Edwards wrote:
Ranges may be finite or infinite but, while the destination may
be unreachable, we can definitely tell how far we've traveled.
So why doesn't this work?
import std.traits;
import std.range;
void main()
{
string[string] aa;
On Thursday, June 08, 2017 04:07:22 Andrew Edwards via Digitalmars-d-learn
wrote:
> On Thursday, 8 June 2017 at 03:40:08 UTC, Jonathan M Davis wrote:
> > On Thursday, June 08, 2017 03:15:11 Andrew Edwards via
> >
> > Digitalmars-d-learn wrote:
> >> I completely understand the differences between r
On Thursday, 8 June 2017 at 04:15:12 UTC, Stanislav Blinov wrote:
Earns you nothing? How about not performing an allocation and
copy?
Seen through the eyes of a complete beginner, this means
absolutely nothing. Those are the eyes I am using as I'm reading
a book and simply following the ins
On Thursday, 8 June 2017 at 04:07:22 UTC, Andrew Edwards wrote:
On Thursday, 8 June 2017 at 03:40:08 UTC, Jonathan M Davis
sort() returns a SortedRange so that other algorithms can
know...
Yes, I understand that. Again, using "std.range: release" earns
me nothing more than I already get fro
On Thursday, 8 June 2017 at 03:40:08 UTC, Jonathan M Davis wrote:
On Thursday, June 08, 2017 03:15:11 Andrew Edwards via
Digitalmars-d-learn wrote:
I completely understand the differences between ranges and
arrays... the thing is, I wasn't working with ranges but
arrays instead. If sort under
On Thursday, June 08, 2017 03:15:11 Andrew Edwards via Digitalmars-d-learn
wrote:
> On Thursday, 8 June 2017 at 02:31:43 UTC, Stanislav Blinov wrote:
> > On Thursday, 8 June 2017 at 02:25:17 UTC, Jonathan M Davis
> > wrote:
> >
> > Oh I see, the was error related to iteration, not sorting.
> >
> >
On Thursday, 8 June 2017 at 02:19:15 UTC, Andrew Edwards wrote:
Pretty funny. But seriously, this is something that should just
work. There is now to layers of indirection to achieve what I
used to do quite naturally in the language.
Hmmm while working on my recent sudoku solver using pointer
On Thursday, 8 June 2017 at 02:31:43 UTC, Stanislav Blinov wrote:
On Thursday, 8 June 2017 at 02:25:17 UTC, Jonathan M Davis
wrote:
Oh I see, the was error related to iteration, not sorting.
Ranges do not support iterating with an index. The workaround
if you want to have an index with ranges
On Thursday, 8 June 2017 at 01:57:47 UTC, Andrew Edwards wrote:
Ranges may be finite or infinite but, while the destination may
be unreachable, we can definitely tell how far we've traveled.
So why doesn't this work?
...
If I hand you a chihuahua for grooming, why am I getting back a
pit bull?
On Thursday, June 08, 2017 02:31:43 Stanislav Blinov via Digitalmars-d-learn
wrote:
> On Thursday, 8 June 2017 at 02:25:17 UTC, Jonathan M Davis wrote:
>
> Oh I see, the was error related to iteration, not sorting.
>
> > Ranges do not support iterating with an index. The workaround
> > if you want
On Thursday, 8 June 2017 at 02:25:17 UTC, Jonathan M Davis wrote:
Oh I see, the was error related to iteration, not sorting.
Ranges do not support iterating with an index. The workaround
if you want to have an index with ranges and foreach, then you
should use lockstep:
http://dlang.org/phob
On Thursday, June 08, 2017 01:57:47 Andrew Edwards via Digitalmars-d-learn
wrote:
> Ranges may be finite or infinite but, while the destination may
> be unreachable, we can definitely tell how far we've traveled. So
> why doesn't this work?
>
> import std.traits;
> import std.range;
>
> void main(
On Thursday, 8 June 2017 at 02:21:03 UTC, Stanislav Blinov wrote:
aa.keys.sort() should just work as is: aa.keys returns a
string[], and that's a random access range that can be sorted.
What exactly is the error?
It does not ... I provided the code and related error message.
See the line ri
On Thursday, 8 June 2017 at 01:57:47 UTC, Andrew Edwards wrote:
Ranges may be finite or infinite but, while the destination may
be unreachable, we can definitely tell how far we've traveled.
So why doesn't this work?
import std.traits;
import std.range;
void main()
{
string[string] aa;
On Thursday, 8 June 2017 at 02:19:15 UTC, Andrew Edwards wrote:
Pretty funny. But seriously, this is something that just work.
There is now to layers of indirection to achieve what I used to
do quite naturally in the language.
*should just work
On Thursday, 8 June 2017 at 02:07:07 UTC, Mike B Johnson wrote:
On Thursday, 8 June 2017 at 01:57:47 UTC, Andrew Edwards wrote:
If I hand you a chihuahua for grooming, why am I getting back
a pit bull? I simply want a groomed chihuahua. Why do I need
to consult a wizard to get back a groomed ch
On Thursday, 8 June 2017 at 01:57:47 UTC, Andrew Edwards wrote:
If I hand you a chihuahua for grooming, why am I getting back a
pit bull? I simply want a groomed chihuahua. Why do I need to
consult a wizard to get back a groomed chihuahua?
Because is like a poodle and unless you get your hair
Ranges may be finite or infinite but, while the destination may
be unreachable, we can definitely tell how far we've traveled. So
why doesn't this work?
import std.traits;
import std.range;
void main()
{
string[string] aa;
// what others have referred to as
// standard sort works
24 matches
Mail list logo