On Friday, March 02, 2012 20:41:35 Ali Çehreli wrote:
On 03/02/2012 06:30 PM, Piotr Szturmaj wrote:
Hello,
For this code:
auto c = testc;
auto w = testw;
auto d = testd;
pragma(msg, typeof(c.front));
pragma(msg, typeof(w.front));
pragma(msg, typeof(d.front));
On 2012-03-03 03:30, Piotr Szturmaj wrote:
Hello,
For this code:
auto c = testc;
auto w = testw;
auto d = testd;
pragma(msg, typeof(c.front));
pragma(msg, typeof(w.front));
pragma(msg, typeof(d.front));
compiler prints:
dchar
dchar
immutable(dchar)
I thought all these would be either dchar
Jonathan M Davis wrote:
On Friday, March 02, 2012 20:41:35 Ali Çehreli wrote:
On 03/02/2012 06:30 PM, Piotr Szturmaj wrote:
Hello,
For this code:
auto c = testc;
auto w = testw;
auto d = testd;
pragma(msg, typeof(c.front));
pragma(msg, typeof(w.front));
On 03/03/2012 04:36 AM, Jacob Carlborg wrote:
On 2012-03-03 03:30, Piotr Szturmaj wrote:
Hello,
For this code:
auto c = testc;
auto w = testw;
auto d = testd;
pragma(msg, typeof(c.front));
pragma(msg, typeof(w.front));
pragma(msg, typeof(d.front));
compiler prints:
dchar
dchar
On 03/03/2012 05:57 AM, Piotr Szturmaj wrote:
Consider a custom range of
char:
struct CharRange
{
@property bool empty();
@property char front();
void popFront();
}
typeof(CharRange.front) and ElementType!CharRange both return _char_
Yes, and I would expect both to the same type.
On 03/03/2012 09:40 AM, Jonathan M Davis wrote:
... but operating on
code points is _far_ more correct than operating on code units. It's also more
efficient.
[snip.]
No, it is less efficient.
On 2012-03-03 15:10, Ali Çehreli wrote:
On 03/03/2012 04:36 AM, Jacob Carlborg wrote:
On 2012-03-03 03:30, Piotr Szturmaj wrote:
Hello,
For this code:
auto c = testc;
auto w = testw;
auto d = testd;
pragma(msg, typeof(c.front));
pragma(msg, typeof(w.front));
pragma(msg, typeof(d.front));
On Saturday, March 03, 2012 18:38:44 Timon Gehr wrote:
On 03/03/2012 09:40 AM, Jonathan M Davis wrote:
... but operating on
code points is _far_ more correct than operating on code units. It's also
more efficient.
[snip.]
No, it is less efficient.
Operating on code points is more
On Saturday, March 03, 2012 14:57:59 Piotr Szturmaj wrote:
This discrepancy pushes the range writer to handle special string cases.
Yes it does. And there's _no_ way around that if you want to handle unicode
both correctly and efficiently. To handle it correctly, you must operate on
code
On 03/03/2012 08:46 PM, Jonathan M Davis wrote:
On Saturday, March 03, 2012 18:38:44 Timon Gehr wrote:
On 03/03/2012 09:40 AM, Jonathan M Davis wrote:
... but operating on
code points is _far_ more correct than operating on code units. It's also
more efficient.
[snip.]
No, it is less
On Sat, Mar 03, 2012 at 12:42:53PM -0800, Jonathan M Davis wrote:
[...]
The current solution encourages correct usage (or at least usage which
is closer to correct, since it still isn't at the grapheme level)
without disallowing more optimized code.
[...]
Speaking of graphemes, is anyone
On Sat, Mar 03, 2012 at 11:53:41AM -0800, Jonathan M Davis wrote:
[...]
If you want to iterate by char, then use foreach or use a wrapper
range (or cast to ubyte[] and operate on that).
Or use:
string str = ...;
for (size_t i=0; i str.length; i++) {
/* do
On 03/03/2012 01:42 PM, H. S. Teoh wrote:
On Sat, Mar 03, 2012 at 12:42:53PM -0800, Jonathan M Davis wrote:
[...]
The current solution encourages correct usage (or at least usage which
is closer to correct, since it still isn't at the grapheme level)
without disallowing more optimized code.
On Saturday, March 03, 2012 13:46:16 Ali Çehreli wrote:
On 03/03/2012 01:42 PM, H. S. Teoh wrote:
On Sat, Mar 03, 2012 at 12:42:53PM -0800, Jonathan M Davis wrote:
[...]
The current solution encourages correct usage (or at least usage which
is closer to correct, since it still isn't at
On Saturday, March 03, 2012 13:46:16 Ali Çehreli wrote:
On 03/03/2012 01:42 PM, H. S. Teoh wrote:
On Sat, Mar 03, 2012 at 12:42:53PM -0800, Jonathan M Davis wrote:
[...]
The current solution encourages correct usage (or at least usage which
is closer to correct, since it still isn't at
Hello,
For this code:
auto c = testc;
auto w = testw;
auto d = testd;
pragma(msg, typeof(c.front));
pragma(msg, typeof(w.front));
pragma(msg, typeof(d.front));
compiler prints:
dchar
dchar
immutable(dchar)
IMO it should print this:
immutable(char)
immutable(wchar)
On 03/02/2012 06:30 PM, Piotr Szturmaj wrote:
Hello,
For this code:
auto c = testc;
auto w = testw;
auto d = testd;
pragma(msg, typeof(c.front));
pragma(msg, typeof(w.front));
pragma(msg, typeof(d.front));
compiler prints:
dchar
dchar
immutable(dchar)
IMO it should print this:
17 matches
Mail list logo