On Tue, 29 Jun 2010 07:16:13 +0200, BCS n...@anon.com wrote:
Hello Mike,
I want to do the following:
foreach(obj; list)
{
if(obj.pleaseKillMe)
somehow_remove_the_object_from_the_list();
}
That isn't legal for normal arrays or AAs. IIRC the docs even say that
you can't change what a
Just wonder how to translate this C# snippet into D..
//C#
public interface IBindingList {
bool AllowEdit {
get;
}
}
//D2
interface IBindingList {
@property bool allowEdit();
}
Is this correct ? I think in C# AllowEdit() takes tare that you don't
implement a
BCS n...@anon.com wrote:
The issue is that the function called from module a is
_D1a3fooFZv where the function defined in module b is
_D1b3fooFZv ('a' - 'b') so they aren't the same function. extern(C)
works because C doesn't mangle names so the function is foo in both
cases.
I know. I
sorry for making so much noise.. figured it out by myse4lf.
interface IBindingList {
@property bool AllowEdit();
//@property bool AllowEdit(bool enable);
//remove // to enable setter
}
class A : IBindingList {
private bool _allowEdit;
On Tuesday 29 June 2010 03:11:34 BLS wrote:
Just wonder how to translate this C# snippet into D..
//C#
public interface IBindingList {
bool AllowEdit {
get;
}
}
//D2
interface IBindingList {
@property bool allowEdit();
}
Is this correct ? I think in
On 29/06/2010 12:32, Jonathan M Davis wrote:
So, there certainly won't be any restriction on
having a getter or setter in a class if an interface it implements declared only
one. It's just that you'll only be able to use the one that's part of the
interface if you're using a reference of the
On Tue, 29 Jun 2010 06:24:42 -0400, Simen kjaeraas
simen.kja...@gmail.com wrote:
BCS n...@anon.com wrote:
The issue is that the function called from module a is
_D1a3fooFZv where the function defined in module b is
_D1b3fooFZv ('a' - 'b') so they aren't the same function. extern(C)
works
On Mon, 28 Jun 2010 23:01:42 -0400, Mike Parker aldac...@gmail.com wrote:
I thought I understood ranges until I actually started trying to use
them. Now I'm having difficulties with the new range-based containers.
So I've got two issues right now, grokking ranges and understanding the
On Tue, 29 Jun 2010 06:58:54 -0400, BLS windev...@hotmail.de wrote:
On 29/06/2010 12:32, Jonathan M Davis wrote:
So, there certainly won't be any restriction on
having a getter or setter in a class if an interface it implements
declared only
one. It's just that you'll only be able to use the
BLS:
But this one NOT.
interface IBindingList {
@property bool AllowEdit();
@property bool AllowEdit(bool enable);
}
class A : IBindingList {
private bool _allowEdit;
@property {
bool AllowEdit() { return _allowEdit; }
}
On 29/06/2010 14:08, Steven Schveighoffer wrote:
Besides, try to do this in C#:
@property int value() {return _x;}
@property int value(int x) { return _x = x;}
@property int value(string s) { return _x = to!int(s);}
:) D's properties are so much better...
-Steve
Ok, convinced ;)
Hi bearophile,
sorry for my ignorance, but what is the difference between @disable and
simply deleting the line ?
where can I read more about @disable ?
thanks, bjoern
Hi, in C# you can do some thing like this.
public interface IDataErrorInfo
{
// INDEXER
string this[string columnName] { get; }
}
}
how to translate this into D2 ?
thanks in advance, bjoern
On Tue, 29 Jun 2010 09:21:34 -0400, BLS windev...@hotmail.de wrote:
Hi, in C# you can do some thing like this.
public interface IDataErrorInfo
{
// INDEXER
string this[string columnName] { get; }
}
}
how to translate this into D2 ?
thanks in advance, bjoern
string
On 29/06/2010 15:27, Steven Schveighoffer wrote:
string opIndex(string columnName);
yeah this is what I did, too..
However defined as ;
interface I1 {
string opIndex(string columnName);
}
is a no go. So can we say operator overloading within interfaces is not
allowed in D2 ?
thanks
BLS windev...@hotmail.de wrote:
On 29/06/2010 15:27, Steven Schveighoffer wrote:
string opIndex(string columnName);
yeah this is what I did, too..
However defined as ;
interface I1 {
string opIndex(string columnName);
}
is a no go.
Hm. That should have worked.
So can we say operator
Hello and Good morning!
I'm trying to use receiveTimeout:
//
import std.stdio,
std.concurrency;
int main(string[] args){
receiveTimeout( 1000L, (int i){writefln(Received: %d,i);}
) ;
return 0;
}
//
interface I1 {
string opIndex(string columnName);
}
is a no go. So can we say operator overloading within interfaces is not
allowed in D2 ?
It should work.
Only opBinary etc doesn't work yet cause there are problems with template
functions in interfaces.
Heywood Floyd soul...@gmail.com wrote:
ops = ops[1 .. $]; // === line 335
Well, this looks like a bug to me. Should be
Ops = ops[1 .. $];
--
Simen
On 29/06/2010 15:35, BLS wrote:
On 29/06/2010 15:27, Steven Schveighoffer wrote:
string opIndex(string columnName);
yeah this is what I did, too..
However defined as ;
interface I1 {
string opIndex(string columnName);
}
is a no go. So can we say operator overloading within interfaces is not
Simen kjaeraas simen.kja...@gmail.com wrote:
Heywood Floyd soul...@gmail.com wrote:
ops = ops[1 .. $]; // === line 335
Well, this looks like a bug to me. Should be
Ops = ops[1 .. $];
Oh, and you could probably make this change yourself.
--
Simen
Hello Simen,
BCS n...@anon.com wrote:
You can resolve this by having a a.di file with the extern foo(); in
it (DMD has a flag to generate such a file for you). OTOH without
knowing what you are doing, I can't tell if this is the correct
solution.
I'm trying to create a framework in
On Tue, 29 Jun 2010 09:55:50 -0400, BLS windev...@hotmail.de wrote:
On 29/06/2010 15:35, BLS wrote:
On 29/06/2010 15:27, Steven Schveighoffer wrote:
string opIndex(string columnName);
yeah this is what I did, too..
However defined as ;
interface I1 {
string opIndex(string columnName);
}
On Tue, 29 Jun 2010 09:53:25 -0400, Simen kjaeraas
simen.kja...@gmail.com wrote:
Heywood Floyd soul...@gmail.com wrote:
ops = ops[1 .. $]; // === line 335
Well, this looks like a bug to me. Should be
Ops = ops[1 .. $];
Ops is a type, isn't it? Don't you need a variable there?
I
Hello!
I'm trying to use receiveTimeout:
//
import std.stdio,
std.concurrency;
int main(string[] args){
receiveTimeout( 1000L, (int i){writefln(Received: %d,i);}
) ;
return 0;
}
//
(I
On Tue, 29 Jun 2010 14:42:33 +0200, BLS windev...@hotmail.de wrote:
Hi bearophile,
sorry for my ignorance, but what is the difference between @disable and
simply deleting the line ?
where can I read more about @disable ?
thanks, bjoern
@disable propagates throughout the objects hierarchy
Ok, thanks!
How does the chain of command/responsibility work here?
Should I file this to bugzilla?
(I'm not able to fix it myself as I haven't built dmd locally. I'm just not
quite there yet... : )
/heywood
On Jun 29, 2010, at 16:31 , Steven Schveighoffer wrote:
On Tue, 29 Jun 2010
On Tue, 29 Jun 2010 13:05:50 -0400, Heywood Floyd soul...@gmail.com
wrote:
Ok, thanks!
How does the chain of command/responsibility work here?
Should I file this to bugzilla?
(I'm not able to fix it myself as I haven't built dmd locally. I'm just
not quite there yet... : )
/heywood
Hi
- probably Steve :)
I have problem in compiling a little programm using dcollection.LinkList.
(similar problem appears when I use dcollections.ArrayList)
D2.047
Linker error..
Error 1 Error 42: Symbol Undefined _D12dcollections8LinkList7__arrayZ
Error 2 Error 42: Symbol
On Tue, 29 Jun 2010 14:13:57 -0400, BLS windev...@hotmail.de wrote:
Hi
- probably Steve :)
I have problem in compiling a little programm using dcollection.LinkList.
(similar problem appears when I use dcollections.ArrayList)
D2.047
Linker error..
Error 1 Error 42: Symbol Undefined
On 29/06/2010 20:19, Steven Schveighoffer wrote:
Are you linking against dcollections? It looks like you are not...
No.
BTW, you can use dcollections' ticket tracking system for things like
this instead of sending to the newsgroup :)
Will do. Thanks Steve
bjoern
Hi,
in C# this is common.
private ListServer _servers;
_servers = new ListServer
{
new Server{ Name = ServerI, IP = 120.14.220.18 },
new Server{ Name = ServerII, IP = 120.14.220.19 },
new Server{ Name = ServerIII, IP = 120.14.220.20 },
new Server{
BLS:
D2 so far..
import dcollections.LinkList;
In D use dynamic arrays unless you really need to remove or add a lot of items
from the start or middle of the sequence. On modern CPUs linked lists are
usually the wrong data structure to use.
Bye,
bearophile
On Tue, 29 Jun 2010 15:27:41 -0400, bearophile wrote:
In D use dynamic arrays unless you really need to remove or add a lot of
items from the start or middle of the sequence. On modern CPUs linked
lists are usually the wrong data structure to use.
Bye,
bearophile
D's dynamic arrays are
On Tue, 29 Jun 2010 15:22:30 -0400, BLS windev...@hotmail.de wrote:
Hi,
in C# this is common.
private ListServer _servers;
_servers = new ListServer
{
new Server{ Name = ServerI, IP = 120.14.220.18 },
new Server{ Name = ServerII, IP = 120.14.220.19 },
On 29/06/2010 22:12, Steven Schveighoffer wrote:
For now, can you do something like this?
sl = new ServerList;
sl.add([
new Server(ServerI, 120.14.220.18),
new Server(...)
...
]);
Hi Steve, I think this should work, however I got very strange err. msg.
in file ArrayList.d Have
On Tue, 29 Jun 2010 17:33:13 -0400, BLS windev...@hotmail.de wrote:
On 29/06/2010 22:12, Steven Schveighoffer wrote:
For now, can you do something like this?
sl = new ServerList;
sl.add([
new Server(ServerI, 120.14.220.18),
new Server(...)
...
]);
Hi Steve, I think this should
On 29/06/2010 23:49, Steven Schveighoffer wrote:
One thing to note, ArrayList *does* accept an array as a constructor,
and it will actually use that array as its storage. This is so you can
wrap an array as a ArrayList and get the full dcollections
functionality from it.
Hi Steve
This is why
What is the pretty way to do something like this?
Class C
{
private const char[] _name = C;// demangling this.mangleof didn't work
void makeNew()
{
mixin(`new `~_name~`();`); // the not so pretty part
}
}
On Tue, 29 Jun 2010 17:59:37 -0400, strtr st...@sp.am wrote:
What is the pretty way to do something like this?
Class C
{
void makeNew()
{
new typeof(this);
}
}
As edited...
-Steve
== Quote from Steven Schveighoffer (schvei...@yahoo.com)'s article
On Tue, 29 Jun 2010 17:59:37 -0400, strtr st...@sp.am wrote:
What is the pretty way to do something like this?
Class C
{
void makeNew()
{
new typeof(this);
}
}
As edited...
-Steve
Whahaha!
Thanks, I
I was surprised by the behavior of division. The resulting type of
division in example below is uint and the value is incorrect. I would
expect that when one of operands is signed, then the result is signed
type.
int a = -6;
uint b = 2;
auto c = a / b; // c is type of uint, and has
Stewart Gordon:
http://d.puremagic.com/issues/show_bug.cgi?id=259
I have added my vote there a lot of time ago. I think Andrei says that fixing
this is unworkable, but I don't know why. If you make this an error and at the
same time turn array indexes/lengths into signed values, you don't have
On Tue, 29 Jun 2010 19:42:45 -0400, bearophile wrote:
Stewart Gordon:
http://d.puremagic.com/issues/show_bug.cgi?id=259
I have added my vote there a lot of time ago. I think Andrei says that
fixing this is unworkable, but I don't know why. If you make this an
error and at the same time
On Tue, 29 Jun 2010 19:42:45 -0400, bearophile wrote:
Stewart Gordon:
http://d.puremagic.com/issues/show_bug.cgi?id=259
I have added my vote there a lot of time ago. I think Andrei says that
fixing this is unworkable, but I don't know why. If you make this an
error and at the same time
On Wed, 30 Jun 2010 00:30:19 +0100, Stewart Gordon wrote:
Michal Minich wrote:
I was surprised by the behavior of division. The resulting type of
division in example below is uint and the value is incorrect. I would
expect that when one of operands is signed, then the result is signed
type.
Just a few things that may cause you some bugs/errors
On Tue, 29 Jun 2010 23:33:13 +0200, BLS wrote:
On 29/06/2010 22:12, Steven Schveighoffer wrote:
// Confirm these are the same instance
if (b1 == b2 b2 == b3 ) {
writeln(Same instance\n);
}
I think you mean to
There is very long discussion on digitamars.D ng Is there ANY chance we
can fix the bitwise operator precedence rules? which I should probably
read first...but was there some conclusion ?
Michal Minich wrote:
I was surprised by the behavior of division. The resulting type of
division in example below is uint and the value is incorrect. I would
expect that when one of operands is signed, then the result is signed
type.
Going by the spec
Byron Heads:
this(string name, string id) {
this._name = _name;
this._id = id;
}
this._name = name; // you had _name
I have just filed a bug report on this (it's a lot of time I want to write it):
Thanks!
I will!
/heywood
PS. I like D.
On Jun 29, 2010, at 19:37 , Steven Schveighoffer wrote:
On Tue, 29 Jun 2010 13:05:50 -0400, Heywood Floyd soul...@gmail.com wrote:
Ok, thanks!
How does the chain of command/responsibility work here?
Should I file this to bugzilla?
51 matches
Mail list logo