On Tuesday, 3 June 2014 at 05:40:44 UTC, Edwin van Leeuwen wrote:
On Monday, 2 June 2014 at 23:44:01 UTC, Rene Zwanenburg wrote:
On Monday, 2 June 2014 at 20:09:12 UTC, Edwin van Leeuwen
wrote:
As you may have guessed, a workaround is to copy the iteration
variable yourself:
unittest {
siz
On 03/06/14 05:57, Charles Parker wrote:
Chris, that was it I needed to do both things. It then complained
about trying to allocate the in_edges and out_edges arrays in the
constructor which is how I thought dynamic arrays are allocated
on the heap. I removed the 2 new statements, and both compi
On Monday, 2 June 2014 at 23:44:01 UTC, Rene Zwanenburg wrote:
On Monday, 2 June 2014 at 20:09:12 UTC, Edwin van Leeuwen wrote:
As you may have guessed, a workaround is to copy the iteration
variable yourself:
unittest {
size_t delegate()[size_t] events;
foreach(_i; 1..4 ) {
au
On Tuesday, 3 June 2014 at 03:35:46 UTC, Chris Cain wrote:
On Tuesday, 3 June 2014 at 03:17:10 UTC, Charles Parker wrote:
...
Thanx for any help - Charlie
Well one thing is that you don't need the type parameters on the
this function. You're basically creating a templated this inside
the templ
On Tuesday, 3 June 2014 at 03:17:10 UTC, Charles Parker wrote:
...
Thanx for any help - Charlie
Well one thing is that you don't need the type parameters on the
this function. You're basically creating a templated this inside
the templated class which is not what you want.
try this:
clas
On Tue, Jun 03, 2014 at 03:17:09AM +, Charles Parker via
Digitalmars-d-learn wrote:
> ./graph_structures.d(124): Error: class graph_structures.node(D,
> E) is used as a type
>
> I have no idea what this means:(
It usually means you tried to use an uninstantiated template as a type.
[...]
>
./graph_structures.d(124): Error: class graph_structures.node(D,
E) is used as a type
I have no idea what this means:( Once we create a class, the
textbook examples show its use as a type which I believe is what
C++ & Java allow. Here's some code:
class node(D, E) {
int nid;
D data;
On Monday, 2 June 2014 at 18:46:18 UTC, Joseph Rushton Wakeling
via Digitalmars-d-learn wrote:
I'm really sorry, Chris, I was obviously mixing things up: on
rereading, the person in the earlier forum discussion (not PR
thread) who talks about porting from Java wasn't you. I'm very
glad to be c
On Monday, 2 June 2014 at 20:09:12 UTC, Edwin van Leeuwen wrote:
I'm probably missing something basic, but I am confused by what
is going on in the following code.
unittest {
size_t delegate()[size_t] events;
foreach( i; 1..4 ) {
events[i] = { return i; };
}
writeln( eve
On Monday, 2 June 2014 at 22:18:39 UTC, bioinfornatics wrote:
Hi,
I would like store the delegate to another var but when i try i
get:
testTraitsWithDelegate.d(13): Error: expression template
__lambda2 is void and has no value
I do not want to run it only to save the «function» somewhere.
-
Hi,
I would like store the delegate to another var but when i try i
get:
testTraitsWithDelegate.d(13): Error: expression template
__lambda2 is void and has no value
I do not want to run it only to save the «function» somewhere.
--- CODE
import std.stdio;
import std.typec
On Monday, 2 June 2014 at 20:23:12 UTC, Steven Schveighoffer
wrote:
On Mon, 02 Jun 2014 15:58:01 -0400, Steven Schveighoffer
wrote:
I'm trying to think of a way to do this without loops, but not
sure.
I'm surprised, I looked for some kind of "apply" function like
map, but just calls some
On Mon, 02 Jun 2014 15:58:01 -0400, Steven Schveighoffer
wrote:
I'm trying to think of a way to do this without loops, but not sure.
I'm surprised, I looked for some kind of "apply" function like map, but
just calls some function with each element in the range.
Something like this woul
I'm probably missing something basic, but I am confused by what
is going on in the following code.
unittest {
size_t delegate()[size_t] events;
foreach( i; 1..4 ) {
events[i] = { return i; };
}
writeln( events[1]() ); // This outputs 3
assert( events[1]() == 1 );
}
I
Sorry, I am embarassed to say I've just tried the for equivalent
and it works with t[i] as the iterating variable.
import std.stdio;
int[3] t;
void foo (int i) {
if (i == 3)
writef("%s\n", t);
else for (t[i] = 0; t[i] < 3; t[i]++)
foo(i+1);
}
void main() {
foo(0);
}
Sorry, yet
On Mon, 02 Jun 2014 15:47:02 -0400, Logesh Pillay
wrote:
Issue has nothing to do with recursion. That's only where I keep seeing
it.
eg a function to generate combinations.
import std.stdio;
int[3] t;
void foo (int i) {
if (i == 3)
writef("%s\n", t);
else foreach (x; 0 .. 3)
Issue has nothing to do with recursion. That's only where I keep
seeing it.
eg a function to generate combinations.
import std.stdio;
int[3] t;
void foo (int i) {
if (i == 3)
writef("%s\n", t);
else foreach (x; 0 .. 3) {
t[i] = x;
foo(i+1);
}
}
void main() {
foo(0);
}
I
On Monday, 2 June 2014 at 19:21:07 UTC, Logesh Pillay wrote:
It is common in a recursive function to amend a global array
using the function parameter to refer to the element eg
int[10];
void foo (int i) {
foreach (x; 0 .. 9) {
t[i] = x;
foo ();
C in a for loop allows use of t[i]
On Mon, 02 Jun 2014 15:21:06 -0400, Logesh Pillay
wrote:
It is common in a recursive function to amend a global array using the
function parameter to refer to the element eg
int[10];
void foo (int i) {
foreach (x; 0 .. 9) {
t[i] = x;
foo ();
C in a for loop allows use of t
It is common in a recursive function to amend a global array
using the function parameter to refer to the element eg
int[10];
void foo (int i) {
foreach (x; 0 .. 9) {
t[i] = x;
foo ();
C in a for loop allows use of t[i] directly as the iterating
variable so you don't need the dumm
Of course, in the first line I meant to say
int[10] t;
On 2014-06-02 09:57, Steven Schveighoffer wrote:
On Mon, 02 Jun 2014 10:37:07 -0400, captaindet <2k...@gmx.net> wrote:
On 2014-06-02 08:03, MrSmith wrote:
On Monday, 2 June 2014 at 06:56:54 UTC, captaindet wrote:
hi,
i stumbled upon something weird - it looks like a bug to me but
maybe it is
On 02/06/14 08:57, Chris Cain via Digitalmars-d-learn wrote:
On Sunday, 1 June 2014 at 14:22:31 UTC, Joseph Rushton Wakeling via
Digitalmars-d-learn wrote:
I missed the debate at the time, but actually, I'm slightly more concerned
over the remark in that discussion that the new uniform was porte
I have a couple of functions that you may find useful for
comparing floats.
https://github.com/nomad-software/dunit/blob/master/source/dunit/toolkit.d#L42
https://github.com/nomad-software/dunit/blob/master/source/dunit/toolkit.d#L134
On 2014-06-02 08:08, "Marc Schütz" " wrote:
On Monday, 2 June 2014 at 06:56:54 UTC, captaindet wrote:
hi,
i stumbled upon something weird - it looks like a bug to me but
maybe it is a "feature" that is unclear to me.
so i know i can declare function and delegate pointers at module level.
for f
Hello all,
Since D is COM compatible. How do I port my dll or lib or obj to
Windows' COM+ Server? it will be great if it can be done.
Thanks
On Monday, 26 May 2014 at 15:42:56 UTC, JJDuck wrote:
On Monday, 26 May 2014 at 15:41:03 UTC, bioinfornatics wrote:
On Monday, 26 May 2014 at 15:33:45 UTC, JJDuck wrote:
vibe.d is root an open-source project ? on about page is wrote
is
licensed under MIT which are an open source license.
On Mon, 02 Jun 2014 10:37:07 -0400, captaindet <2k...@gmx.net> wrote:
On 2014-06-02 08:03, MrSmith wrote:
On Monday, 2 June 2014 at 06:56:54 UTC, captaindet wrote:
hi,
i stumbled upon something weird - it looks like a bug to me but maybe
it is a "feature" that is unclear to me.
so i know
On 2014-06-02 08:08, "Marc Schütz" " wrote:
On Monday, 2 June 2014 at 06:56:54 UTC, captaindet wrote:
hi,
i stumbled upon something weird - it looks like a bug to me but maybe it is a
"feature" that is unclear to me.
so i know i can declare function and delegate pointers at module level.
for
On 2014-06-02 08:03, MrSmith wrote:
On Monday, 2 June 2014 at 06:56:54 UTC, captaindet wrote:
hi,
i stumbled upon something weird - it looks like a bug to me but maybe it is a
"feature" that is unclear to me.
so i know i can declare function and delegate pointers at module level.
for function
On 06/02/2014 04:30 PM, captaindet wrote:
This doesn't work, because a delegate needs a context it can capture,
which is available only inside of a function.
so the real explanation is that a module as such has no context. much of
the module design has the look and feel as if it were some so
I tried to compile it with dmd and there are some problem with D1
code, so I will try to port it to D2. I will post the result if I
can successfully port it.
On 2014-06-02 08:08, "Marc Schütz" " wrote:
On Monday, 2 June 2014 at 06:56:54 UTC, captaindet wrote:
hi,
i stumbled upon something weird - it looks like a bug to me but
maybe it is a "feature" that is unclear to me.
so i know i can declare function and delegate pointers at module level.
for f
On Monday, 2 June 2014 at 06:56:54 UTC, captaindet wrote:
hi,
i stumbled upon something weird - it looks like a bug to me but
maybe it is a "feature" that is unclear to me.
so i know i can declare function and delegate pointers at
module level.
for function pointers, i can initialize with a
Also second question is what are better to use, current template
recursion-based code or rewrite it to CTFE ?
On Monday, 2 June 2014 at 06:56:54 UTC, captaindet wrote:
hi,
i stumbled upon something weird - it looks like a bug to me but
maybe it is a "feature" that is unclear to me.
so i know i can declare function and delegate pointers at
module level.
for function pointers, i can initialize with a
On Sunday, 1 June 2014 at 12:11:22 UTC, Ivan Kazmenko wrote:
I second the thought that reproducibility across different
versions is an important feature of any random generation
library. Sadly, I didn't use a language yet which supported
such a flavor of reproducibility for a significant perio
Try to report as a bug.
Am 02.06.2014 12:09, schrieb Timon Gehr:
On 06/02/2014 09:06 AM, dennis luehring wrote:
i want to port this C++ code to good/clean D and have no real idea how
to start
contains 2 templates - a slice like and a binary reader for an slice
main idea was to copy the immutablity of the slice data to
Having read more of the debate, I think coverage is more
important than reproducibility. From my point of view, I'm not
sure if there's much point in giving reproducible wrong answers.
On 06/02/2014 09:06 AM, dennis luehring wrote:
i want to port this C++ code to good/clean D and have no real idea how
to start
contains 2 templates - a slice like and a binary reader for an slice
main idea was to copy the immutablity of the slice data to the reader
http://pastebin.com/XX2yhm8D
On Sunday, 1 June 2014 at 09:18:50 UTC, bearophile wrote:
Atila Neves:
D:
struct Foo { int i; int j; }
extern(C++) void useFoo(ref const(Foo) foo);
C++:
struct Foo { int i; int j; };
void useFoo(const Foo& foo) { ... }
This doesn't look very safe because D const is transitive
i want to port this C++ code to good/clean D and have no real idea how
to start
contains 2 templates - a slice like and a binary reader for an slice
main idea was to copy the immutablity of the slice data to the reader
http://pastebin.com/XX2yhm8D
the example compiles fine with http://gcc.godb
On Sunday, 1 June 2014 at 14:22:31 UTC, Joseph Rushton Wakeling
via Digitalmars-d-learn wrote:
I missed the debate at the time, but actually, I'm slightly
more concerned over the remark in that discussion that the new
uniform was ported from java.util.Random. Isn't OpenJDK
GPL-licensed ... ?
hi,
i stumbled upon something weird - it looks like a bug to me but maybe it is a
"feature" that is unclear to me.
so i know i can declare function and delegate pointers at module level.
for function pointers, i can initialize with a lambda.
BUT for delegates i get an error - see below
i found
45 matches
Mail list logo