[Issue 6986] SortedRange[x..$] fails with unidentified __dollar

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Nov 21 22:58:11 PST 2011


http://d.puremagic.com/issues/show_bug.cgi?id=6986


Jonathan M Davis <jmdavisProg at gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jmdavisProg at gmx.com
           Platform|x86_64                      |All
         OS/Version|Linux                       |All
           Severity|normal                      |enhancement


--- Comment #1 from Jonathan M Davis <jmdavisProg at gmx.com> 2011-11-21 22:57:17 PST ---
Technically, this is an enhancement request, not a bug - though it's certainly
a very desirable enhancement request. assumeSorted returns a SortedRange struct
which wraps the range which was passed to it. SortedRange does not define
opDollar, and at present, IIRC, opDollar hasn't been working correctly. So,
it's not possible for SortedRange to define opDollar, and there's no way that
your example is going to work. However, it looks like there was a commit made
to dmd about an hour ago which relates to opDollar (
https://github.com/D-Programming-Language/dmd/commit/aba0f773416e1d45d227159cb22ad0e26bb980c0
). So, it may now be possible to implement this.

But the short answer for why this doesn't work is that $ doesn't yet work for
anything other than built-in arrays, and assumeSorted doesn't return an array,
even if you pass it one (and it would defeat the purpose of assumeSort if it
did return an array).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list