On 2013-06-13 19:42, Gary Willoughby wrote:
I get a program crash each time running the following code on MacOS 10.8
(Lion). It seems to run ok on Ubuntu 12.04:
import core.sys.posix.sys.stat;
import core.sys.posix.unistd;
import std.c.stdio;
import std.c.stdlib;
import std.process;
import
Thank you.
You do know that you usually don't have a /home/ directory on
Mac OS X? On Mac OS X it's called /Users/.
Yeah, that was me running the same code on Ubuntu.
BTW, running that on Mac OS X 10.6.3 does not cause a crash.
Although it doesn't seem to print or write anything.
That's the problem i
In fact i have the same problem reading files too. It only reads
files up to a certain amount of bytes then crashes in the same
manner explained above. Again this only happens when the program
runs as a daemon.
On Thursday, 13 June 2013 at 17:13:26 UTC, Adam D. Ruppe wrote:
On Thursday, 13 June 2013 at 17:05:43 UTC, Bruno Deligny wrote:
i tried your test and it doesn't print test.
Maybe we have different versions of the compiler (I think this
behavior recently changed).
Try running dmd without
On Friday, 14 June 2013 at 11:44:45 UTC, Bruno Deligny wrote:
On Thursday, 13 June 2013 at 17:13:26 UTC, Adam D. Ruppe wrote:
On Thursday, 13 June 2013 at 17:05:43 UTC, Bruno Deligny wrote:
i tried your test and it doesn't print test.
Maybe we have different versions of the compiler (I think
Hi,
I want to know if there is a way to pass variadic arguments as
reference? DMD says no!
I wrote the snippet code below, but what I want to do in fact is
assign the sum back to respective variables to use somewhere else.
http://dpaste.dzfl.pl/515edfb8
or
import std.stdio;
import
On Fri, 14 Jun 2013 13:55:29 +0100, MattCoder mattco...@gmail.com wrote:
I want to know if there is a way to pass variadic arguments as
reference? DMD says no!
import std.stdio;
import std.conv;
void sum(double value, double*[] numbers ...){
foreach(ref num; numbers)
On Friday, 14 June 2013 at 13:20:26 UTC, Regan Heath wrote:
import std.stdio;
import std.conv;
void sum(double value, double*[] numbers ...){
foreach(ref num; numbers)
*num = *num + value;
}
void main(){
double a = 1, b = 2, c = 3;
sum(10, a, b, c);
On Friday, 14 June 2013 at 13:24:18 UTC, bearophile wrote:
One way to do it, but beware of template bloat:
import std.stdio;
void sum(TArgs...)(double value, ref TArgs numbers) {
foreach (ref num; numbers) // Note: this is a static
foreach.
num += value;
}
void main() {
On 06/13/2013 09:11 AM, Ali Çehreli wrote:
On 06/12/2013 11:56 PM, gedaiu wrote:
How should i submit this bug?
You can reduce it to a minimal program first and then submit at
http://d.puremagic.com/issues/
Thank you for submitting it:
On Friday, 14 June 2013 at 17:17:46 UTC, bearophile wrote:
Agustin:
Hello, i'm trying to create a library with utilities classes
like containers using Java API.
The problem with this is that most Phobos works with ranges...
Could anyone help me?
Maybe your code has multiple problems. If
There is also one D entry in need to be fixed (with Phobos):
http://rosettacode.org/wiki/Distributed_programming#D
Bye,
bearophile
On Friday, 14 June 2013 at 22:17:16 UTC, bearophile wrote:
http://rosettacode.org/wiki/Distributed_programming#D
It kinda sounds like the description calls for something like
what web.d does:
server:
import arsd.web;
class Foo : ApiProvider {
export string hello(string name) { return
Adam D. Ruppe:
This actual example here uses several thousand lines of library
code but if you think it would fit the description, I'm sure I
can do a basic demo in far fewer lines using nothing but phobos.
I think Rosettacode accepts code that uses libraries that are
free. Take a look at
I'm pretty sure the following is a compiler bug, right? (using
DMD 2.063)
-
module a;
void foo(char)
{
}
-
module b;
enum MyEnum : int { _ }
void foo(MyEnum)
{
}
-
module main;
import a;
import b;
void main()
{
foo(char.init);
foo(MyEnum.init); // [1]
}
Hi,
Sooner I asked about this ([Doubt] Variadic arguments as
reference (Possible?) - -
http://forum.dlang.org/thread/jwujjhjizkovvmbeg...@forum.dlang.org).
In fact my intend was to recreate a feature that I like in
Python, where you can assign variables from a tuple, e.g.:
pos = (10, 20)
On Friday, 14 June 2013 at 22:44:40 UTC, bearophile wrote:
So if you think this task can be implemented quickly using
web.d, then use it :-)
I just think it is really cool that D can do that kind of thing,
so a brief implementation might be good to show people how it is
done.
I'll see
Adam D. Ruppe:
I'll see about slapping something together over the weekend and
posting it here.
If you use a library, please also give the link to the library,
so I can create a nearly empty page on Rosettacode about it. It's
kind of needed.
Bye,
bearophile
MattCoder:
void tupleToVar(A, T...)(A inTuple, ref T listParams){
I think in the C++11 STL a similar function is named tie.
if(!(iinTuple.length))
break;
You have to verify in the function constraint that the lengths
match.
It would be nice if it could appear more like
On Saturday, 15 June 2013 at 00:47:01 UTC, bearophile wrote:
You have to verify in the function constraint that the lengths
match.
In fact that was intentional, because sometimes I just want few
items from a tuple not all.
For example:
auto RGB = tuple(255, 125, 50);
Variant r,g;
On 06/14/2013 10:25 AM, Agustin wrote:
int opApply(int delegate(ref int, ref E) delegation);
Works!, thanks.
I have just completed the translation of the foreach with Structs and
Classes chapter:
http://ddili.org/ders/d.en/foreach_opapply.html
Ali
I'm interested in this kind of functionalities does D have
something on this ?
I thought about something like a eval function that would use
specified algorithms.
something likes this
import std.stdio, std.math, atd.eval;
eval(Real a+b+c^^x=56){
algor.brute;
writeln(Real, , Positive
On Saturday, 15 June 2013 at 01:31:23 UTC, Carlos wrote:
I'm interested in this kind of functionalities does D have
something on this ?
I thought about something like a eval function that would use
specified algorithms.
something likes this
import std.stdio, std.math, atd.eval;
eval(Real
On Saturday, June 15, 2013 01:09:28 TommiT wrote:
I'm pretty sure the following is a compiler bug, right? (using
DMD 2.063)
-
module a;
void foo(char)
{
}
-
module b;
enum MyEnum : int { _ }
void foo(MyEnum)
{
}
-
module main;
import a;
import
I'm converting some code into D while learning D and need some
help to implement this
I have a node of struct { ulong mask; ulong value};
now I need to create a list and insert that node; but first I
don't need duplicates, so, I first check if node already exists
in list.
I also need to
On Saturday, 15 June 2013 at 02:39:31 UTC, Jonathan M Davis wrote:
On Saturday, June 15, 2013 01:09:28 TommiT wrote:
I'm pretty sure the following is a compiler bug, right? (using
DMD 2.063)
-
module a;
void foo(char)
{
}
-
module b;
enum MyEnum : int { _ }
void foo(MyEnum)
27 matches
Mail list logo