[Issue 3037] Off-by-one error in Stride.length

2009-08-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3037





--- Comment #2 from Andrei Alexandrescu and...@metalanguage.com  2009-08-27 
23:38:34 PDT ---
(In reply to comment #1)
 I fixed length like this:
 
 return (_input.length - 1) / _n + 1;
 
 Thanks!

In fact this doesn't work for _input.length == 0. So I rewrote it as:

return (_input.length + _n - 1) / _n

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


[Issue 3074] std.conv.to!(string)(int.min)

2009-08-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3074


Andrei Alexandrescu and...@metalanguage.com changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED




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


[Issue 3132] std.string.split should be templated on mutable/const/immutable

2009-08-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3132


Andrei Alexandrescu and...@metalanguage.com changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED




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


[Issue 3148] syntax error using invariant

2009-08-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3148


Andrei Alexandrescu and...@metalanguage.com changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED




--- Comment #1 from Andrei Alexandrescu and...@metalanguage.com  2009-08-27 
23:48:00 PDT ---
Thanks!

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


[Issue 3184] std.algorithm.until should work like find

2009-08-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3184


Andrei Alexandrescu and...@metalanguage.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED




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


[Issue 2987] D2 phobos BigInt opMul doesn't work correctly

2009-08-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2987


Don clugd...@yahoo.com.au changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 CC||clugd...@yahoo.com.au
 Resolution||FIXED




--- Comment #3 from Don clugd...@yahoo.com.au  2009-08-28 05:47:53 PDT ---
Thanks!
Actually both cases of updateShr should probably be updateUShr, although AFAICT
the result of the second one is never actually used, so it's a bit irrelevant.
Fixed in svn 1251.

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


[Issue 3189] `std.conv.to` : check for a custom `to` method in classes/structs

2009-08-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3189


Andrei Alexandrescu and...@metalanguage.com changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED




--- Comment #1 from Andrei Alexandrescu and...@metalanguage.com  2009-08-28 
08:28:09 PDT ---
Ok. I implemented this:

/**
Object-_to-non-object conversions look for a method to of the source
object.

Example:

class Date
{
T to(T)() if(is(T == long))
{
return timestamp;
}
...
}

unittest
{
auto d = new Date;
auto ts = to!long(d); // same as d.to!long()
}

 */
T to(T, S)(S value) if (is(S : Object)  !is(T : Object)  !isSomeString!T
 is(typeof(S.init.to!(T)()) : T))
{
return value.to!T();
}

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


[Issue 3195] `std.conv` pureness

2009-08-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3195


Andrei Alexandrescu and...@metalanguage.com changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||LATER




--- Comment #1 from Andrei Alexandrescu and...@metalanguage.com  2009-08-28 
08:34:52 PDT ---
They should, but many are not automatically checkable. For example, the
array-to-array conversion writes to a local temporary and then returns it.
Technically that is pure, but the compiler cannot prove that as of this time. I
will close this for now.

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


[Issue 3199] sort(chain(...)) doesn't work in some cases

2009-08-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3199


Andrei Alexandrescu and...@metalanguage.com changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED




--- Comment #2 from Andrei Alexandrescu and...@metalanguage.com  2009-08-28 
09:10:41 PDT ---
The first example creates three empty slices a, b, and c. Then abc is defined
as a slice of slices initialized with those empty slices. Subsequently abc is
filled but the initial slices a, b, and c remain empty. Therefore sort(chain(a,
b, c)) sorts an empty range so it is ineffectual.

The second example (after fixing) works indeed correctly because abc does not
undergo modifications independently from a, b, and c.

The third example is subtle. Assigning to the length of a slice, e.g.

t,length = uniform(8, 17);

may or may not spawn a new allocation (and therefore a divergence of what abc
holds versus what a, b, and c hold individually). Therefore, the behavior will
be erratic depending on what the random number generator yields.

Assigning to length in slices has always had that danger. We have recently
decided to prevent assignable length and defining a separate array type that
has modifiable length.

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


[Issue 2979] Xml tags with only attributes return as without attributes ElementParser.parse

2009-08-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2979


Andrei Alexandrescu and...@metalanguage.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||and...@metalanguage.com
 Resolution||FIXED




--- Comment #6 from Andrei Alexandrescu and...@metalanguage.com  2009-08-28 
09:17:31 PDT ---
I have integrated hed010gy's first (small) fix but nothing else. We need to
rewrite xml, so fixing it thoroughly first would be a bad investment.

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


[Issue 3218] Performance of std.xml.encode must be improved

2009-08-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3218


Andrei Alexandrescu and...@metalanguage.com changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED




--- Comment #1 from Andrei Alexandrescu and...@metalanguage.com  2009-08-28 
09:54:16 PDT ---
I changed encode (which was indeed horrendous) to this:

S encode(S)(S s, S buffer = null)
{
string r;
size_t lastI;
if (buffer) buffer.length = 0;
auto result = Appender!(string)(buffer);

foreach (i, c; s)
{
switch (c)
{
case '':  r = amp;; break;
case '':  r = quot;; break;
case '\'': r = apos;; break;
case '':  r = lt;; break;
case '':  r = gt;; break;
default: continue;
}
// Replace with r
result.put(s[lastI .. i]);
result.put(r);
lastI = i + 1;
}

if (!result.data) return s;
result.put(s[lastI .. $]);
return result.data;
}

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


[Issue 3219] Inaccurate std.conv.to!(numeric)(numeric) error messages

2009-08-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3219


Andrei Alexandrescu and...@metalanguage.com changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED




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


[Issue 3225] std.string function name casing

2009-08-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3225


Andrei Alexandrescu and...@metalanguage.com changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||REMIND




--- Comment #2 from Andrei Alexandrescu and...@metalanguage.com  2009-08-28 
10:51:52 PDT ---
This makes sense but the names as chosen reflect existing Python and Ruby APIs.
I'm not sure how to proceed about this. Thoughts?

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


[Issue 3269] New: pure functions silently become nothrow

2009-08-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3269

   Summary: pure functions silently become nothrow
   Product: D
   Version: unspecified
  Platform: Other
OS/Version: Linux
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: and...@metalanguage.com


class A
{
pure static void raise(string s)
{
throw new Exception(s);
}
}

void main()
{
A.raise(a);
}

This code compiles and runs without an error!

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


[Issue 3242] splitter does not handle input range made of a unique separator correctly

2009-08-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3242


Andrei Alexandrescu and...@metalanguage.com changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED




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


[Issue 3245] Easy bug fix available for disabled unit test code in std.encoding

2009-08-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3245


Andrei Alexandrescu and...@metalanguage.com changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED




--- Comment #2 from Andrei Alexandrescu and...@metalanguage.com  2009-08-28 
12:43:36 PDT ---
Thanks for the precise instructions.

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


[Issue 3249] sort and setIntersection on array of struct or class

2009-08-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3249


Andrei Alexandrescu and...@metalanguage.com changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED




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