Re: :O

2011-02-07 Thread Peter Alexander
On 7/02/11 6:57 AM, ñ wrote: http://h3.gd/devlog/?p=37 That's 4 months old, but yes it's sad that Tomasz isn't using D anymore; he was doing some really cool stuff with it.

Re: :O

2011-02-07 Thread Nick Sabalausky
Peter Alexander peter.alexander...@gmail.com wrote in message news:iio8ng$1f76$1...@digitalmars.com... On 7/02/11 6:57 AM, ñ wrote: http://h3.gd/devlog/?p=37 That's 4 months old, but yes it's sad that Tomasz isn't using D anymore; he was doing some really cool stuff with it. Hmm, that

Re: FD_SET Problem

2011-02-07 Thread Brad Roberts
On 2/6/2011 11:05 PM, Andrew Wiley wrote: On Mon, Feb 7, 2011 at 12:33 AM, Brad Roberts bra...@puremagic.com mailto:bra...@puremagic.com wrote: On 2/6/2011 9:30 PM, Andrew Wiley wrote: I'm on 64 bit linux (though with a self-built 32 bit DMD), and this testcase is failing for me:

Re: std.unittests/exception Update and Vote [Please Vote]

2011-02-07 Thread Jonathan M Davis
There are a number of people who have responded positively to my unit test functions - including assertPred - as it has moved through the review process. Please reiterate that positive vote here (or negative if you're so inclined). The deadline for votes is today. As it stands, I believe that

Re: What Makes A Programming Language Good

2011-02-07 Thread Walter Bright
Daniel Gibson wrote: When you're learning a language, you want to get familiar with it before starting to fix stuff. I tend to learn things by fixing them :-)

Re: What Makes A Programming Language Good

2011-02-07 Thread Gour
On Mon, 07 Feb 2011 01:06:46 -0800 Walter Bright newshou...@digitalmars.com wrote: I tend to learn things by fixing them :-) Heh...this is called 'engineer'. ;) Sincerely, Gour -- Gour | Hlapicina, Croatia | GPG key: CDBF17CA

Re: std.unittests/exception Update and Vote [Please Vote]

2011-02-07 Thread Nick Sabalausky
Jonathan M Davis jmdavisp...@gmx.com wrote in message news:mailman.1363.1297067437.4748.digitalmar...@puremagic.com... There are a number of people who have responded positively to my unit test functions - including assertPred - as it has moved through the review process. Please reiterate

Re: std.file and isDir

2011-02-07 Thread spir
On 02/07/2011 06:28 AM, Nick Sabalausky wrote: Andrej Mitrovicandrej.mitrov...@gmail.com wrote in message news:mailman.1339.1297029778.4748.digitalmar...@puremagic.com... Dunno, but it's not in 2.51. I find using uniform function call syntax can be confusing to read in the documentation. Or

Re: std.unittests/exception Update and Vote [Please Vote]

2011-02-07 Thread spir
On 02/07/2011 09:30 AM, Jonathan M Davis wrote: There are a number of people who have responded positively to my unit test functions - including assertPred - as it has moved through the review process. Please reiterate that positive vote here (or negative if you're so inclined). The deadline for

Re: std.unittests/exception Update and Vote [Please Vote]

2011-02-07 Thread Jim
Not that I have a say in this matter, but although I think the code is excellent in technical merits, is not a central part of the problem it aims to mend actually an insufficiency in druntime? I'd rather see the regular, language provided assert() fulfilling the needs as the assertion

Re: std.unittests/exception Update and Vote [Please Vote]

2011-02-07 Thread Jonathan M Davis
On Monday 07 February 2011 03:36:33 Jim wrote: Not that I have a say in this matter, but although I think the code is excellent in technical merits, is not a central part of the problem it aims to mend actually an insufficiency in druntime? I'd rather see the regular, language provided

Re: What Makes A Programming Language Good

2011-02-07 Thread spir
On 02/07/2011 10:06 AM, Walter Bright wrote: Daniel Gibson wrote: When you're learning a language, you want to get familiar with it before starting to fix stuff. I tend to learn things by fixing them :-) ¡ great ! Though original authors often do not appreciate this attitude very much,

Re: High performance XML parser

2011-02-07 Thread Steven Schveighoffer
On Fri, 04 Feb 2011 17:03:08 -0500, Simen kjaeraas simen.kja...@gmail.com wrote: Steven Schveighoffer schvei...@yahoo.com wrote: Here is how I would approach it (without doing any research). First, we need a buffered I/O system where you can easily access and manipulate the buffer. I

Re: High performance XML parser

2011-02-07 Thread Steven Schveighoffer
On Fri, 04 Feb 2011 17:36:50 -0500, Tomek Sowiński j...@ask.me wrote: Steven Schveighoffer napisał: Here is how I would approach it (without doing any research). First, we need a buffered I/O system where you can easily access and manipulate the buffer. I have proposed one a few months ago

Re: A monitor for every object

2011-02-07 Thread Steven Schveighoffer
On Sat, 05 Feb 2011 05:51:35 -0500, spir denis.s...@gmail.com wrote: Steven Schveighoffer: D's monitors are lazily created, so there should be no issue with resource allocation. If you don't ever lock an object instance, it's not going to consume any resources. For the non-sorcerers

Re: buffered input

2011-02-07 Thread Steven Schveighoffer
On Sat, 05 Feb 2011 00:46:40 -0500, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: I've had the opportunity today to put some solid hours of thinking into the relationship (better said the relatedness) of what would be called buffered streams and ranges. They have some

Re: buffered input

2011-02-07 Thread Steven Schveighoffer
On Sun, 06 Feb 2011 10:25:15 -0500, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: How does the stream decide between 1 and 2? Clearly it's undesirable to grow the buffer too much and it's also undesirable to copy too much data. A simple approach is to establish a bound on

Re: buffered input

2011-02-07 Thread Steven Schveighoffer
On Sat, 05 Feb 2011 10:02:47 -0500, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: On 2/5/11 2:45 AM, Michel Fortin wrote: One thing I'm wondering is whether it'd be more efficient if we could provide our own buffer to be filled. In cases where you want to preserve the data, this

buffered input (examples?)

2011-02-07 Thread spir
Hello, Andrei Alexandrescu wrote: Generally laziness may be a tactics you could use to help with memory use. A good example is split() vs. splitter(). The er version offers one element at a time thus never forcing an allocation. The split() version must do all work upfront and also allocate

Re: A monitor for every object

2011-02-07 Thread Steven Schveighoffer
On Mon, 07 Feb 2011 07:48:53 -0500, Steven Schveighoffer schvei...@yahoo.com wrote: The meaning of an 'object being its own monitor' is just that the monitor for operations on an object is conceptually the object itself (even though it's technically a hidden member of the object). This

Re: A monitor for every object

2011-02-07 Thread Steven Schveighoffer
On Fri, 04 Feb 2011 18:29:08 -0500, Sean Kelly s...@invisibleduck.org wrote: On Feb 4, 2011, at 3:06 PM, Tomek Sowiński wrote: Steven Schveighoffer napisał: D also allows you to replace it's monitor with a custom monitor object (i.e. core.sync.Mutex) so you can have more control over the

Re: buffered input

2011-02-07 Thread spir
On 02/07/2011 02:01 PM, Steven Schveighoffer wrote: On Sat, 05 Feb 2011 10:02:47 -0500, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: On 2/5/11 2:45 AM, Michel Fortin wrote: One thing I'm wondering is whether it'd be more efficient if we could provide our own buffer to be filled.

Re: buffered input (examples?)

2011-02-07 Thread Michel Fortin
On 2011-02-07 08:24:32 -0500, spir denis.s...@gmail.com said: Does this have anything to do with currently discussed buffered input ranges? If yes, how does such a design, or any alternative, fit their proposed interface? You can build all of this on top of a buffered input range. The

Re: A monitor for every object

2011-02-07 Thread Robert Jacques
On Mon, 07 Feb 2011 08:20:20 -0500, Steven Schveighoffer schvei...@yahoo.com wrote: On Fri, 04 Feb 2011 18:29:08 -0500, Sean Kelly s...@invisibleduck.org wrote: On Feb 4, 2011, at 3:06 PM, Tomek Sowiński wrote: Steven Schveighoffer napisał: D also allows you to replace it's monitor

Re: High performance XML parser

2011-02-07 Thread Robert Jacques
On Mon, 07 Feb 2011 07:40:30 -0500, Steven Schveighoffer schvei...@yahoo.com wrote: On Fri, 04 Feb 2011 17:36:50 -0500, Tomek Sowiński j...@ask.me wrote: Steven Schveighoffer napisał: Here is how I would approach it (without doing any research). First, we need a buffered I/O system where

Re: buffered input

2011-02-07 Thread Kagamin
Andrei Alexandrescu Wrote: With these primitives a lot of good operating operating on buffered streams can be written efficiently. The range is allowed to reuse data in its buffers (unless that would contradict language invariants, e.g. if T is invariant), so if client code wants to stash

Re: High performance XML parser

2011-02-07 Thread Kagamin
Tomek Sowiński Wrote: One way is the slicing approach mentioned on this NG, notably used by RapidXML. I already contacted Marcin (the author) to ensure that using solutions inspired by his lib is OK with him; it is. But I don't think I'll go this way. One reason is, surprisingly,

Re: A monitor for every object

2011-02-07 Thread Steven Schveighoffer
On Mon, 07 Feb 2011 10:33:29 -0500, Robert Jacques sandf...@jhu.edu wrote: On Mon, 07 Feb 2011 08:20:20 -0500, Steven Schveighoffer schvei...@yahoo.com wrote: On Fri, 04 Feb 2011 18:29:08 -0500, Sean Kelly s...@invisibleduck.org wrote: On Feb 4, 2011, at 3:06 PM, Tomek Sowiński wrote:

Re: std.xml should just go

2011-02-07 Thread BLS
On 06/02/2011 16:41, Andrei Alexandrescu wrote: On 2/5/11 17:54 EST, BLS wrote: On 04/02/2011 04:20, Andrei Alexandrescu wrote: Cool. Is Michael Rynn willing to make a submission? He announced a while ago in d.announce. std.xml2 candidate.. A few weeks earlier (if am not completely wrong) he

Re: buffered input

2011-02-07 Thread Andrei Alexandrescu
On 2/7/11 7:53 AM, Steven Schveighoffer wrote: On Sat, 05 Feb 2011 00:46:40 -0500, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: I've had the opportunity today to put some solid hours of thinking into the relationship (better said the relatedness) of what would be called buffered

Re: buffered input (examples?)

2011-02-07 Thread Andrei Alexandrescu
On 2/7/11 9:40 AM, Michel Fortin wrote: On 2011-02-07 08:24:32 -0500, spir denis.s...@gmail.com said: Does this have anything to do with currently discussed buffered input ranges? If yes, how does such a design, or any alternative, fit their proposed interface? You can build all of this on

Re: std.xml should just go

2011-02-07 Thread Andrei Alexandrescu
On 2/7/11 12:02 PM, BLS wrote: On 06/02/2011 16:41, Andrei Alexandrescu wrote: On 2/5/11 17:54 EST, BLS wrote: On 04/02/2011 04:20, Andrei Alexandrescu wrote: Cool. Is Michael Rynn willing to make a submission? He announced a while ago in d.announce. std.xml2 candidate.. A few weeks earlier

Re: std.unittests/exception Update and Vote [Please Vote]

2011-02-07 Thread Andrew Wiley
On Mon, Feb 7, 2011 at 2:30 AM, Jonathan M Davis jmdavisp...@gmx.comwrote: There are a number of people who have responded positively to my unit test functions - including assertPred - as it has moved through the review process. Please reiterate that positive vote here (or negative if you're

Re: buffered input (examples?)

2011-02-07 Thread spir
On 02/07/2011 03:40 PM, Michel Fortin wrote: On 2011-02-07 08:24:32 -0500, spir denis.s...@gmail.com said: Does this have anything to do with currently discussed buffered input ranges? If yes, how does such a design, or any alternative, fit their proposed interface? You can build all of this

Re: A monitor for every object

2011-02-07 Thread Sean Kelly
Steven Schveighoffer Wrote: On Fri, 04 Feb 2011 18:29:08 -0500, Sean Kelly s...@invisibleduck.org wrote: On Feb 4, 2011, at 3:06 PM, Tomek Sowiński wrote: Steven Schveighoffer napisał: D also allows you to replace it's monitor with a custom monitor object (i.e.

Re: A monitor for every object

2011-02-07 Thread Sean Kelly
Steven Schveighoffer Wrote: On Mon, 07 Feb 2011 10:33:29 -0500, Robert Jacques sandf...@jhu.edu wrote: Steve, you can always assign to an object's monitor variable manually. But adding this functionality to Mutex's and Object's API would be appreciated. Sure, Mutex does this

Re: A monitor for every object

2011-02-07 Thread Steven Schveighoffer
On Mon, 07 Feb 2011 14:29:37 -0500, Sean Kelly s...@invisibleduck.org wrote: Steven Schveighoffer Wrote: On Mon, 07 Feb 2011 10:33:29 -0500, Robert Jacques sandf...@jhu.edu wrote: Steve, you can always assign to an object's monitor variable manually. But adding this functionality to

Re: Unilink - alternative linker for win32/64, DMD OMF extensions?

2011-02-07 Thread Trass3r
Just another thought: dmd uses ld on linux, couldn't it use MinGW's ld on Windows? MinGW's ld doesn't use the same object format as DMD/DMC I know, of course this would include discarding OMF.

Re: Unilink - alternative linker for win32/64, DMD OMF extensions?

2011-02-07 Thread Andrej Mitrovic
I found this gem in digitalmars' bookshelf: http://www.digitalmars.com/bibliography.html#fileformats

greatest common divisor implementation

2011-02-07 Thread Matthias Walter
Hi everyone, as I'm currently working on a C++ project which involves gcd computations I had a quick look at phobos' implementation. 1. First thing I saw is that gcd(-3,6) raises an exception, although mathematically it is just 2. Of course checking the sign of the arguments takes computation

Re: greatest common divisor implementation

2011-02-07 Thread bearophile
Matthias Walter: 1. First thing I saw is that gcd(-3,6) raises an exception, although mathematically it is just 2. Of course checking the sign of the arguments takes computation time, but for my stuff I'd definitely need it. If it's really too expensive then there should be at least another

Re: buffered input (examples?)

2011-02-07 Thread Michel Fortin
On 2011-02-07 13:25:53 -0500, spir denis.s...@gmail.com said: On 02/07/2011 03:40 PM, Michel Fortin wrote: On 2011-02-07 08:24:32 -0500, spir denis.s...@gmail.com said: Does this have anything to do with currently discussed buffered input ranges? If yes, how does such a design, or any

Some bugs in Intel code

2011-02-07 Thread bearophile
This article shows some common bugs found by a static analysis tool in about 1.6 millions of code lines of the Intel IPP Samples for Windows, a high-quality C++ project. Intel IPP Samples for Windows - error correction, by Andrey Karpov, January 2011:

Efficient outputting of to-string conversions

2011-02-07 Thread Tomek Sowiński
Looks like std.conv.to always allocates behind the scenes. It's a shame as the returned string is immediately processed and discarded in my XML writer. Are there plans to include a custom output variant, e.g. to!string(7, outputRange)? -- Tomek

Re: Efficient outputting of to-string conversions

2011-02-07 Thread Jonathan M Davis
On Monday 07 February 2011 13:10:09 Tomek Sowiński wrote: Looks like std.conv.to always allocates behind the scenes. It's a shame as the returned string is immediately processed and discarded in my XML writer. Are there plans to include a custom output variant, e.g. to!string(7, outputRange)?

Re: Smartphones and D

2011-02-07 Thread Daniel Gibson
Am 31.01.2011 12:57, schrieb Daniel Gibson: Am 31.01.2011 12:04, schrieb dennis luehring: While workstations for developers have bigger and completely different requirements, in general the most demanding applications for ordinary sixpack-joe are hd-video transcoding (which actually isn't

Re: Efficient outputting of to-string conversions

2011-02-07 Thread Tomek Sowiński
Jonathan M Davis napisał: On Monday 07 February 2011 13:10:09 Tomek Sowiński wrote: Looks like std.conv.to always allocates behind the scenes. It's a shame as the returned string is immediately processed and discarded in my XML writer. Are there plans to include a custom output variant,

Another Phobos2 test

2011-02-07 Thread bearophile
I've found another taks in the rosettacode.org site: http://rosettacode.org/wiki/Tic-tac-toe The program itself is not so interesting, and probably there are better ways to implement a Tic-tac-toe player program. But it's a good enough example to test Phobos2, to see how much handy it is when

Overloading opEquals(T)(T y)

2011-02-07 Thread Charles McAnany
Hi, all. So I'm trying to make a BigRational struct, to get more comfortable with D. I'm working on the opEquals part now, and I'm having some difficulty. I'd like to write an equality checker for two BigRationals, and have all other comparisons make a BigRational of the rhs and then forward that

Re: Overloading opEquals(T)(T y)

2011-02-07 Thread bearophile
Charles McAnany: Hi, all. So I'm trying to make a BigRational struct, to get more comfortable with D. I suggest to ask similar questions in the D.learn newsgroup. bool opEquals(Tdummy = void)(BigRational y){ auto temp = this-y; if (temp.numerator == 0) return true;

Social debugging

2011-02-07 Thread bearophile
Found though Reddit, social debugging, maybe for D too: http://trycat.ch/ Bye, bearophile

Re: Another Phobos2 test

2011-02-07 Thread Adam Ruppe
My gut tells me you'd get much better results if you tried to write D in D instead of Python in D. I might take a stab at this myself. I can see lots of improvements to the original code.

Re: Another Phobos2 test

2011-02-07 Thread bearophile
Adam Ruppe: My gut tells me you'd get much better results if you tried to write D in D instead of Python in D. That's really beside the point. The point of the post is that there are some spots where I'd like to see Phobos improved. (And I am willing to write part of the Phobos code I am

Re: Another Phobos2 test

2011-02-07 Thread Jonathan M Davis
On Monday, February 07, 2011 15:34:26 bearophile wrote: Adam Ruppe: My gut tells me you'd get much better results if you tried to write D in D instead of Python in D. That's really beside the point. The point of the post is that there are some spots where I'd like to see Phobos improved.

Re: greatest common divisor implementation

2011-02-07 Thread Andrei Alexandrescu
On 2/7/11 3:18 PM, Matthias Walter wrote: Hi everyone, as I'm currently working on a C++ project which involves gcd computations I had a quick look at phobos' implementation. 1. First thing I saw is that gcd(-3,6) raises an exception, although mathematically it is just 2. Of course checking

Re: Efficient outputting of to-string conversions

2011-02-07 Thread Andrei Alexandrescu
On 2/7/11 4:43 PM, Jonathan M Davis wrote: On Monday 07 February 2011 13:10:09 Tomek Sowiński wrote: Looks like std.conv.to always allocates behind the scenes. It's a shame as the returned string is immediately processed and discarded in my XML writer. Are there plans to include a custom output

Re: Efficient outputting of to-string conversions

2011-02-07 Thread Andrei Alexandrescu
On 2/7/11 5:38 PM, Tomek Sowiński wrote: Jonathan M Davis napisał: On Monday 07 February 2011 13:10:09 Tomek Sowiński wrote: Looks like std.conv.to always allocates behind the scenes. It's a shame as the returned string is immediately processed and discarded in my XML writer. Are there plans

Re: Efficient outputting of to-string conversions

2011-02-07 Thread Andrei Alexandrescu
On 2/7/11 7:25 PM, Andrei Alexandrescu wrote: On 2/7/11 5:38 PM, Tomek Sowiński wrote: Jonathan M Davis napisał: On Monday 07 February 2011 13:10:09 Tomek Sowiński wrote: Looks like std.conv.to always allocates behind the scenes. It's a shame as the returned string is immediately processed

Re: Another Phobos2 test

2011-02-07 Thread bearophile
Jonathan M Davis: Regardless of what language you're programming in, it's generally best to program in the typical paradigms of that language. Trying to contort it to act like another language is _not_ going to result in optimal code. D supports functional style too now. In Bugzilla I

Re: Another Phobos2 test

2011-02-07 Thread Andrew Wiley
On Mon, Feb 7, 2011 at 6:36 PM, bearophile bearophileh...@lycos.com wrote: Jonathan M Davis: Regardless of what language you're programming in, it's generally best to program in the typical paradigms of that language. Trying to contort it to act like another language is _not_ going to

Re: Another Phobos2 test

2011-02-07 Thread Nick Sabalausky
Jonathan M Davis jmdavisp...@gmx.com wrote in message news:mailman.1382.1297122691.4748.digitalmar...@puremagic.com... On Monday, February 07, 2011 15:34:26 bearophile wrote: Adam Ruppe: My gut tells me you'd get much better results if you tried to write D in D instead of Python in D.

Re: Another Phobos2 test

2011-02-07 Thread Nick Sabalausky
Nick Sabalausky a@a.a wrote in message news:iiq4pa$28aa$1...@digitalmars.com... Jonathan M Davis jmdavisp...@gmx.com wrote in message news:mailman.1382.1297122691.4748.digitalmar...@puremagic.com... On Monday, February 07, 2011 15:34:26 bearophile wrote: Adam Ruppe: My gut tells me you'd

Re: Another Phobos2 test

2011-02-07 Thread bearophile
Nick Sabalausky: (Although, I didn't read the OP very closely, so maybe I'm off-base.) They are right, I have done a strategic error. In the original post I have mixed two kinds of very unrelated things: very small suggestions to improve (in my opinion) Phobos, plus some critiques to the D2

Re: Another Phobos2 test

2011-02-07 Thread Jonathan M Davis
On Monday, February 07, 2011 17:11:50 bearophile wrote: Nick Sabalausky: (Although, I didn't read the OP very closely, so maybe I'm off-base.) They are right, I have done a strategic error. In the original post I have mixed two kinds of very unrelated things: very small suggestions to

Re: Another Phobos2 test

2011-02-07 Thread Nick Sabalausky
Jonathan M Davis jmdavisp...@gmx.com wrote in message news:mailman.1384.1297127779.4748.digitalmar...@puremagic.com... I don't even try and program in D like I would in C++. Neither would I. For instance, if I were about to do some coding in C++, I would begin by bashing my head into a brick

Re: Another Phobos2 test

2011-02-07 Thread Adam Ruppe
My implementation http://arsdnet.net/tictactoe.d source: 138 lines, 2420 bytes You can see the byte count is comparable to the python 2, but I have more lines. This reflects my preferences of one line = one instruction. I usually prefer Introduction to Programming style code than functional

Re: High performance XML parser

2011-02-07 Thread Roman Ivanov
On 2/4/2011 4:47 PM, Tomek Sowiński wrote: Michel Fortin napisał: I agree it's important, especially when receiving XML over the network, but I also think it's important to be able to be able to support slicing. Imagine all the memory you could save by just making slices of a

Re: Calling method by name.

2011-02-07 Thread Robert Jacques
On Sat, 05 Feb 2011 13:14:42 -0500, Jacob Carlborg d...@me.com wrote: On 2011-02-04 05:07, Jonathan M Davis wrote: [snip] Most of the good examples of runtime reflection that I'm aware of require user- defined attributes. But there are libraries in Java (and presumably C#) that do stuff

Re: Writing XML

2011-02-07 Thread Russel Winder
I am coming in half way through a thread, apologies if I am saying something that has already been said or is not relevant. On Sun, 2011-02-06 at 22:59 +0100, Rainer Schuetze wrote: Tomek Sowiński wrote: auto xml = xmlWriter(outputRange); xml.comment(books.length, favorite books of

Re: Writing XML

2011-02-07 Thread Russel Winder
A couple of other random thoughts regarding XML: 1. Groovy has XMLSlurper which is an surprisingly fast way of reading XML and processing it as needed. It was developed for fast SAX-underneath, document-based but not-W3C-DOM processing of multi-Gigabyte XML documents.

Windows API Translation

2011-02-07 Thread Andrew Wiley
I'm trying to use the Windows file change notification API from D, and I'm having trouble translating Microsoft's macro-laden signatures into D. I thought I had it figured out, but optlink says otherwise: The original function is this: HANDLE WINAPI FindFirstChangeNotification( __in  LPCTSTR

Re: Windows API Translation

2011-02-07 Thread Vladimir Panteleev
On Tue, 08 Feb 2011 09:10:02 +0200, Andrew Wiley debio...@gmail.com wrote: I'm trying to use the Windows file change notification API from D, and I'm having trouble translating Microsoft's macro-laden signatures into D. I thought I had it figured out, but optlink says otherwise: The original

Re: Windows API Translation

2011-02-07 Thread Lars T. Kyllingstad
On Tue, 08 Feb 2011 01:10:02 -0600, Andrew Wiley wrote: I'm trying to use the Windows file change notification API from D, and I'm having trouble translating Microsoft's macro-laden signatures into D. I thought I had it figured out, but optlink says otherwise: The original function is this:

Re: Windows API Translation

2011-02-07 Thread Lars T. Kyllingstad
On Tue, 08 Feb 2011 09:36:54 +0200, Vladimir Panteleev wrote: On Tue, 08 Feb 2011 09:10:02 +0200, Andrew Wiley debio...@gmail.com wrote: I'm trying to use the Windows file change notification API from D, and I'm having trouble translating Microsoft's macro-laden signatures into D. I

Re: Starting with D

2011-02-07 Thread Peter Alexander
On 6/02/11 11:35 PM, Julius wrote: Hi there, i'm all new to D but not new to programming in general. I'd like to try D but i didn't find a nice tutorial yet. I don't want to read a whole book, I just want to get the basics so I can start. Can you help me find something like that? Best regards,

Re: Setting thread priority

2011-02-07 Thread dennis luehring
Am 06.02.2011 02:58, schrieb Peter Alexander: How do you set the priority of a thread, or otherwise control how much CPU time it gets? depends on operating system - on windows: set the priority to high does not help if your system isn't under pressure ...

Re: higher-order funcs for ranges (with usual interface)

2011-02-07 Thread Lars T. Kyllingstad
On Thu, 03 Feb 2011 19:11:04 +0100, spir wrote: On 02/03/2011 02:25 PM, Lars T. Kyllingstad wrote: On Thu, 03 Feb 2011 13:53:44 +0100, spir wrote: On 02/03/2011 01:17 PM, Lars T. Kyllingstad wrote: Why the reluctance to use template constraints? They're so flexible! :) I cannot stand the

Re: higher-order funcs for ranges (with usual interface)

2011-02-07 Thread spir
On 02/07/2011 09:18 AM, Lars T. Kyllingstad wrote: I cannot stand the is() idiom/syntax ;-) Dunno why. Would happily get rid of it in favor of type-classes (built eg as an extension to current interfaces). For instance, instead of: void func (T) (T t) if

Re: Using D libs in C

2011-02-07 Thread spir
On 02/07/2011 07:53 AM, GreatEmerald wrote: Hmm, no, it won't work right on Linux for some reason. This is the output: /usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../libphobos2.a(deh2_4e7_525.o): In function `_D2rt4deh213__eh_finddataFPvZPS2rt4deh213DHandlerTable':

Re: Using D libs in C

2011-02-07 Thread Jacob Carlborg
On 2011-02-07 07:32, GreatEmerald wrote: All right, found out how to make it compile. There are two ways: 1) Using DMD for the D part, DMC for the C part and combining them. This is the batch file I use for that: dmd -c -lib dpart.d dmc cpart.c dpart.lib phobos.lib 2) Using DMD for the D

Re: Starting with D

2011-02-07 Thread Julius
== Quote from Peter Alexander (peter.alexander...@gmail.com)'s article On 6/02/11 11:35 PM, Julius wrote: Hi there, i'm all new to D but not new to programming in general. I'd like to try D but i didn't find a nice tutorial yet. I don't want to read a whole book, I just want to get the

Re: Using D libs in C

2011-02-07 Thread GreatEmerald
Everything is right from what I can tell. This is the code I use for the D part: module dpart; import std.c.stdio; extern(C): shared int ResultD; int Process(int Value) { printf(You have sent the value: %d\n, Value); ResultD = (Value % 5); return ResultD;

Re: Debugging D?

2011-02-07 Thread Robert Clipsham
On 06/02/11 22:28, Sean Eskapp wrote: == Quote from Robert Clipsham (rob...@octarineparrot.com)'s article On 06/02/11 20:29, Sean Eskapp wrote: Are debug symbols compiled with -gc stored in a separate file? Visual Studio refuses to debug my things, and windbg seems to be remarkably unhelpful.

Re: Using D libs in C

2011-02-07 Thread Steven Schveighoffer
On Mon, 07 Feb 2011 06:42:46 -0500, spir denis.s...@gmail.com wrote: On 02/07/2011 07:53 AM, GreatEmerald wrote: Hmm, no, it won't work right on Linux for some reason. This is the output: /usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../libphobos2.a(deh2_4e7_525.o): In function

Re: Using D libs in C

2011-02-07 Thread Andrej Mitrovic
On 2/7/11, GreatEmerald past...@gmail.com wrote: in Windows I am required to explicitly tell DMD to compile phobos.lib, but not in Linux. Quite odd. Check the sc.ini file in dmd/windows/bin, make sure it has at least this for the LIB variable: LIB=%@P%\..\lib;

Re: Using D libs in C

2011-02-07 Thread Steven Schveighoffer
On Mon, 07 Feb 2011 10:28:41 -0500, GreatEmerald past...@gmail.com wrote: Everything is right from what I can tell. This is the code I use for the D part: module dpart; import std.c.stdio; extern(C): shared int ResultD; int Process(int Value) { printf(You have sent the

Re: Starting with D

2011-02-07 Thread Jacob Carlborg
On 2011-02-07 15:20, Julius wrote: == Quote from Peter Alexander (peter.alexander...@gmail.com)'s article On 6/02/11 11:35 PM, Julius wrote: Hi there, i'm all new to D but not new to programming in general. I'd like to try D but i didn't find a nice tutorial yet. I don't want to read a whole

Re: Using D libs in C

2011-02-07 Thread GreatEmerald
OK, well this is interesting... I managed to compile it but it's quite odd. In order to do that, I added a call to main() in my Process() function, and then added an empty main() in the D part before extern(C). It seems that there are no conflicts, too. Andrej, that line is there. But it really

Re: Starting with D

2011-02-07 Thread Jesse Phillips
Julius Wrote: Hi there, i'm all new to D but not new to programming in general. I'd like to try D but i didn't find a nice tutorial yet. I don't want to read a whole book, I just want to get the basics so I can start. Can you help me find something like that? Best regards, Julius Well

Re: Why non-@property functions don't need parentheses

2011-02-07 Thread %u
It will be fixed at some point, but it hasn't been yet. Oh cool, all right; thanks!

Re: higher-order funcs for ranges (with usual interface)

2011-02-07 Thread Torarin
If you want to use an interface as a concept, you can take kenji's adaptTo module and add this: template conformsTo(T, Interfaces...) { enum conformsTo = AdaptTo!Interfaces.hasRequiredMethods!T; } and use it like this void draw(T)(T shape) if (conformsTo!(T, Shape, Drawable)) This will of

Re: Using D libs in C

2011-02-07 Thread spir
On 02/07/2011 04:32 PM, Steven Schveighoffer wrote: On Mon, 07 Feb 2011 06:42:46 -0500, spir denis.s...@gmail.com wrote: On 02/07/2011 07:53 AM, GreatEmerald wrote: Hmm, no, it won't work right on Linux for some reason. This is the output:

Re: higher-order funcs for ranges (with usual interface)

2011-02-07 Thread spir
On 02/07/2011 01:07 PM, Torarin wrote: If you want to use an interface as a concept, you can take kenji's adaptTo module and add this: template conformsTo(T, Interfaces...) { enum conformsTo = AdaptTo!Interfaces.hasRequiredMethods!T; } and use it like this void draw(T)(T shape) if

Re: Using D libs in C

2011-02-07 Thread Steven Schveighoffer
On Mon, 07 Feb 2011 13:53:14 -0500, spir denis.s...@gmail.com wrote: On 02/07/2011 04:32 PM, Steven Schveighoffer wrote: On Mon, 07 Feb 2011 06:42:46 -0500, spir denis.s...@gmail.com wrote: On 02/07/2011 07:53 AM, GreatEmerald wrote: Hmm, no, it won't work right on Linux for some reason.

Re: std.concurrency immutable classes...

2011-02-07 Thread Tomek Sowiński
Michel Fortin napisał: I just made this pull request today: https://github.com/D-Programming-Language/dmd/pull/ If you want to test it, you're very welcome. Here is my development branch for this feature: https://github.com/michelf/dmd/tree/const-object-ref Thanks for doing this. Is it

Re: std.concurrency immutable classes...

2011-02-07 Thread Michel Fortin
On 2011-02-07 17:11:08 -0500, Tomek Sowiński j...@ask.me said: Michel Fortin napisał: I just made this pull request today: https://github.com/D-Programming-Language/dmd/pull/ If you want to test it, you're very welcome. Here is my development branch for this feature:

[Issue 5447] Should be illegal to throw a non-Throwable

2011-02-07 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5447 Don clugd...@yahoo.com.au changed: What|Removed |Added CC||bugzi...@kyllingen.net ---

[Issue 4069] std.xml.Document.pretty saves empty elements with spaces and line breaks

2011-02-07 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4069 Walter Bright bugzi...@digitalmars.com changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 4598] std.xml check is too restrictive

2011-02-07 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4598 Walter Bright bugzi...@digitalmars.com changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 3835] ref foreach does not work in CTFE

2011-02-07 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3835 Don clugd...@yahoo.com.au changed: What|Removed |Added Keywords||wrong-code --- Comment #12

  1   2   >