Wait, you have a template mixin inside of Foo which passes Foo
to it? I don't
know if you can get away with that or not, since you're trying
to pass a type
to a template while you're adding stuff to it via that
template. So, the type
is incomplete. I'm willing to be that that's your problem, but
On Sunday, 24 June 2012 at 23:04:14 UTC, Sean Kelly wrote:
On Jun 24, 2012, at 11:40 AM, "Jarl André"
"@puremagic.com
wrote:
Is it wrong to badge myself with asynchronous sockets? :)
Nope. It's pretty weird stuff if you've never done event-based
programming before.
I shouldn't glorify m
Hello! I'm learning D, and wrote some sample codes with D.
I wrote: http://ideone.com/VY7ES
It failed to compile; I got 2 errors:
main.d(19): Error: constructor
main.carry!(int,int,int,int,int).carry.this (int delegate(int,
int _param_0, int _param_1, int _param_2) _f) is not callable
usin
On Sunday, 24 June 2012 at 21:52:36 UTC, bearophile wrote:
Just a recent little coding story.
Maybe you should post this to the main newsgroup.
I would prefer a switch that does this per scope, i.e:
void foo()
{
pragma(check, int_overflow);
// check only in this function
}
Thanks a lot for the explanation.
Jerome
On 25/06/12 02:54, bearophile wrote:
Jerome BENOIT:
How come as ``integral numbers (will not be) overflow'' ?
Multiprecision numbers allocate on the heap when they become large (or they
always allocate on the heap). This has a significant performance
Jerome BENOIT:
How come as ``integral numbers (will not be) overflow'' ?
Multiprecision numbers allocate on the heap when they become
large (or they always allocate on the heap). This has a
significant performance impact. There are many situations where
Multiprecision numbers are handy, but
On Sunday, June 24, 2012 19:03:17 Namespace wrote:
> > This might work:
> >
> > this(U)(U obj)
> >
> > if(is(U : T) && !is(U == typeof(null)))
> >
> > {
> > }
> >
> >
> > - Jonathan M Davis
>
> Interesting. With or wihtout that, if i add a method to Foo it
> prints "Stack overflow" also.
On 25/06/12 01:51, bearophile wrote:
Jerome BENOIT:
Is there any GMP port for D ?
Jerome
I don't know.
(But GMP is NOT a solution to the problems shown in that story).
How come as ``integral numbers (will not be) overflow'' ?
Bye,
bearophile
Jerome BENOIT:
Is there any GMP port for D ?
Jerome
I don't know.
(But GMP is NOT a solution to the problems shown in that story).
Bye,
bearophile
Le dimanche 24 juin 2012 à 22:38 +0200, bioinfornatics a écrit :
> Hi,
>
> I want to copy a file with executable mode (755 on UNIX) to another
> location. when i use std.file.copy original is into 755 bot not the
> copied file!
>
> The are a way to save the mode ?
>
> thanks
>
fixed by doing
On Jun 24, 2012, at 11:40 AM, "Jarl André"
"@puremagic.com wrote:
>
> Is it wrong to badge myself with asynchronous sockets? :)
Nope. It's pretty weird stuff if you've never done event-based programming
before.
On 24/06/12 23:52, bearophile wrote:
And D is too much unsafe for such kind of programs, because integral numbers
can silently overflow.
Is there any GMP port for D ?
Jerome
Just a recent little coding story.
Python is a good language for "exploratory programming", because
the programs are succinct, it's flexible, its data structures are
easy to use and good, there are already written modules to do
most things, there are very easy to use libraries to plot results
The thing that developers should come from a C/C++ background
is totally not acceptable.
Yes. I also think the documentation shouldn't assume familiarity
with C++.
So we need to add a "Introduction to D for Java developers"
etc, that makes it easier to start hacking right away.
My question
Hi,
I want to copy a file with executable mode (755 on UNIX) to another
location. when i use std.file.copy original is into 755 bot not the
copied file!
The are a way to save the mode ?
thanks
On Sunday, 24 June 2012 at 19:10:55 UTC, Tobias Pankrath wrote:
* add -g and -debug=splat (or any other keywords) to the build
command
You don't need a keyword -debug is sufficient. To make the
binary work with a debugger you does not even need -debug, only
-g. -debug only includes code that
* add -g and -debug=splat (or any other keywords) to the build
command
You don't need a keyword -debug is sufficient. To make the binary
work with a debugger you does not even need -debug, only -g.
-debug only includes code that's in a debug-block.
* gdb bin/SimpleServer
* continue (on bre
On 06/24/2012 02:53 AM, Dmitry Olshansky wrote:
I think no, as any with operation involving GC. For instance while you
are removing elements table may decide to rehash itself and that means
it may trigger allocation.
okay, it looks like my [inherited] code is using aa's to map D objects
to C
I have now completely and totally replaced the inner contents of
my server library with modified Splat code. It ran so much faster
that I was actually afraid I had got it wrong. It seemed not be
any wrong with it, so adding Splat actually made it super kidding
me fast. I have now learned a few
On Thursday, 17 May 2012 at 18:55:57 UTC, Jarl André wrote:
On Thursday, 17 May 2012 at 18:36:22 UTC, Jarl André wrote:
On Thursday, 17 May 2012 at 14:08:27 UTC, Vincent wrote:
On Sunday, 25 March 2012 at 17:50:45 UTC, Andrea Fontana
wrote:
Hope it's clear...
Nope, it's something like chess
This might work:
this(U)(U obj)
if(is(U : T) && !is(U == typeof(null)))
{
}
- Jonathan M Davis
Interesting. With or wihtout that, if i add a method to Foo it
prints "Stack overflow" also.
http://dpaste.dzfl.pl/91dad66c
Can you explain that?
On Sunday, 24 June 2012 at 13:16:53 UTC, simendsjo wrote:
import std.exception;
import std.traits;
struct Ranged(T, T min, T max) {
T _value = min;
typeof(this) opAssign(V : T)(V value) {
enforce(value >= min);
enforce(value <= max);
_value = value;
return
On Jun 23, 2012, at 9:31 AM, simendsjo wrote:
> On Sat, 23 Jun 2012 18:29:37 +0200, simendsjo wrote:
>
>>auto tid = spawnLinked(&writer);
>
> auto tid = spawn(&writer); of course
With spawnLinked the child will send a termination message to the parent as
well.
import std.exception;
import std.traits;
struct Ranged(T, T min, T max) {
T _value = min;
typeof(this) opAssign(V : T)(V value) {
enforce(value >= min);
enforce(value <= max);
_value = value;
return this;
}
alias _value this;
}
void f(int i) {
On Sunday, June 24, 2012 14:57:37 Namespace wrote:
> > My guess is that you've got something recursive going on
> > (possibly a recursive
> > template instantiation, though I don't see any reason why that
> > would occur),
> > which causes it to eat up more and more memory, until the OS
> > kills i
On Sunday, 24 June 2012 at 11:59:07 UTC, bioinfornatics wrote:
dear,
A D user report to me that dbuilder fail to build i.e build log:
http://pastebin.com/LaCn6ZxU
The problem i have any problem to build the same code on *NIX
then i
tink it is a phobos bug to windows side, no ?
i have try wi
My guess is that you've got something recursive going on
(possibly a recursive
template instantiation, though I don't see any reason why that
would occur),
which causes it to eat up more and more memory, until the OS
kills it.
Report it as a dmd bug: http://d.puremagic.com
- Jonathan M Davis
On Sunday, 24 June 2012 at 12:34:28 UTC, Jonathan M Davis wrote:
On Sunday, June 24, 2012 14:24:48 Roman D. Boiko wrote:
Yeah, but I wonder that such a core feature as AA doesn't
support
this use case better (I mean more efficiently).
The current AA implementation is quite buggy. It works, bu
On Sunday, June 24, 2012 14:29:10 Namespace wrote:
> On Sunday, 24 June 2012 at 12:19:47 UTC, Jonathan M Davis wrote:
> > On Sunday, June 24, 2012 14:09:38 Namespace wrote:
> >> And can me now anybody explain why
> >> @disable
> >> this(typeof(null)); or any other ctor declaration prints "stack
> >
On Sunday, June 24, 2012 14:24:48 Roman D. Boiko wrote:
> Yeah, but I wonder that such a core feature as AA doesn't support
> this use case better (I mean more efficiently).
The current AA implementation is quite buggy. It works, but there are all
kinds of corner cases which it doesn't handle pro
On Sunday, 24 June 2012 at 12:19:47 UTC, Jonathan M Davis wrote:
On Sunday, June 24, 2012 14:09:38 Namespace wrote:
And can me now anybody explain why
@disable
this(typeof(null)); or any other ctor declaration prints "stack
overflow"?
How it is possible, that one class and one struct kill the
s
On Sunday, 24 June 2012 at 12:21:50 UTC, Jonathan M Davis wrote:
On Sunday, June 24, 2012 05:15:03 Ali Çehreli wrote:
Although it sounds like a limitation, it may be due to the
fact that AA
may need to rehash, which may not be suitable with immutable
values.
const and immutable types as eleme
On Sunday, 24 June 2012 at 12:15:10 UTC, Ali Çehreli wrote:
Although it sounds like a limitation, it may be due to the fact
that AA may need to rehash, which may not be suitable with
immutable values.
Thanks, now I can see the motivation.
The following are two ways of generating immutable AA v
On Sunday, June 24, 2012 05:15:03 Ali Çehreli wrote:
> Although it sounds like a limitation, it may be due to the fact that AA
> may need to rehash, which may not be suitable with immutable values.
const and immutable types as elements of a container are problematic in
general. The container gene
On Sunday, June 24, 2012 14:09:38 Namespace wrote:
> And can me now anybody explain why
> @disable
> this(typeof(null)); or any other ctor declaration prints "stack
> overflow"?
> How it is possible, that one class and one struct kill the stack?
Please provide a compilable example which exhibits t
On 06/24/2012 04:57 AM, Roman D. Boiko wrote:
immutable(SomeClass)[S] _map;
_map[S.init] = null; // doesn't compile since _map[S.init] is immutable
My current workaround is:
immutable(SomeClass)*[S] _map;
_map[S.init] = [null].ptr;
But this introduces an additional level of indirection in a
per
On Sunday, 24 June 2012 at 11:55:15 UTC, Jonathan M Davis wrote:
On Sunday, June 24, 2012 11:35:46 Namespace wrote:
> A non-nullable type _will_ be added to Phobos at some point.
As struct or class or as built-in type?
As I said, it will be added to _Phobos_. So, it will be a
struct in the
s
On Sunday, June 24, 2012 13:57:44 Roman D. Boiko wrote:
> immutable(SomeClass)[S] _map;
> _map[S.init] = null; // doesn't compile since _map[S.init] is
> immutable
>
> My current workaround is:
> immutable(SomeClass)*[S] _map;
> _map[S.init] = [null].ptr;
>
> But this introduces an additional lev
Am 24.06.2012 13:15, schrieb Timon Gehr:
On 06/24/2012 12:37 PM, David wrote:
Am 24.06.2012 11:35, schrieb Namespace:
A non-nullable type _will_ be added to Phobos at some point.
As struct or class or as built-in type?
And can me explain somebody why
[code]
@disable
this(typeof(null));
[/cod
immutable(SomeClass)[S] _map;
_map[S.init] = null; // doesn't compile since _map[S.init] is
immutable
My current workaround is:
immutable(SomeClass)*[S] _map;
_map[S.init] = [null].ptr;
But this introduces an additional level of indirection in a
performance-critical part of my code.
Probabl
On Sunday, June 24, 2012 11:35:46 Namespace wrote:
> > A non-nullable type _will_ be added to Phobos at some point.
>
> As struct or class or as built-in type?
As I said, it will be added to _Phobos_. So, it will be a struct in the
standard library, not in the language itself. It'll probably be
On Sunday, June 24, 2012 11:53:37 Dmitry Olshansky wrote:
> On 24-Jun-12 08:15, Ellery Newcomer wrote:
> > this code:
> >
> > class X{
> >
> > string[string] s;
> > this() {
> >
> > s["s"] = "S";
> >
> > }
> > ~this() {
> >
> > s.remove("s")
On 06/24/2012 12:37 PM, David wrote:
Am 24.06.2012 11:35, schrieb Namespace:
A non-nullable type _will_ be added to Phobos at some point.
As struct or class or as built-in type?
And can me explain somebody why
[code]
@disable
this(typeof(null));
[/code]
print "Stack overflow"?
What should
On Sunday, 24 June 2012 at 10:37:39 UTC, David wrote:
Am 24.06.2012 11:35, schrieb Namespace:
A non-nullable type _will_ be added to Phobos at some point.
As struct or class or as built-in type?
And can me explain somebody why
[code]
@disable
this(typeof(null));
[/code]
print "Stack overflow"
Am 24.06.2012 11:35, schrieb Namespace:
A non-nullable type _will_ be added to Phobos at some point.
As struct or class or as built-in type?
And can me explain somebody why
[code]
@disable
this(typeof(null));
[/code]
print "Stack overflow"?
What should typeof(null) return you? void*, int*
A non-nullable type _will_ be added to Phobos at some point.
As struct or class or as built-in type?
And can me explain somebody why
[code]
@disable
this(typeof(null));
[/code]
print "Stack overflow"?
On Sun, 24 Jun 2012 10:02:07 +0200, Roman D. Boiko wrote:
Just found a follow-up post:
http://dblog.aldacron.net/2012/06/24/my-only-gripes-about-d/
Just found it myself. RSS for the win :)
I can't say I disagree. You have to read through several modules to find
what you need: std.string, s
Just found a follow-up post:
http://dblog.aldacron.net/2012/06/24/my-only-gripes-about-d/
On 24-Jun-12 08:15, Ellery Newcomer wrote:
this code:
class X{
string[string] s;
this() {
s["s"] = "S";
}
~this() {
s.remove("s");
}
}
void main() {
X x = new X();
}
produces this:
core.exception.InvalidMemoryOperationError
because the aa is c
Am Sat, 23 Jun 2012 23:39:00 -0700
schrieb Ali Çehreli :
> On 06/23/2012 04:51 PM, Jonathan M Davis wrote:
>
> >> This seems to work, but it's very ugly:
> >>
> >> _digest.finish(*cast(ubyte[16]*)buf.ptr);
> >>
> >>
> >> I thought this might create a temporary, but
Am Sat, 23 Jun 2012 16:51:14 -0700
schrieb Jonathan M Davis :
> On Saturday, June 23, 2012 20:23:26 Johannes Pfau wrote:
> > I'm working on the new design for std.hash and I hit an interesting
> > problem:
> >
> > The OOP interface has to take buffers as slices with unknown
> > length, as the len
51 matches
Mail list logo