Reddit let me to this article walking through an example of Goroutines[1]. I
figured it could look about the same in D. So I set out to learn some
multi-threading. And what I ended up with[2] had an issue.
The mailbox size seems to be extremely small. Currently I have set the size to
10,000 and
Stewart Gordon Wrote:
> On 10/01/2011 13:02, Mitja wrote:
> > I would like to have a template which returns
> > appropriate delegate, something like this:
>
> For what purpose? All you seem to have is a long-winded identity function.
>
>
> > and compiled it like this: dmd mod2.d mod1.d, the pr
Thanks, toDelegate is what I've been looking for.
It still segfaults, though.
The setup:
===
module mod1;
import std.algorithm;
import std.functional;
import std.stdio;
void main( ) {
auto haystack = ["a","b","c"];
auto needle = "b";
auto flt = delegate(string s){return s == needle;
On Mon, 10 Jan 2011 08:38:15 -0800, Dan Olson wrote:
> "Lars T. Kyllingstad" writes:
>
>> On Sun, 09 Jan 2011 22:44:44 -0800, Dan Olson wrote:
>>
>>> I'm exploring D for embedded work as a nice alternative to C/C++ for
>>> the 32-bitters and am finding it has a nice set of features. But,
>>> wh
"Lars T. Kyllingstad" writes:
> On Sun, 09 Jan 2011 22:44:44 -0800, Dan Olson wrote:
>
>> I'm exploring D for embedded work as a nice alternative to C/C++ for the
>> 32-bitters and am finding it has a nice set of features. But, what is
>> the best way handle memory mapped IO? I don't see volati
On Sat, 08 Jan 2011 15:46:01 -0500, Michal Minich
wrote:
On Sat, 08 Jan 2011 20:34:39 +, Sean Eskapp wrote:
if(left == null)
1) write if (left is null) instead if checking for null. Equality
operator is rewritten to a.opEquals(b), which you don't want if you
checking f
Mitja wrote:
I would like to have a template which returns
appropriate delegate, something like this:
So like this?
module mod1;
import std.algorithm;
import std.functional;
import std.stdio;
void main( ) {
auto haystack = ["a","b","c"];
auto needle = "b";
auto flt = (string s){retur
On 10/01/2011 13:02, Mitja wrote:
I would like to have a template which returns
appropriate delegate, something like this:
For what purpose? All you seem to have is a long-winded identity function.
and compiled it like this: dmd mod2.d mod1.d, the program would produce
segmentation fault.
I would like to have a template which returns
appropriate delegate, something like this:
module mod1;
import std.algorithm;
import std.array;
import std.stdio;
template DG(RT, T, F)
{
auto DG(F fun)
{
RT delegate(T p)dg;
dg = fun;
return dg;
}
}
void main()
{
string[] hayst
V Sun, 09 Jan 2011 21:29:32 -0800, Jonathan M Davis wrote:
> On Saturday 08 January 2011 13:16:54 Michal Minich wrote:
>> Use case:
>>
>> import std.variant;
>>
>> void foo (Variant v) {}
>>
>> void main () {
>> Variant v = 3; // ok, this () called v = 3; // ok,
>> opAssing
On Monday 10 January 2011 01:59:34 Lars T. Kyllingstad wrote:
> On Fri, 07 Jan 2011 16:30:24 -0800, Jonathan M Davis wrote:
> > On Friday, January 07, 2011 13:32:42 Ellery Newcomer wrote:
> >> auto a = 1, b = null;
> >>
> >> int a = 1, *b = null;
> >>
> >>
> >> [...]
> >
> > [...]
> >
> > Howe
On Fri, 07 Jan 2011 16:30:24 -0800, Jonathan M Davis wrote:
> On Friday, January 07, 2011 13:32:42 Ellery Newcomer wrote:
>> auto a = 1, b = null;
>>
>> int a = 1, *b = null;
>>
>>
>> [...]
>
> [...]
>
> However, I'm vere suprised that the first one succeeds. I think that it
> should be repor
On Sun, 09 Jan 2011 22:44:44 -0800, Dan Olson wrote:
> I'm exploring D for embedded work as a nice alternative to C/C++ for the
> 32-bitters and am finding it has a nice set of features. But, what is
> the best way handle memory mapped IO? I don't see volatile like in C.
> Is writing asm {} the
13 matches
Mail list logo