Re: How to test for equality of types?

2012-05-19 Thread Kenji Hara
On Saturday, 19 May 2012 at 18:17:16 UTC, Matthias Walter wrote: On 2012-05-19 15:28, Philippe Sigaud wrote: On Sat, May 19, 2012 at 12:23 PM, Matthias Walter wrote: I would open a bug report with the following code which is a bit smaller than my first wrong version: =

Re: How to test for equality of types?

2012-05-19 Thread Philippe Sigaud
> Using the current git version of dmd I realized that C works! Hence, as > a workaround it can be used by creating a local alias A and subsequently > using A.Alias in the is-expressions. But it seems odd that > > "alias typeof(X).A B;" does not work but > "alias typeof(X) Y; alias Y.A B;" does. >

Re: std.concurrency.send

2012-05-19 Thread japplegame
public: void startLogger(LogConstructorArgs args) { loggerTid = spawn(&loggerThread, args); } void log(string msg, OtherOptions oo) { loggerTid.send(LogMsg(msg, oo)); } void stopLogger() { loggerTid.send(QuitMsg()); } private: Tid loggerTid; struct LogMsg { string msg; Othe

Re: std.concurrency.send

2012-05-19 Thread Nathan M. Swan
On Saturday, 19 May 2012 at 21:13:14 UTC, japplegame wrote: You don't need to mark Tids as shared. Okay. I'm writting logger. Logger is global object and it is running in its own separate thread (for example, writting logs to remote database). My application has several threads and all of them

Re: vibe.d how build it / intall it?

2012-05-19 Thread bioinfornatics
Le dimanche 20 mai 2012 à 01:02 +0200, bioinfornatics a écrit : > Le samedi 19 mai 2012 à 21:40 +0200, David Nadlinger a écrit : > > On Saturday, 19 May 2012 at 17:28:36 UTC, bioinfornatics wrote: > > > Dear, > > > i do not found on vibe.d repository (github) how do a manual > > > install. > > > >

Re: vibe.d how build it / intall it?

2012-05-19 Thread bioinfornatics
Le samedi 19 mai 2012 à 21:40 +0200, David Nadlinger a écrit : > On Saturday, 19 May 2012 at 17:28:36 UTC, bioinfornatics wrote: > > Dear, > > i do not found on vibe.d repository (github) how do a manual > > install. > > > > Since i am a linux user (Fedora) they are any documentation to > > expl

Limit number of compiler error messages

2012-05-19 Thread cal
Is there a way to limit the dmd compiler to outputting just the first few errors it comes across?

Re: std.concurrency.send

2012-05-19 Thread japplegame
You don't need to mark Tids as shared. Okay. I'm writting logger. Logger is global object and it is running in its own separate thread (for example, writting logs to remote database). My application has several threads and all of them want to log something. How to share this global logger between

Re: directory wildcard

2012-05-19 Thread Arne
On Saturday, 19 May 2012 at 03:46:32 UTC, Jay Norwood wrote: Here is a link to some code for the wildArgv single level search that I'm using. https://github.com/jnorwood/file_utils This is roughly how I was using it, related to your example string[] argv; argv ~= r"c:\partial*

Re: Simplified socket creation and handling

2012-05-19 Thread Nathan M. Swan
On Friday, 18 May 2012 at 06:35:59 UTC, Jarl André wrote: I am a Java developer who is tired of java.nio and similar complex socket libraries. In Java you got QuickServer, the ultimate protocol creation centered socket library. You don't have to write any channels and readers and what not. Yo

Re: std.concurrency.send

2012-05-19 Thread Nathan M. Swan
On Saturday, 19 May 2012 at 13:26:20 UTC, japplegame wrote: Multithreading in D confuses me more and more. import std.concurrency; import std.stdio; shared Tid tid; void main() { send(cast(Tid)tid, "Hello, World"); } void worker() { writeln(receiveOnly!string); } shared static this() { ti

Re: vibe.d how build it / intall it?

2012-05-19 Thread David Nadlinger
On Saturday, 19 May 2012 at 17:28:36 UTC, bioinfornatics wrote: Dear, i do not found on vibe.d repository (github) how do a manual install. Since i am a linux user (Fedora) they are any documentation to explain how install it? Did you notice the »Linux« section in the readme? Except for

Re: ProjectEuler problem 35

2012-05-19 Thread Era Scarecrow
On Saturday, 19 May 2012 at 16:43:03 UTC, Jay Norwood wrote: On Wednesday, 16 May 2012 at 09:26:45 UTC, Tiberiu Gal wrote: hi many claim their code solves the problem in order of ms ( c/pascal/haskell code) I used the blockwise parallel sieve described here, and measured nice speed-ups as

Re: How to test for equality of types?

2012-05-19 Thread Matthias Walter
On 2012-05-19 15:28, Philippe Sigaud wrote: > On Sat, May 19, 2012 at 12:23 PM, Matthias Walter > wrote: > >> I would open a bug report with the following code which is a bit smaller >> than my first wrong version: >> >> = > (...) >> pragma(msg, typeof(w.aliasStruct).Alias.st

vibe.d how build it / intall it?

2012-05-19 Thread bioinfornatics
Dear, i do not found on vibe.d repository (github) how do a manual install. Since i am a linux user (Fedora) they are any documentation to explain how install it? after take a look from source tree i think bin/vibe go to /usr/bin bin/views to /usr/share/vibe.d/ source/vibe to /usr/include/d/ i

Re: ProjectEuler problem 35

2012-05-19 Thread Jay Norwood
On Wednesday, 16 May 2012 at 09:26:45 UTC, Tiberiu Gal wrote: hi many claim their code solves the problem in order of ms ( c/pascal/haskell code) I used the blockwise parallel sieve described here, and measured nice speed-ups as described in his blog. It completes calculations within an

Re: moveAt vs opIndex

2012-05-19 Thread maarten van damme
and something partially unrelated, how do you copy a class by value?

Re: ProjectEuler problem 35

2012-05-19 Thread maarten van damme
A huge optimization could be made by storing and int array of already found primes and test all primes smaller then half the to-test number. this will speed up a lot. Another huge improvement could be made with hardcoding everything up to the prime 3 and then iterate with intervals of 2 instead of

std.concurrency.send

2012-05-19 Thread japplegame
Multithreading in D confuses me more and more. import std.concurrency; import std.stdio; shared Tid tid; void main() { send(cast(Tid)tid, "Hello, World"); } void worker() { writeln(receiveOnly!string); } shared static this() { tid = cast(shared)spawn(&worker); } I hate these explicit cast

Re: How to test for equality of types?

2012-05-19 Thread Philippe Sigaud
On Sat, May 19, 2012 at 12:23 PM, Matthias Walter wrote: > I would open a bug report with the following code which is a bit smaller > than my first wrong version: > > = (...) >  pragma(msg, typeof(w.aliasStruct).Alias.stringof); // -> "MyStruct" >  pragma(msg, AliasStruct.Alia

Re: ProjectEuler problem 35

2012-05-19 Thread Stewart Gordon
On 16/05/2012 10:46, Dmitry Olshansky wrote: Don't ever do that. I mean allocating memory in tight cycle. Instead use circular buffer. (just use the same array and wrap indexes) You might as well not use a string representation at all. At the beginning of the loop, calculate the number of d

Re: using deimos.portaudio

2012-05-19 Thread Samuele Carcagno
The missing symbol is a D symbol. You probably have to compile in 'deimos/portaudio.di', so in your 'dmd yourprogram.d' compile command add the full path to the di file: 'dmd yourprogram.d ../path/to/deimos/portaudio.di' Thanks, that was in fact the problem!

Re: How to test for equality of types?

2012-05-19 Thread Matthias Walter
On 2012-05-19 09:05, Philippe Sigaud wrote: > On Fri, May 18, 2012 at 11:51 PM, Simen Kjaeraas > wrote: > >> Because Wrapper!(AliasStruct).Wrap does not exist. And _error_ is not >> equal to any other type. > > Yes. Wrap is included in the complete template name (Wrapper!(Wrap)) > and has no in

Re: moveAt vs opIndex

2012-05-19 Thread maarten van damme
so would it be wrong to make movefront simply change the index the front is pointing at without removing a prime? And I'm coming from a java world so it would make sense to me to create that range as a class that implements a range but in most examples I see everyone using structs instead. what is

unsynchronized access to primitive variables

2012-05-19 Thread luka8088
Hello to all, I would like to know if D guarantees that access to primitive variable is atomic ? I was looking for any source of information that says anything about unsynchronized access to primitive variables. What I want to know is if it is possible (in any way and any OS / hardware) for

Re: How to test for equality of types?

2012-05-19 Thread Philippe Sigaud
On Fri, May 18, 2012 at 11:51 PM, Simen Kjaeraas wrote: > Because Wrapper!(AliasStruct).Wrap does not exist. And _error_ is not > equal to any other type. Yes. Wrap is included in the complete template name (Wrapper!(Wrap)) and has no independent existence. You _can_ get access to it by exposing