Re: multiple alias this in class/struct not allowed?

2010-11-09 Thread Adam Cigánek
Ok guys, thanks. Got it. Well, good to know. Any chance of knowing when could this feature be implemented? adam. 2010/11/9 Jonathan M Davis jmdavisp...@gmx.com: On Monday, November 08, 2010 13:49:36 Adam Cigánek wrote: Hello, Why are multiple alias this declarations in a class/struct

calling functions without parentheses

2010-11-08 Thread Adam Cigánek
Hello, It seems that if function has no parameters, it's possible to omit the parentheses when calling it: string sayHello() { return hello; } void main() { writeln(sayHello); // same as writeln(sayHello()); } Is this an actual defined (and documented) behaviour

Re: calling functions without parentheses

2010-11-08 Thread Adam Cigánek
...@yahoo.com: On Mon, 08 Nov 2010 14:48:20 -0500, Adam Cigánek adam.ciga...@gmail.com wrote: Hello, It seems that if function has no parameters, it's possible to omit the parentheses when calling it:    string sayHello() {      return hello;    }    void main() {      writeln(sayHello

multiple alias this in class/struct not allowed?

2010-11-08 Thread Adam Cigánek
Hello, Why are multiple alias this declarations in a class/struct not allowed? This page http://www.digitalmars.com/d/2.0/class.html#AliasThis says so, and also dmd2 gives me an error when I try to do it, but TDPL says something different (on page 231): a class could introduce any number of alias

lazy variables cannot be lvalues - why?

2010-11-01 Thread Adam Cigánek
Hello, why is the following code illegal? import std.stdio; void delegate() fun; void capture(lazy void f) { fun = f; } void main() { capture(writeln(hello)); fun(); } It says Error: lazy variables cannot be lvalues, pointing to the fun = f line. It can be worked

Re: Fully qualified name of an identifier as a compile-time string

2010-10-28 Thread Adam Cigánek
You could try 'identifier.stringof'. But I don't know if that'll give you what you want, and .stringof does have a history of being buggy, poorly-defined, and frequently changing. Thanks, but stringof gives unqualified name as well. Are foo.stringof and __traits(identifier, foo) the same

delete an element from an array

2010-10-24 Thread Adam Cigánek
Hello, Is there a function in the standard library to delete an element from an array (or range)? Something like: auto a = [1, 2, 3, 4, 5, 6]; auto b = delete(a, 4); assert([1, 2, 3, 4, 6] == b); I've noticed there is eliminate in std.algorithm, which seems to be doing just that, but

Re: delete an element from an array

2010-10-24 Thread Adam Cigánek
, Adam Cigánek adam.ciga...@gmail.com wrote: Hello, Is there a function in the standard library to delete an element from an array (or range)? Something like:  auto a = [1, 2, 3, 4, 5, 6];  auto b = delete(a, 4);  assert([1, 2, 3, 4, 6] == b); I've noticed there is eliminate

Re: delete an element from an array

2010-10-24 Thread Adam Cigánek
Your new example doesn't show it better, it's the only one you've given that shows it at all.  What you had originally was  auto a = [1, 2, 3, 4, 5, 6];  auto b = delete(a, 4);  assert([1, 2, 3, 4, 6] == b); which shows the removal of the element at index 4, not the element with value 4.

Re: What is the difference between alias and typedef?

2010-10-21 Thread Adam Cigánek
Thanks man, this was very exhaustive reply :) This is what i was basically thinking, just wasn't sure. Also, didn't know that typedef is deprecated. Guess that explains why is it not mentioned in the book. Thanks, adam. 2010/10/21 bearophile bearophileh...@lycos.com: Adam Cigánek: What

What is the difference between alias and typedef?

2010-10-20 Thread Adam Cigánek
Hello there, What is the difference between alias and typedef? Also, is it explained somewhere? I was searching the webs and the TDPL book*, but haven't found anything :( adam. * sadly, it has no full text search, but since there is no mention of typedef in the index, I'm assuming it's not

[BUG} dsss linker error when a module has @property

2010-09-27 Thread Adam Cigánek
Hello there, Could someone take a look at this bug: http://www.dsource.org/projects/dsss/ticket/234 ? Or at least point me the right way - I might give a try fixing it myself. adam.