Re: Troubleshooting Linker error (Symbol Undefined)

2012-09-30 Thread Andrej Mitrovic
On 10/1/12, Jesse Phillips wrote: > Error 42: Symbol Undefined _VarCmp@16 P.S. as soon as pointers are involved you don't need the full type info of such a parameter to debug linker errors, so you can cut down on code when reducing. For example if you had to match this C function but are get

Re: Windows MinGW and DMD

2012-09-30 Thread Mike Parker
On Friday, 28 September 2012 at 18:10:36 UTC, David wrote: So I want to make the compilation of my little game work on Windows, I set up MinGW with Msys and ran the makefile, after a few fixes compilation worked, the problem is linking fails hard. I need a few external libraries in C like glfw

Re: Very strange problem with comparing floating point numbers

2012-09-30 Thread jerro
On Monday, 1 October 2012 at 04:10:25 UTC, Ivan Agafonov wrote: On Sunday, 30 September 2012 at 06:20:56 UTC, jerro wrote: The second one uses fstp twice, then fld twice. I don't know, maybe this could be a bug. You're right the lack of one fst/fld in the first case is a bug. x87 floating po

Troubleshooting Linker error (Symbol Undefined)

2012-09-30 Thread Jesse Phillips
I'm trying to identify what change has resulted in getting the error: Error 42: Symbol Undefined _VarCmp@16 I was doing my not so routine updates for the Juno Class Libraries. This symbol is the VARIANT compare function provided by oleaut32.lib on Windows. It is a very nice function and h

Re: Very strange problem with comparing floating point numbers

2012-09-30 Thread Ivan Agafonov
On Sunday, 30 September 2012 at 06:20:56 UTC, jerro wrote: The second one uses fstp twice, then fld twice. I don't know, maybe this could be a bug. You're right the lack of one fst/fld in the first case is a bug. x87 floating point registers are 80 bit. This: fstpdword [ebp-0CH] Conver

Re: Metaprogramming: check for ref

2012-09-30 Thread mist
Thanks! On Sunday, 30 September 2012 at 21:20:40 UTC, jerro wrote: On Sunday, 30 September 2012 at 20:51:54 UTC, mist wrote: Thanks! Unfortunately, return type issue is more important in my case. I'll check if implementation from ParameterStorageClassTuple can be adapted for return types thou

WIC and Direct X

2012-09-30 Thread deed
Anyone having experience in using WIC? How can I render, let's say a png file on disk, to the screen?

Re: Very strange problem with comparing floating point numbers

2012-09-30 Thread jerro
Technically (AFAIK), IEEE754 does need require reproducibility, ergo determinism. It actually requires more than that: "Algebraic operations covered by IEEE 754, namely + , - , * , / , square root ˆš and Binary <-> Decimal Conversion with rare exceptions, must be Correctly Rounded to the prec

Re: Metaprogramming: check for ref

2012-09-30 Thread Andrej Mitrovic
On 9/30/12, jerro wrote: > I think this should work: > > template returnsRef(alias f) > { > enum bool returnsRef = is(typeof( > { > ParameterTypeTuple!f param; > auto ptr = &f(param); > })); > } Yep. We should add this to Phobos imo.

Re: Metaprogramming: check for ref

2012-09-30 Thread jerro
On Sunday, 30 September 2012 at 20:51:54 UTC, mist wrote: Thanks! Unfortunately, return type issue is more important in my case. I'll check if implementation from ParameterStorageClassTuple can be adapted for return types though. I think this should work: template returnsRef(alias f) { e

Re: Very strange problem with comparing floating point numbers

2012-09-30 Thread monarch_dodra
On Sunday, 30 September 2012 at 20:47:41 UTC, jerro wrote: I don't really agree with that. floating point operations are just inexact, regardless of optimizations. That's how they work, period. It is true that they are inexact, but inexact and non-deterministic are not the same thing. Floatin

Re: Metaprogramming: check for ref

2012-09-30 Thread mist
Thanks! Unfortunately, return type issue is more important in my case. I'll check if implementation from ParameterStorageClassTuple can be adapted for return types though. On Sunday, 30 September 2012 at 20:37:14 UTC, Andrej Mitrovic wrote: On 9/30/12, mist wrote: How can I: 1) check if fu

Re: Very strange problem with comparing floating point numbers

2012-09-30 Thread jerro
I don't really agree with that. floating point operations are just inexact, regardless of optimizations. That's how they work, period. It is true that they are inexact, but inexact and non-deterministic are not the same thing. Floating point operations are deterministic. Doing the same operat

Re: Metaprogramming: check for ref

2012-09-30 Thread Andrej Mitrovic
On 9/30/12, mist wrote: > How can I: > 1) check if function returns by ref > 2) check if function parameters are ref > ..outside of function body. Is parsing typeof(func).stringof only > valid option? > See ParameterStorageClassTuple in std.traits http://dlang.org/phobos/std_traits.html I'm not

Re: Very strange problem with comparing floating point numbers

2012-09-30 Thread Andrej Mitrovic
On 9/30/12, Tommi wrote: > On Sunday, 30 September 2012 at 01:48:04 UTC, Andrej Mitrovic > wrote: >> >> Dissasembly: >> __Dmain:; Function begin, communal >> enter 12, 0 ; >> _ C8, 000C, 00 >> call_D4test8getFloatFNdZf

Re: Very strange problem with comparing floating point numbers

2012-09-30 Thread monarch_dodra
On Sunday, 30 September 2012 at 18:31:17 UTC, so wrote: On Sunday, 30 September 2012 at 17:07:19 UTC, monarch_dodra wrote: On Sunday, 30 September 2012 at 01:29:24 UTC, Ivan Agafonov wrote: // Tell me about this sutation, may be it is a bug? [SNIP] // all of this fails!!! asser

Re: Very strange problem with comparing floating point numbers

2012-09-30 Thread so
On Sunday, 30 September 2012 at 17:07:19 UTC, monarch_dodra wrote: On Sunday, 30 September 2012 at 01:29:24 UTC, Ivan Agafonov wrote: // Tell me about this sutation, may be it is a bug? [SNIP] // all of this fails!!! assert (a.length == a.length); // This is really shocking

Metaprogramming: check for ref

2012-09-30 Thread mist
How can I: 1) check if function returns by ref 2) check if function parameters are ref ..outside of function body. Is parsing typeof(func).stringof only valid option?

Re: How to register class member function as lpfnWndProc? Cannot convert delegate to function

2012-09-30 Thread deed
Thanks to all of you for your informative replies. I was testing different code structures and wondered whether this was possible.

Re: Very strange problem with comparing floating point numbers

2012-09-30 Thread monarch_dodra
On Sunday, 30 September 2012 at 01:29:24 UTC, Ivan Agafonov wrote: // Tell me about this sutation, may be it is a bug? [SNIP] // all of this fails!!! assert (a.length == a.length); // This is really shocking assert (a.length == a3.length); [SNIP] This is just a fact of

Re: Very strange problem with comparing floating point numbers

2012-09-30 Thread Ali Çehreli
On 09/30/2012 04:06 AM, Tommi wrote: > On Sunday, 30 September 2012 at 01:48:04 UTC, Andrej Mitrovic wrote: >> >> Dissasembly: >> __Dmain:; Function begin, communal >> enter 12, 0 ; _ C8, 000C, 00 >> call _D4test8getFloatFNdZf ; 0004 _ E8, >> (rel) >> ... > > Can I tell DMD to produce

Re: Very strange problem with comparing floating point numbers

2012-09-30 Thread Tommi
On Sunday, 30 September 2012 at 01:48:04 UTC, Andrej Mitrovic wrote: Dissasembly: __Dmain:; Function begin, communal enter 12, 0 ; _ C8, 000C, 00 call_D4test8getFloatFNdZf ; 0004 _ E8, (rel) ... Can I tel

Re: liittle question about reduce

2012-09-30 Thread monarch_dodra
On Saturday, 29 September 2012 at 23:07:30 UTC, Timon Gehr wrote: On 09/30/2012 01:04 AM, bioinfornatics wrote: hi, int[] list = [ 0, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]; why this do not works ? list.reduce!( (a,b) => a + b )( 0 ); // sum all elements but by this way that is ok: reduce!( (a,b) =>