17.02.2012 4:30, bearophile пишет:
After seeing this interesting thread:
http://stackoverflow.com/questions/9314534/why-does-changing-0-1f-to-0-slow-down-performance-by-10x
Do you know if there's a simple way to perform _MM_SET_FLUSH_ZERO_MODE in D?
According to Agner that operation is not need
On 16/02/12 17:36, Timon Gehr wrote:
On 02/16/2012 05:06 PM, Don Clugston wrote:
On 16/02/12 13:28, Stewart Gordon wrote:
On 16/02/2012 12:04, Don Clugston wrote:
On 15/02/12 22:24, H. S. Teoh wrote:
What's the original rationale for requiring that hex float literals
must
always have an expon
On 17/02/12 09:09, Mantis wrote:
17.02.2012 4:30, bearophile пишет:
After seeing this interesting thread:
http://stackoverflow.com/questions/9314534/why-does-changing-0-1f-to-0-slow-down-performance-by-10x
Do you know if there's a simple way to perform _MM_SET_FLUSH_ZERO_MODE
in D?
According
Hello everybody.
Once again I have a little question, this time about removing
items from an assoc array in a foreach.
Why does the following code:
http://pastebin.com/65P9WDNS
Result in this output:
http://pastebin.com/4FzEE1zi
It seems rather strange to me. I'd expect the foreach_reverse to
On Friday, February 17, 2012 11:00:36 Mars wrote:
> Hello everybody.
> Once again I have a little question, this time about removing
> items from an assoc array in a foreach.
>
> Why does the following code:
> http://pastebin.com/65P9WDNS
> Result in this output:
> http://pastebin.com/4FzEE1zi
>
On Friday, 17 February 2012 at 10:13:00 UTC, Jonathan M Davis
wrote:
I don't believe that removing elements from an AA while
iterating over it is safe.
- Jonathan M Davis
Well, no. But from my experience it's okay from bottom to top...
at least in other languages.
What would be the alternati
foreach_reverse isn't going to help you much since AA's do not save
the order of the keys. A quick workaround:
http://pastebin.com/KkECqwUU
Others probably know efficient ways to do this.
Usually in other languages iterators are safe.
Il giorno ven, 17/02/2012 alle 11.35 +0100, Mars ha scritto:
> On Friday, 17 February 2012 at 10:13:00 UTC, Jonathan M Davis
> wrote:
> > I don't believe that removing elements from an AA while
> > iterating over it is safe.
> >
> > - Jonathan M Da
On Wed, 15 Feb 2012 11:10:45 +0100, simendsjo wrote:
On 02/15/2012 09:33 AM, simendsjo wrote:
import std.array;
import std.stdio;
struct S
{
string txt;
void popFront()
{
txt.popFront();
}
@property dchar front()
{
return txt.front;
}
@property bool empty()
{
return txt.empty;
}
}
void ma
On Fri, 17 Feb 2012 12:51:11 +0100, simendsjo wrote:
On Wed, 15 Feb 2012 11:10:45 +0100, simendsjo
wrote:
On 02/15/2012 09:33 AM, simendsjo wrote:
import std.array;
import std.stdio;
struct S
{
string txt;
void popFront()
{
txt.popFront();
}
@property dchar front()
{
return txt.front;
Hi!
This doesn't work:
import std.stdio;
class Foo(T)
{
T t;
this(T val)
{
t = val;
}
}
void main()
{
auto o = new Foo(5);
}
__
kraybourne:
> Then it compiles. Is it possible to have this() figure out the type some
> way?
Usually people write a small global function helper.
> (Side note: What _does_ that error message mean? I don't get it.)
I think the meaning is: when a class template is not yet instantiated, it's no
The error message is saying that you are trying to use Foo as a type but
Foo is not a type, it is a template for a type.
On Feb 17, 2012 7:20 AM, "kraybourne" wrote:
> Hi!
>
> This doesn't work:
>
>import std.stdio;
>class Foo(T)
>{
>T t;
>t
On 2/17/12 1:32 PM, bearophile wrote:
kraybourne:
Then it compiles. Is it possible to have this() figure out the type some
way?
Usually people write a small global function helper.
Hm, so, something like this:
Foo!(T) newFoo(T)(T val)
{
return new Foo!(T)(v
On 2/17/12 1:51 PM, Kevin Cox wrote:
The error message is saying that you are trying to use Foo as a type but
Foo is not a type, it is a template for a type.
Ah, so module.Foo is really not a class, but a template? I think I get
it! Thanks!
(Is then module.Foo(int).Foo the actual class type
Yes. At least as the compiler would say. It's a little odd but I believe
that is how the D Nam mangling works. I personally just think of
Foo!(Class) as the type.
On Feb 17, 2012 8:05 AM, "kraybourne" wrote:
> On 2/17/12 1:51 PM, Kevin Cox wrote:
>
>> The error message is saying that you are t
AAs don't keep the key order, so when you delete something out of it,
what ever system iterates to the next pointer gets confused. Its
generally a bad idea to modify an array as you loop through it.
--
James Miller
On 02/17/2012 02:07 PM, Kevin Cox wrote:
Yes. At least as the compiler would say. It's a little odd but I
believe that is how the D Nam mangling works. I personally just think
of Foo!(Class) as the type.
class Foo(T){ ... }
Is syntactic sugar for
template Foo(T){
class Foo{ ... }
}
T
On 02/17/2012 10:45 AM, Don Clugston wrote:
On 16/02/12 17:36, Timon Gehr wrote:
On 02/16/2012 05:06 PM, Don Clugston wrote:
On 16/02/12 13:28, Stewart Gordon wrote:
On 16/02/2012 12:04, Don Clugston wrote:
On 15/02/12 22:24, H. S. Teoh wrote:
What's the original rationale for requiring that
On 02/17/2012 12:58 PM, simendsjo wrote:
On Fri, 17 Feb 2012 12:51:11 +0100, simendsjo wrote:
On Wed, 15 Feb 2012 11:10:45 +0100, simendsjo
wrote:
On 02/15/2012 09:33 AM, simendsjo wrote:
import std.array;
import std.stdio;
struct S
{
string txt;
void popFront()
{
txt.popFront();
}
@pro
On Friday, 17 February 2012 at 13:33:25 UTC, James Miller wrote:
AAs don't keep the key order, so when you delete something out
of it,
what ever system iterates to the next pointer gets confused. Its
generally a bad idea to modify an array as you loop through it.
--
James Miller
Too bad. So,
On 2/17/12 2:38 PM, Timon Gehr wrote:
On 02/17/2012 02:07 PM, Kevin Cox wrote:
Yes. At least as the compiler would say. It's a little odd but I
believe that is how the D Nam mangling works. I personally just think
of Foo!(Class) as the type.
class Foo(T){ ... }
Is syntactic sugar for
templa
On Fri, 17 Feb 2012 14:44:15 +0100, Timon Gehr wrote:
On 02/17/2012 12:58 PM, simendsjo wrote:
On Fri, 17 Feb 2012 12:51:11 +0100, simendsjo
wrote:
On Wed, 15 Feb 2012 11:10:45 +0100, simendsjo
wrote:
On 02/15/2012 09:33 AM, simendsjo wrote:
import std.array;
import std.stdio;
struct
On Mon, 13 Feb 2012 19:32:31 -0500, H. S. Teoh
wrote:
On Mon, Feb 13, 2012 at 07:15:18PM -0500, Steven Schveighoffer wrote:
[...]
3. If you are making classes like this, make *sure* all your unit
test helper functions are non-virtual! Otherwise, if some code
instantiates with unit tests on
On Friday, February 17, 2012 14:44:42 Mars wrote:
> On Friday, 17 February 2012 at 13:33:25 UTC, James Miller wrote:
> > AAs don't keep the key order, so when you delete something out
> > of it,
> > what ever system iterates to the next pointer gets confused. Its
> > generally a bad idea to modify
On Wed, 15 Feb 2012 22:01:51 -0500, Kevin wrote:
I was implementing a framework and I found that I wanted two things.
- A strong set of interfaces so that I can get what I want from a
variety of sources.
- Some basic implementations of these interfaces.
For example, say I was writing a
On Fri, 17 Feb 2012 07:19:28 -0500, kraybourne
wrote:
Hi!
This doesn't work:
import std.stdio;
class Foo(T)
{
T t;
this(T val)
{
t = val;
}
}
void main()
On Fri, 17 Feb 2012 08:44:42 -0500, Mars <-@-.-> wrote:
On Friday, 17 February 2012 at 13:33:25 UTC, James Miller wrote:
AAs don't keep the key order, so when you delete something out of it,
what ever system iterates to the next pointer gets confused. Its
generally a bad idea to modify an array
On 2012-02-17 18:04, Steven Schveighoffer wrote:
On Wed, 15 Feb 2012 22:01:51 -0500, Kevin wrote:
I was implementing a framework and I found that I wanted two things.
- A strong set of interfaces so that I can get what I want from a
variety of sources.
- Some basic implementations of these int
On Fri, Feb 17, 2012 at 02:41:10PM +0100, Timon Gehr wrote:
> On 02/17/2012 10:45 AM, Don Clugston wrote:
> >On 16/02/12 17:36, Timon Gehr wrote:
[...]
> >>static assert(is(typeof(7i)==idouble));
> >
> >Ooh, that's bad.
> >
>
> Indeed. But the implementation of complex and imaginary numbers is
> p
I wasn't looking to implement meathods in the interface, I was looking to
have a default class that implements the interface that would be created if
you called `new Interface();` I don't think this is possible. and now that
I think about it I think that it is for a good reason.
On Fri, Feb 17, 2
On 02/17/2012 09:08 AM, Steven Schveighoffer wrote:
> What you are asking for is IFTI (Implicit Function Template
> Instantiation) on constructors, and is perfectly possible, but not
> implemented:
>
> http://d.puremagic.com/issues/show_bug.cgi?id=6082
What was the resolution for the case when t
I'm trying to write a range-based template that iterates over a range
and returns one of its elements according to some criterion:
ElementType!R choose(R, E)(R range)
if (isInputRange!R)
{
ElementType!R e;
while (!range.empty) {
On 02/18/2012 12:04 AM, Ali Çehreli wrote:
On 02/17/2012 09:08 AM, Steven Schveighoffer wrote:
> What you are asking for is IFTI (Implicit Function Template
> Instantiation) on constructors, and is perfectly possible, but not
> implemented:
>
> http://d.puremagic.com/issues/show_bug.cgi?id=
On Thursday, February 16, 2012 00:38:10 Stewart Gordon wrote:
> On 15/02/2012 16:41, Jonathan M Davis wrote:
>
>
> > They're not left over at all, and they have nothing to do with octal.
>
>
>
> They are something to do with octal: because in D an integer literal
> beginning with 0 is defined
On 02/17/2012 05:59 PM, Timon Gehr wrote:
> On 02/18/2012 12:04 AM, Ali Çehreli wrote:
>> On 02/17/2012 09:08 AM, Steven Schveighoffer wrote:
>>
>> > What you are asking for is IFTI (Implicit Function Template
>> > Instantiation) on constructors, and is perfectly possible, but not
>> > implemented
On 02/18/2012 03:22 AM, Ali Çehreli wrote:
On 02/17/2012 05:59 PM, Timon Gehr wrote:
> On 02/18/2012 12:04 AM, Ali Çehreli wrote:
>> On 02/17/2012 09:08 AM, Steven Schveighoffer wrote:
>>
>> > What you are asking for is IFTI (Implicit Function Template
>> > Instantiation) on constructors, an
hi,
when i try to use tmpfile from std.stdio i get this error
> char 0x00ad not allowed in identifier
I use dmdfe 2.058, i do just:
File tmp = tmpfile();
18.02.2012 2:50, H. S. Teoh пишет:
...
You cannot have ref local variable, so e is a copy in any case. It may
be a class reference or a pointer, so calling potentially non-const
methods is probably not safe here, but assignment shouldn't give you
problems.
On Sat, Feb 18, 2012 at 05:19:52AM +0200, Mantis wrote:
> 18.02.2012 2:50, H. S. Teoh пишет:
> >...
> You cannot have ref local variable, so e is a copy in any case. It
> may be a class reference or a pointer, so calling potentially
> non-const methods is probably not safe here, but assignment
> sh
18.02.2012 7:51, H. S. Teoh пишет:
On Sat, Feb 18, 2012 at 05:19:52AM +0200, Mantis wrote:
18.02.2012 2:50, H. S. Teoh пишет:
...
You cannot have ref local variable, so e is a copy in any case. It
may be a class reference or a pointer, so calling potentially
non-const methods is probably not s
On Sat, Feb 18, 2012 at 08:02:15AM +0200, Mantis wrote:
> 18.02.2012 7:51, H. S. Teoh пишет:
> >On Sat, Feb 18, 2012 at 05:19:52AM +0200, Mantis wrote:
> >>18.02.2012 2:50, H. S. Teoh пишет:
> >>>...
> >>You cannot have ref local variable, so e is a copy in any case. It
> >>may be a class reference
On Friday, February 17, 2012 22:27:06 H. S. Teoh wrote:
> Hmm. But the problem is that I want to be able to handle something like
> File.byLine(). Or perhaps what I really need is just to write a wrapper
> around File.readln() that ensures immutability, then I can use
> isImmutable() to enforce saf
"Jonathan M Davis" wrote in message
news:mailman.508.1329531876.20196.digitalmars-d-le...@puremagic.com...
>
> They have nothing to do with octal in that they were not intentionally
> octal.
> I was merely using the leading 0 without thinking about it, because having
> leading 0s generally makes
44 matches
Mail list logo