Re: idup class

2014-05-16 Thread Joshua Niehus via Digitalmars-d-learn
On Friday, 16 May 2014 at 20:36:37 UTC, Ali Çehreli wrote: My apologies. The code was written for an older version of dmd. The simplest fix is to define the constructor as pure: pure this(int num) { this.num = num; } Ali Ahh great thanks guys. No worries Ali, great book,

idup class

2014-05-16 Thread Joshua Niehus via Digitalmars-d-learn
trying to follow: http://ddili.org/ders/d.en/class.html //--- OSX 10.9 DMD 2.065 module test; class Foo { int num; this(int num) { this.num = num; } Foo dup() const { return new Foo(this.num); } immutable(Foo) idup() const { return new

Re: core.sync.rwmutex example

2014-05-09 Thread Joshua Niehus via Digitalmars-d-learn
Hi Charles, would the following work (just a shot in the dark) ? //--- module test; import std.stdio; import std.concurrency; void spawnedFuncFoo(Tid tid, Tid tidBar) { receive( (int i) { writeln("Foo Received the number ", i); send(tidBar, i, thisTid);

Atom text editor

2014-05-06 Thread Joshua Niehus via Digitalmars-d-learn
FYI: If anyone is using GitHub's text editor "Atom" and would like basic D syntax highlighting: apm init --package ~/.atom/packages/language-d --convert https://github.com/textmate/d.tmbundle https://atom.io/docs/v0.94.0/converting-a-text-mate-bundle