On Wed, 01 Feb 2012 01:14:38 +0100, Nicolas Silva
wrote:
Oh, my bad, sorry, when I tried the code i showed in the other mail, I
had forgotten the parenthesis on the call to refA() (like if it was an
attribute).
Once fixed it works for me.
f1.refA() = 24; //ok
f1.refA = 24; //not ok, my mist
Oh, my bad, sorry, when I tried the code i showed in the other mail, I
had forgotten the parenthesis on the call to refA() (like if it was an
attribute).
Once fixed it works for me.
f1.refA() = 24; //ok
f1.refA = 24; //not ok, my mistake
On Tue, Jan 31, 2012 at 11:43 PM, Trass3r wrote:
>> I am
I am using DMD 2.057 on Ubuntu 64bit. Are you sure that it does not
work? Can anyone reproduce the error?
import std.variant;
struct Foo {
Variant a;
ref Variant refA(){
return a;
}
}
void main(){
Foo f1;
f1.refA() = 24;
}
Compiles fine on Ubuntu x64 with git
*whispers gee dee c*
windows binaries please...
Seek and you shall find.
https://bitbucket.org/goshawk/gdc/downloads
On 01/31/2012 06:15 PM, Nicolas Silva wrote:
Hi,
Works for me. Which version of the compiler are you using?
Sorry, i forgot to mention: i'm using dmd 2.057 on ubuntu 32bit.
I am using DMD 2.057 on Ubuntu 64bit. Are you sure that it does not
work? Can anyone reproduce the error?
import s
On 01/31/2012 12:41 PM, Trass3r wrote:
*whispers gee dee c*
windows binaries please...
What is the state of formatted input? There has been changes at some
point. %x or %o don't work anymore:
int i;
int j;
readf(" %o %x", &i, &j);
phobos/std/format.d(2690): Parsing spec 'o' not implemented.
Same error for '%x'. (Of course '%s' works but doesn't know octal or
hexadec
I was reading the C++ Object Model book recently (well, I'm still
reading) and was amazed at how many edge-cases there are in C++, and
how lucky I am to be using D. Well, minus the Optlink that is. :)
*whispers gee dee c*
On Tue, Jan 31, 2012 at 08:49:25PM +0100, Andrej Mitrovic wrote:
> On 1/31/12, Jonathan M Davis wrote:
> > In D however, the _entire_ type is created and default
> > initialized before the first constructor is called.
>
> I was reading the C++ Object Model book recently (well, I'm still
> reading
On 1/31/12, Jonathan M Davis wrote:
> In D however, the _entire_ type is created and default
> initialized before the first constructor is called.
I was reading the C++ Object Model book recently (well, I'm still
reading) and was amazed at how many edge-cases there are in C++, and
how lucky I am
On Tuesday, January 31, 2012 12:07:16 Zachary Lund wrote:
> In C++, they provide a mechanism to initialize class variables to a
> passed value.
>
> class Test
> {
> int bob;
>
> public:
> Test(int jessica) : bob(jessica) { }
> };
>
> The above basically says "int this.bob = jessica;" as opposed
On Tue, Jan 31, 2012 at 09:12, Ali Çehreli wrote:
> On 01/14/2012 07:49 AM, Philippe Sigaud wrote:
>
>> That's cool, because the D community is small enough and still
>> dispersed enough that we should link one another to bring it all
>> together.
>
> Thank you very much for your link! :)
That's
On Tuesday, January 31, 2012 08:05:37 bearophile wrote:
> Jonathan M Davis:
> > I don't see std.conv.to changing.
>
> We'll see.
As far as I recall, you're the only person to ever bring this up (though you
have brought it up before). In general, I think that programmers are fine with
how to!int
In C++, they provide a mechanism to initialize class variables to a
passed value.
class Test
{
int bob;
public:
Test(int jessica) : bob(jessica) { }
};
The above basically says "int this.bob = jessica;" as opposed to this:
class Test
{
int bob;
public:
Test(int
NewName:
> Hello all.
> I want to write a regex to check if a whole string is a number.
Also:
import std.stdio, std.string, std.array;
void main() {
string s = "123";
assert(s.removechars("0-9").empty);
}
Bye,
bearophile
On Tuesday, 31 January 2012 at 12:33:22 UTC, bearophile wrote:
Mars:
Thanks everybody. I still hope support for partial classes may
come some day, to make this cleaner, but I guess it works.
Generally it's not wise to go too much against the style of a
language. What do you need partial clas
Hi,
> Works for me. Which version of the compiler are you using?
Sorry, i forgot to mention: i'm using dmd 2.057 on ubuntu 32bit.
On Tue, Jan 31, 2012 at 5:31 PM, Timon Gehr wrote:
> On 01/31/2012 03:03 PM, Nicolas Silva wrote:
>>
>> Hi,
>>
>> I'm playing with variants and I noticed that opAss
> You want to match the beginning and end of the input as well:
> "^[0-9]+$"
Thanks.
On Tue, 31 Jan 2012 16:29:43 +, NewName wrote:
> Hello all.
> I want to write a regex to check if a whole string is a number. With my
> current regex("[0-9]+") numbers will be carved out of things like
> "aaa456" (hit: 456) and I circumvent this by checking the lengths for
> inequality, which
I want to write a regex to check if a whole string is a number.
With my current regex("[0-9]+") numbers will be carved out of things like
"aaa456" (hit: 456) and I circumvent this by checking the lengths for
inequality, which is stupid. My regex is surely missing something?
Try ^ and $ if applic
I'm wanting to change the number of worker threads post creation of my
TaskPool instance. I see nothing that allows me to do this. Isn't that
abnormal for a thread pool?
On 01/31/2012 03:03 PM, Nicolas Silva wrote:
Hi,
I'm playing with variants and I noticed that opAssign is not invoked
when an assignation is done on a reference.
here is the test case:
import std.variant;
struct Foo
{
Variant a;
Variant b;
ref Variant refA()
{
ret
Hello all.
I want to write a regex to check if a whole string is a number.
With my current regex("[0-9]+") numbers will be carved out of things like
"aaa456" (hit: 456) and I circumvent this by checking the lengths for
inequality, which is stupid. My regex is surely missing something?
Thank you fo
On Tue, 31 Jan 2012 16:42:52 +0100, Zachary Lund
wrote:
On Tuesday, 31 January 2012 at 15:19:00 UTC, Trass3r wrote:
However, I cannot, by default, scope my custom allocations.
Any ideas?
std.typecons.scoped
I looked into this and I'm unsure of its exact use. It says, "Allocates
a class
On Tuesday, 31 January 2012 at 15:19:00 UTC, Trass3r wrote:
However, I cannot, by default, scope my custom allocations.
Any ideas?
std.typecons.scoped
I looked into this and I'm unsure of its exact use. It says,
"Allocates a class object right inside the current scope" which
doesn't really
However, I cannot, by default, scope my custom allocations.
Any ideas?
std.typecons.scoped
El Tue, 31 Jan 2012 00:33:36 +0100, David Nadlinger escribió:
> On 1/31/12 12:29 AM, Zardoz wrote:
>> At least I can say that the Tutorial client& server works
>> (async_client not compile) :) . For me it's enough .
>
> Because you don't have libevent installed (the tutorial makefile doesn't
> h
On 01/30/12 00:30, Artur Skawina wrote:
> On 01/29/12 23:51, Sparse Push wrote:
>>
>>> Done. Does the resulting clutter API look usable?
>>> http://repo.or.cz/w/girtod.git/blob/refs/heads/gtk2:/gtk2/clutter.d
>>> None of the new modules were tested - i still need code samples to port and
>>> time
You can use structs for this kind of problems, somethin like
struct Scoped(T)
{
~this()
{
//handle deallocation here
}
T inst;
}
if you create a Scoped!MyClass in a scope, the struct's destructor
will be invoked whenever the program leaves the scope, even if it is
because
Hi,
I'm playing with variants and I noticed that opAssign is not invoked
when an assignation is done on a reference.
here is the test case:
import std.variant;
struct Foo
{
Variant a;
Variant b;
ref Variant refA()
{
return a;
}
}
void main()
{
Foo f1;
f1.a =
I've been looking into (basic) memory management within D. Through IRC
conversation and reading the article on memory management on dlang.org
(which seems to be a bit out-of-date), I've concluded that using a
global (or static member) function and emplace() in std.conv is a simple
solution for
Jonathan M Davis:
> and it's the sort of thing that
> he's likely to consider bikeshedding at this point -
He isn't the only Phobos developer. It's a change able to improve my usage of
conversions, so it's not a neutral change (as I think 'bikeshedding' implies).
> particularly since he's
>
Zardoz:
> Try parse!int(" 12\n");
> http://www.d-programming-language.org/phobos/std_conv.html#parse
It doesn't work, because it accepts a ref string. So you have to write:
string s = " 12\n";
int n = parse!int(s);
But it doesn't work still, it chokes on the first space, so you have to remove
i
Mars:
> Thanks everybody. I still hope support for partial classes may
> come some day, to make this cleaner, but I guess it works.
Generally it's not wise to go too much against the style of a language. What do
you need partial classes for?
Bye,
bearophile
On 1/31/2012 7:45 PM, Mars wrote:
Hello everybody.
I couldn't really think of a good title for this. It's just a little
question, about this example code:
http://pastie.org/private/4xqtze47dlx9fy9pn53sq
Apperantly I get a copy of Bar, when I call bar(), and it doesn't modify
the actual variable
On Tuesday, January 31, 2012 11:37:24 Mars wrote:
> On Monday, 30 January 2012 at 10:21:07 UTC, bls wrote:
> > As already said template mixins are close to partial classes.
> > A snippet. HTH
>
> Thanks everybody. I still hope support for partial classes may
> come some day, to make this cleaner,
Hello everybody.
I couldn't really think of a good title for this. It's just a
little question, about this example code:
http://pastie.org/private/4xqtze47dlx9fy9pn53sq
Apperantly I get a copy of Bar, when I call bar(), and it doesn't
modify the actual variable of the object. But if I define B
On Monday, 30 January 2012 at 10:21:07 UTC, bls wrote:
As already said template mixins are close to partial classes.
A snippet. HTH
Thanks everybody. I still hope support for partial classes may
come some day, to make this cleaner, but I guess it works.
On Monday, January 30, 2012 21:01:38 bearophile wrote:
> In Python int() and float() convert a string into a number even if it
contains some whitespace before and after the number:
> >>> s = " 12\n"
> >>> int(s)
>
> 12
>
> >>> float(s)
>
> 12.0
>
>
> In D to!int(" 12\n") gives a run-time er
On 01/14/2012 07:49 AM, Philippe Sigaud wrote:
> That's cool, because the D community is small enough and still
> dispersed enough that we should link one another to bring it all
> together.
Thank you very much for your link! :)
And I've finally found time to create two links to your 'D Templat
40 matches
Mail list logo