Re: Can I compile for Linux from a Windows platform?

2013-10-16 Thread Jerome BENOIT
If you want to play within a Linux environment on Windows, you can try CygWIN: http://www.cygwin.com/ On 17/10/13 04:24, Adam D. Ruppe wrote: On Thursday, 17 October 2013 at 01:18:42 UTC, Jonathan M Davis wrote: In general, you can't cross-compile across operating systems. Linux to Windows

Re: unpredictableSeed

2013-03-03 Thread Jerome BENOIT
On 03/03/13 10:06, Johannes Pfau wrote: Am Sun, 03 Mar 2013 09:58:41 +0100 schrieb Ivan Kazmenkoga...@mail.ru: Can anyone advise on the theoretical basis for the unpredictableSeed method in std.random? I've tried googling around for the theory of good thread-safe seed generation methods but

Re: Parser generator?

2012-07-04 Thread Jerome BENOIT
Apparently Flex/Bison can be used: see last answer in http://www.digitalmars.com/d/archives/digitalmars/D/31679.html hth, Jerome On 04/07/12 22:53, Wouter Verhelst wrote: Hi folks, Does someone know of a parser generator for D? If it doesn't exist, I can write a parser by hand, but having

D and gmp

2012-07-02 Thread Jerome BENOIT
Hello List: I am looking for D code using the gmplib: any hint is welcome. Thanks in advance, Jerome

Re: A little story

2012-06-24 Thread Jerome BENOIT
On 24/06/12 23:52, bearophile wrote: And D is too much unsafe for such kind of programs, because integral numbers can silently overflow. Is there any GMP port for D ? Jerome

Re: A little story

2012-06-24 Thread Jerome BENOIT
On 25/06/12 01:51, bearophile wrote: Jerome BENOIT: Is there any GMP port for D ? Jerome I don't know. (But GMP is NOT a solution to the problems shown in that story). How come as ``integral numbers (will not be) overflow'' ? Bye, bearophile

Re: A little story

2012-06-24 Thread Jerome BENOIT
Thanks a lot for the explanation. Jerome On 25/06/12 02:54, bearophile wrote: Jerome BENOIT: How come as ``integral numbers (will not be) overflow'' ? Multiprecision numbers allocate on the heap when they become large (or they always allocate on the heap). This has a significant

Re: floats default to NaN... why?

2012-06-09 Thread Jerome BENOIT
On 09/06/12 20:48, Kevin wrote: On 09/06/12 14:42, Minas wrote: With ints, the best we can do is 0. With floats, NaN makes it better. With the logic that NaN is the default for floats, 0 is a very bad choice for ints. It the worst we could do. Altough I understand that setting it to

Re: floats default to NaN... why?

2012-06-09 Thread Jerome BENOIT
On 09/06/12 20:42, Minas wrote: With ints, the best we can do is 0. With floats, NaN makes it better. With the logic that NaN is the default for floats, 0 is a very bad choice for ints. It the worst we could do. Altough I understand that setting it to something else like -infinity is still

Re: floats default to NaN... why?

2012-06-09 Thread Jerome BENOIT
Hello: On 10/06/12 01:57, Andrew Wiley wrote: On Sat, Jun 9, 2012 at 4:53 PM, Andrew Wileywiley.andre...@gmail.com wrote: On Sat, Jun 9, 2012 at 11:57 AM, Kevinkevincox...@gmail.com wrote: On Sat 09 Jun 2012 14:59:21 EDT, Jerome BENOIT wrote: On 09/06/12 20:48, Kevin wrote: On 09/06

Re: floats default to NaN... why?

2012-06-09 Thread Jerome BENOIT
On 10/06/12 02:49, Jonathan M Davis wrote: On Sunday, June 10, 2012 02:32:18 Jerome BENOIT wrote: I see. So the alternative, to get a kind of NaN effect, would be to set integers to their hardware extremum (INT_MAX,SIZE_MAX,...). But this option is hardware dependent, so zero as default

Re: floats default to NaN... why?

2012-06-09 Thread Jerome BENOIT
On 10/06/12 02:49, Jonathan M Davis wrote: On Sunday, June 10, 2012 02:32:18 Jerome BENOIT wrote: I see. So the alternative, to get a kind of NaN effect, would be to set integers to their hardware extremum (INT_MAX,SIZE_MAX,...). But this option is hardware dependent, so zero as default

Re: floats default to NaN... why?

2012-06-07 Thread Jerome BENOIT
hello List: On 08/06/12 04:04, Kevin Cox wrote: On Jun 7, 2012 9:53 PM, Minas minas_mina1...@hotmail.co.uk mailto:minas_mina1...@hotmail.co.uk wrote: I agree that the default value for floats/doubles should be zero. It feels much more natural. This highly depends on your perspective:

Re: floats default to NaN... why?

2012-04-16 Thread Jerome BENOIT
On 16/04/12 04:38, F i L wrote: Of course FP numbers are meant for coders... they're in a programming language. They are used by coders, and not every coder that uses FP math *has* to be well trained in the finer points of mathematics simply to use a number that can represent fractions in a

Re: floats default to NaN... why?

2012-04-14 Thread Jerome BENOIT
On 14/04/12 09:45, F i L wrote: Jonathan M Davis wrote: No. You always have a bug if you don't initialize a variable to the value that it's supposed to be. It doesn't matter whether it's 0, NaN, 527.1209823, or whatever. All having a default value that you're more likely to use means is that

Re: floats default to NaN... why?

2012-04-14 Thread Jerome BENOIT
On 14/04/12 16:47, F i L wrote: Jerome BENOIT wrote: Why would a compiler set `real' to 0.0 rather then 1.0, Pi, ? Because 0.0 is the lowest (smallest, starting point, etc..) quid -infinity ? numerical value. Pi is the corner case and obviously has to be explicitly set. If you

Re: floats default to NaN... why?

2012-04-14 Thread Jerome BENOIT
On 14/04/12 18:38, F i L wrote: On Saturday, 14 April 2012 at 15:44:46 UTC, Jerome BENOIT wrote: On 14/04/12 16:47, F i L wrote: Jerome BENOIT wrote: Why would a compiler set `real' to 0.0 rather then 1.0, Pi, ? Because 0.0 is the lowest (smallest, starting point, etc..) quid

Re: floats default to NaN... why?

2012-04-14 Thread Jerome BENOIT
On 14/04/12 20:51, F i L wrote: On Saturday, 14 April 2012 at 18:07:41 UTC, Jerome BENOIT wrote: On 14/04/12 18:38, F i L wrote: On Saturday, 14 April 2012 at 15:44:46 UTC, Jerome BENOIT wrote: On 14/04/12 16:47, F i L wrote: Jerome BENOIT wrote: Why would a compiler set `real' to 0.0

Re: dmd gdc

2012-01-26 Thread Jerome BENOIT
There is also gdmd : dmd front end that use gdc On 26/01/12 13:34, Trass3r wrote: On Thursday, 26 January 2012 at 11:46:19 UTC, sami wrote: my question is if there thing i can do with dmd only and visa versa? what the feature of one of them over the other? what the different between them in

Re: dmd gdc

2012-01-26 Thread Jerome BENOIT
actually is a d source file that does more than a simple translation ... as dmd On 26/01/12 13:59, Trass3r wrote: There is also gdmd : dmd front end that use gdc It's nothing but a perl script that translates dmd command line options into gdc ones.

Re: dmd gdc

2012-01-26 Thread Jerome BENOIT
Sorry I made a mistake here: I confused gdmd with rdmd :-) On 26/01/12 14:08, Jerome BENOIT wrote: actually is a d source file that does more than a simple translation ... as dmd On 26/01/12 13:59, Trass3r wrote: There is also gdmd : dmd front end that use gdc It's nothing but a perl

tdlp: higher-order functions

2012-01-20 Thread Jerome BENOIT
Hello List: In tDlp book in section 5.6 entitled `Higher-Order Functions. Function Literals, the first code example is: - T[] find(alias pred, T)(T[] input) if (is(typeof(pred(input[0])) == bool)) { for(;

Re: tdlp: higher-order functions

2012-01-20 Thread Jerome BENOIT
Thanks. Let go further. On 20/01/12 15:58, Alex Rønne Petersen wrote: On 20-01-2012 15:32, Jerome BENOIT wrote: Hello List: In tDlp book in section 5.6 entitled `Higher-Order Functions. Function Literals, the first code example

Re: tdlp: higher-order functions

2012-01-20 Thread Jerome BENOIT
Hello Again: On 20/01/12 15:58, Alex Rønne Petersen wrote: On 20-01-2012 15:32, Jerome BENOIT wrote: Hello List: In tDlp book in section 5.6 entitled `Higher-Order Functions. Function Literals, the first code example is: - T

Re: tdlp: higher-order functions

2012-01-20 Thread Jerome BENOIT
On 20/01/12 17:23, Alex Rønne Petersen wrote: On 20-01-2012 17:14, Jerome BENOIT wrote: Hello Again: On 20/01/12 15:58, Alex Rønne Petersen wrote: On 20-01-2012 15:32, Jerome BENOIT wrote: Hello List: In tDlp book in section 5.6 entitled `Higher-Order Functions. Function Literals

tdpl: function literals versus delegate lierals

2012-01-19 Thread Jerome BENOIT
Hello List: On my box, the following D source, inspired by the subsection 5.6.1 of tDpl, does not work as expected: - // adhoc_06.d import std.stdio; unittest { // Tersest, most convenient code auto f = (int i)

Re: tdpl: partial ordering of functions: conflict error

2012-01-18 Thread Jerome BENOIT
On 18/01/12 04:36, Jonathan M Davis wrote: On Wednesday, January 18, 2012 02:33:25 Jerome BENOIT wrote: And I cannot figure why :-( http://d.puremagic.com/issues/show_bug.cgi?id=1528 As a workaround, templatize the last function by changing its signature to int[] find()(int[] longer, int

Re: tdpl: partial ordering of functions: conflict error

2012-01-18 Thread Jerome BENOIT
On 18/01/12 17:07, Timon Gehr wrote: On 01/18/2012 04:57 PM, Timon Gehr wrote: On 01/18/2012 02:32 PM, Jerome BENOIT wrote: On 18/01/12 04:36, Jonathan M Davis wrote: On Wednesday, January 18, 2012 02:33:25 Jerome BENOIT wrote: And I cannot figure why :-( http://d.puremagic.com/issues

Re: tdpl: partial ordering of functions: conflict error

2012-01-18 Thread Jerome BENOIT
On 18/01/12 18:05, Timon Gehr wrote: On 01/18/2012 05:40 PM, Jerome BENOIT wrote: On 18/01/12 17:07, Timon Gehr wrote: On 01/18/2012 04:57 PM, Timon Gehr wrote: On 01/18/2012 02:32 PM, Jerome BENOIT wrote: On 18/01/12 04:36, Jonathan M Davis wrote: On Wednesday, January 18, 2012 02:33

tdpl: partial ordering of functions: conflict error

2012-01-17 Thread Jerome BENOIT
Hello List: On my box, the following D source, inspired by the subsection 5.5.2 of tDpl, arises a `template conflict': - T[] find(T, E)(T[] haystack, E needle) if (is(typeof(haystack[0] != needle) == bool)) {