>
>
>> DMC = Digital Mars Compiler? Does Mingw/GDC uses that? I think that
> both, g++ and GDC compiled binaries, use the mingw runtime, but I'm not
> sure also.
you right, only dmd uses dmc environment, gdc uses mingw's.
>
> And I don't think it is I/O bound. It is only around 10MB/s, whereas
On 04/16/2012 03:57 AM, Zardoz wrote:
> So, if I need to share a array of 0x1 elements between 3 or more
> threads, how should do it ?
1) The following program starts four threads to fill different parts of
a shared array:
import std.stdio;
import std.concurrency;
import core.thread;
voi
On Mon, 2012-04-16 at 21:03 +0200, Somedude wrote:
[...]
> Did you file a bug report ? If yes, which number ? This is an annoying
> regression in my opinion.
Issue 7919
http://d.puremagic.com/issues/show_bug.cgi?id=7919
--
Russel.
On Tuesday, 17 April 2012 at 01:30:30 UTC, ReneSac wrote:
On Monday, 16 April 2012 at 22:58:08 UTC, Timon Gehr wrote:
On 04/17/2012 12:24 AM, ReneSac wrote:
Windows.
DMC runtime !
DMC = Digital Mars Compiler? Does Mingw/GDC uses that? I think
that both, g++ and GDC compiled binaries, use th
On Monday, 16 April 2012 at 22:58:08 UTC, Timon Gehr wrote:
On 04/17/2012 12:24 AM, ReneSac wrote:
Windows.
DMC runtime !
DMC = Digital Mars Compiler? Does Mingw/GDC uses that? I think
that both, g++ and GDC compiled binaries, use the mingw runtime,
but I'm not sure also.
No. They are not
On Monday, 16 April 2012 at 18:48:52 UTC, Xan wrote:
On Sunday, 15 April 2012 at 19:30:27 UTC, Ali Çehreli wrote:
On 04/15/2012 11:39 AM, Xan wrote:
> On Sunday, 15 April 2012 at 11:23:37 UTC, John Chapman wrote:
>> On Sunday, 15 April 2012 at 11:16:43 UTC, Xan wrote:
>>>
>>> int main(string []
On Monday, 16 April 2012 at 14:50:43 UTC, sclytrack wrote:
struct AB
{
int a;
int b;
int [] numbers;
}
int main()
{
int a = 300;
const int [] numbers = new int[2];
const AB c = {a,20, numbers}; // line 66
writeln(c);
return 0
ixid:
Memoizing a templated version of a function doesn't seem to
work,
A template isn't a function, it's just a recipe to define a
function given one or more compile-time values or types. So
memoize works if you instantiate in some way the template:
import std.functional;
int test(int n)
On 4/17/12, ixid wrote:
> Memoizing a templated version of a function doesn't seem to work,
> how would I do it properly?
Instantiate the template first. Either:
n = memoize!(test2!int)(n);
or:
alias test2!int itest;
n = memoize!itest(n);
Actually I'm a little surprised this doesn't work:
mem
Memoizing a templated version of a function doesn't seem to work,
how would I do it properly? For example:
int test(int n)
{
return //Do memoizable stuff
}
T test2(T)(T n)
{
return //Do memoizable stuff
}
void main()
{
n = memoize!test(n); //is fine
n = test2(n); //is fine
On Monday, 16 April 2012 at 23:58:29 UTC, Michaël Larouche wrote:
I've given a second chance to D after watching D videos from
Lang.NEXT 2012. As a first look, I wanted to try generate
serialization code at compile time.
Here's the class:
class MyObject
{
public int m_id;
public Data m
I believe I have searched everywhere, but I can barely find any documentation
on exceptions/errors/throwables and I would love a link on how to inherit from
them to create my own ones.
--
alexhairyman
On Tuesday, 17 April 2012 at 00:00:57 UTC, Andrej Mitrovic wrote:
On 4/17/12, darkstalker wrote:
It possible to have 'p' passed by reference?
Yes and the answer is in the question:
foreach (ref p; a)
p = 42;
thanks, it works
On 04/16/2012 04:56 PM, darkstalker wrote:
i have this example program:
---
void main()
{
int[3] a;
foreach (p; a)
p = 42;
writeln(a);
}
---
after running it, i expect to get [42, 42, 42] but instead i get [0, 0,
0] (i know that you can do a[] = 42, it's just a trivial example). So it
seems tha
On 4/17/12, darkstalker wrote:
> It possible to have 'p' passed by reference?
Yes and the answer is in the question:
foreach (ref p; a)
p = 42;
i have this example program:
---
void main()
{
int[3] a;
foreach (p; a)
p = 42;
writeln(a);
}
---
after running it, i expect to get [42, 42, 42] but instead i get
[0, 0, 0] (i know that you can do a[] = 42, it's just a trivial
example). So it seems that you cannot write int
On 4/17/12, Somedude wrote:
> But running the exe crashes immediately at execution with "unauthorized
> instruction". Why ?
That's the old exectuable leftover from the previous compile. RDMD
generates the exe in a temporary folder with a random name and runs it
immediately. Because the main funct
Le 16/04/2012 21:51, Andrej Mitrovic a écrit :
> On 4/16/12, Somedude wrote:
>> OPTLINK : Warning 134: No Start Address
>
> This means you're missing a void main or int main function. You can
> pass --main to rdmd to add it automatically (useful when e.g.
> unittesting).
All right, now I have a
On 04/17/2012 12:24 AM, ReneSac wrote:
On Monday, 16 April 2012 at 07:28:25 UTC, Andrea Fontana wrote:
Are you on linux/windows/mac?
Windows.
DMC runtime !
My main question is now *WHY* D is slower than C++ in this program? The
code is identical (even the same C functions)
No. They are
On Monday, 16 April 2012 at 07:28:25 UTC, Andrea Fontana wrote:
Are you on linux/windows/mac?
Windows.
My main question is now *WHY* D is slower than C++ in this
program? The code is identical (even the same C functions) in the
performance-critical parts, I'm using the "same" compiler backen
On 04/16/2012 11:43 PM, bearophile wrote:
Timon Gehr:
auto c = AB(a, 20, numbers)<=>AB c = {a, 20, numbers};
auto c = const(AB)(a, 20, numbers)<=>const AB c = {a, 20, numbers};
I think your second equivalence is wrong:
const c = AB(a, 20, numbers)<=>const AB c = {a, 20, numbers};
This is what I am actually doing at the moment, but I thougth
that in a modern language like D, it is possible to have non-null
references to avoid such constructs with assert.
My last hope was that an explicit ref would allow me both:
non-null references _and_ lvalues, at least for objects.
T
Timon Gehr:
> auto c = AB(a, 20, numbers) <=> AB c = {a, 20, numbers};
>
> auto c = const(AB)(a, 20, numbers) <=> const AB c = {a, 20, numbers};
I think your second equivalence is wrong:
const c = AB(a, 20, numbers) <=> const AB c = {a, 20, numbers};
Bye,
bearophile
Namespace:
how can i rebuild such a behavior?
class Foo {
public:
Foo(const Bar& b) {
In D struct instances are values, and you can manage them as
values, or as a pointer to value (or pointer to pointer to value,
etc). In D class instances are always managed by reference, and
such referenc
On 04/16/2012 11:25 PM, Namespace wrote:
Hi,
I have a few questions about D and could use some help. For
instance, how can i rebuild such a behavior?
class Foo {
public:
Foo(const Bar& b) {
At C++ you can ensure that a reference is requested and must not
null.
Nevertheless lvalues are function
On Apr 16, 2012 5:29 PM, "Namespace" wrote:
> That case I would like to prevent, but at the same time allow
> Ivalues. How does that work in D classes?
> As far as I know this operates with structs, but shouldn't it be
> possible with classes and objects too?
I would recommend a precondition. I
Hi,
I have a few questions about D and could use some help. For
instance, how can i rebuild such a behavior?
class Foo {
public:
Foo(const Bar& b) {
At C++ you can ensure that a reference is requested and must not
null.
Nevertheless lvalues are functional, which means Foo(Bar(42))
would operate
On 04/16/2012 06:49 PM, bearophile wrote:
sclytrack:
...
Shouldn't the code above accept the const(int []) ?
I think it is a bug that it does not.
I think you are asking too much to the poor type system. You are giving
a const dynamic array (that's not a value) to assign it to a mutab
On 04/16/2012 08:15 PM, Eyyub wrote:
On Friday, 13 April 2012 at 22:23:25 UTC, Ali Çehreli wrote:
On 04/13/2012 03:07 PM, Eyyub wrote:
Hai,
After watching Walter's video at Lang.NEXT, I have wanted to know how
contracts inheritance works.
In the following code, I don't understand why foo.bar(
On 4/16/12, Somedude wrote:
> OPTLINK : Warning 134: No Start Address
This means you're missing a void main or int main function. You can
pass --main to rdmd to add it automatically (useful when e.g.
unittesting).
On 04/16/2012 08:15 PM, sclytrack wrote:
const numbers = new int[2];
const c = const(AB)(a, 20, numbers);
writeln(c);
}
Bye,
bearophile
That's exactly what I needed, thanks.
Seems to be forwarded to the constructor if there is one.
(untested code)
struct B
{
int [] _list;
I'm trying to compile a D source on win32 with DMD 2.059, and I get this:
PS E:\DigitalMars\dmd2\samples> rdmd xinoksort.d
OPTLINK (R) for Win32 Release 8.00.12
Copyright (C) Digital Mars 1989-2010 All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
OPTLINK : Warning 23: No Stack
OP
Le 15/04/2012 20:40, Russel Winder a écrit :
> On Sun, 2012-04-15 at 16:04 +0200, Artur Skawina wrote:
> [...]
>> (my old GDC needs the explicit "function", no idea if newer
>> frontends still require that)
>
> OK, works for me with GDC as well, DMD is broken! I'll file a bug
> report.
>
Did you
On 04/16/2012 11:48 AM, Xan wrote:
On Sunday, 15 April 2012 at 19:30:27 UTC, Ali Çehreli wrote:
On 04/15/2012 11:39 AM, Xan wrote:
> On Sunday, 15 April 2012 at 11:23:37 UTC, John Chapman wrote:
>> On Sunday, 15 April 2012 at 11:16:43 UTC, Xan wrote:
>>>
>>> int main(string [] args)
>>> {
>>> au
Uf!, it's more than I can process
It's really a **complicated** thing to do that in D.
On Monday, 16 April 2012 at 07:50:28 UTC, Denis Shelomovskij
wrote:
15.04.2012 0:31, Xan написал:
On Saturday, 14 April 2012 at 19:40:06 UTC, Aleksandar
Ružičić wrote:
On Saturday, 14 April 2012 at 19:17
On Sunday, 15 April 2012 at 19:30:27 UTC, Ali Çehreli wrote:
On 04/15/2012 11:39 AM, Xan wrote:
> On Sunday, 15 April 2012 at 11:23:37 UTC, John Chapman wrote:
>> On Sunday, 15 April 2012 at 11:16:43 UTC, Xan wrote:
>>>
>>> int main(string [] args)
>>> {
>>> auto alg = Algorisme!(int,int);
>>
>>
On 2012-04-16 19:04, Paul wrote:
Is installing and using DWT really this involved? I spent hours figuring
out github, cloning the repository (I think). The git submodule commands
never ran w/o errors. I was quite frustrated.
Thanks for any additional comments. Do you know of a tutorial that deal
On Friday, 13 April 2012 at 22:23:25 UTC, Ali Çehreli wrote:
On 04/13/2012 03:07 PM, Eyyub wrote:
Hai,
After watching Walter's video at Lang.NEXT, I have wanted to
know how
contracts inheritance works.
In the following code, I don't understand why foo.bar(2)
works...but
with the sames cont
const numbers = new int[2];
const c = const(AB)(a, 20, numbers);
writeln(c);
}
Bye,
bearophile
That's exactly what I needed, thanks.
On Sunday, 8 April 2012 at 10:26:10 UTC, Jacob Carlborg wrote:
On 2012-04-07 23:34, vmars316 wrote:
On Saturday, 7 April 2012 at 12:25:27 UTC, Jacob Carlborg
wrote:
On 2012-04-06 17:37, Jesse Phillips wrote:
Building stand alone executables with DWT works great. DWT
doesn't
depend on any thi
sclytrack:
struct AB
{
int a;
int b;
int [] numbers;
}
int main()
{
int a = 300;
const int [] numbers = new int[2];
const AB c = {a,20, numbers}; // line 66
writeln(c);
return 0;
}
-debug
-unitte
On Monday, 16 April 2012 at 09:16:09 UTC, Kagamin wrote:
Do you use FILE_FLAG_SEQUENTIAL_SCAN too?
The std.file.write does use FILE_FLAG_SEQUENTIAL_SCAN
void write(in char[] name, const void[] buffer)
my experimental code to create the empty file also uses it, but
it doesn't write any buffers
struct AB
{
int a;
int b;
int [] numbers;
}
int main()
{
int a = 300;
const int [] numbers = new int[2];
const AB c = {a,20, numbers}; // line 66
writeln(c);
return 0;
}
-debug
-unittest
src/main
On 04/15/2012 11:04 PM, Simon wrote:
On 15/04/2012 21:07, Trass3r wrote:
Am 15.04.2012, 21:20 Uhr, schrieb sclytrack :
this( const size_t step) const
{
this.step = step;
}
Error: cannot modify const/immutable/inout expression this.step
Is this the expected behavior? Thanks.
Yep.
No it
On Sat, 14 Apr 2012 22:31:40 -0400, Jonathan M Davis
wrote:
On Sunday, April 15, 2012 04:21:09 Joseph Rushton Wakeling wrote:
On 14/04/12 23:03, q66 wrote:
> He also uses a class. And -noboundscheck should be automatically
induced
> by
> -release.
... but the methods are marked as final
El Sun, 15 Apr 2012 23:05:55 +0200, Kapps escribió:
> On Saturday, 14 April 2012 at 10:48:16 UTC, Luis Panadero Guardeño
> wrote:
>> What is the status of "shared" types ?
>>
>> I try it with gdmd v4.6.3
>> And I not get any warring/error when I do anything over a shared
>> variable
>> without usi
On Sun, 2012-04-15 at 23:36 +0200, Somedude wrote:
[...]
> It works here (DMD 2.058 win32), even without "function".
It also works for me with 2.058 on x86_64 Linux. So the conclusion is
that 2.059 is broken. I'll update the issue I set up for this.
--
Russel.
===
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
Do you use FILE_FLAG_SEQUENTIAL_SCAN too?
15.04.2012 0:31, Xan написал:
On Saturday, 14 April 2012 at 19:40:06 UTC, Aleksandar Ružičić wrote:
On Saturday, 14 April 2012 at 19:17:52 UTC, Xan wrote:
Hi,
I try to translate a script I wrote in Fantom [www.fantom.org]. In my
script, I have a type "Tag" defined as a triple of:
- String (the
Are you on linux/windows/mac?
On Saturday, 14 April 2012 at 19:05:40 UTC, ReneSac wrote:
I have this simple binary arithmetic coder in C++ by Mahoney
and translated to D by Maffi. I added "notrow", "final" and
"pure" and "GC.disable" where it was possible, but that didn't
made much difference
51 matches
Mail list logo