Re: Ddoc inheritance

2012-06-11 Thread Ary Manzana
On 6/12/12 8:59 , Alex Rønne Petersen wrote: Hi, Suppose I have: abstract class A { /// My very long and helpful documentation. void foo(); } class B : A { override void foo() { } } Is there any way I can instruct Ddoc to copy the documentation from A.foo to B.foo? Copying it over manually

Re: Problem using Interfce

2012-05-16 Thread Ary Manzana
On 5/16/12 9:24 AM, Stephen Jones wrote: Ary: I seem to remember playing around with a Simpsons extending program in Java that did this; you could throw all the different Simpsons into a single Array because they extended Simpson, and you could walk through the array and each would call their

Re: Problem using Interfce

2012-05-15 Thread Ary Manzana
On 5/14/12 6:08 PM, Stephen Jones wrote: I am used to languages where the w under consideration in any iteration would be known to have been initialized as a Button or Cursor, etc, and the value of vertStart would be found without error. What are the names of those languages?

Re: string find and replace

2012-05-03 Thread Ary Manzana
On 5/3/12 9:30 PM, Iain wrote: On Thursday, 3 May 2012 at 14:22:57 UTC, Iain wrote: Forgive me if I am missing something obvious, but is there a simple option for finding all instances of a particular character in a string or char[] and replacing them with another character? I can do this with

Re: string find and replace

2012-05-03 Thread Ary Manzana
On 5/3/12 11:01 PM, Ary Manzana wrote: On 5/3/12 9:30 PM, Iain wrote: On Thursday, 3 May 2012 at 14:22:57 UTC, Iain wrote: Forgive me if I am missing something obvious, but is there a simple option for finding all instances of a particular character in a string or char[] and replacing them

Re: type conversions

2012-04-30 Thread Ary Manzana
On 4/30/12 8:08 AM, Jonathan M Davis wrote: On Monday, April 30, 2012 01:42:38 WhatMeWorry wrote: I'm trying to get my head around D's type conversion. What is the best way to convert a string to a char array? Or I should say is this the best way? string s = Hello There; char[] c; c =

Re: mysql binding/wrapper?

2012-04-30 Thread Ary Manzana
On 4/30/12 11:57 PM, simendsjo wrote: On 4/29/12 11:48 PM, dnewbie wrote: On Saturday, 28 April 2012 at 15:30:13 UTC, simendsjo wrote: stuff/blob/master/mysql.d http://my.opera.com/run3/blog/2012/03/13/d-mysql I use it in a bank account application. It works. On Mon, 30 Apr 2012 18:19:29

Frustration [Was: mysql binding/wrapper?]

2012-04-30 Thread Ary Manzana
On 5/1/12 2:44 AM, simendsjo wrote: On Mon, 30 Apr 2012 20:55:45 +0200, Ary Manzana a...@esperanto.org.ar wrote: Looking at the code of mysql.d I see a big switch with many cases like case 0x01: // TINYINT. But then there's the SQLType enum with those constants. Why the enum values are not used

Re: Power of D

2012-04-25 Thread Ary Manzana
On 4/26/12 1:51 AM, bioinfornatics wrote: i search some example of something easy (more easy) to do in D an not in another language if possible - D - C++ ... - D - Haskell - D - Java - D - python A segmentation fault is really easy to do in D but hard in those languages. :-P

Re: pure functions/methods

2012-04-20 Thread Ary Manzana
On 4/20/12 4:06 PM, Namespace wrote: The sense of pure functions isn't clear to me. What is the advantage of pure functions / methods? I inform the compiler with const that this method does not change the current object, and therefore he can optimize (at least in C++) this method. How and what

Re: floats default to NaN... why?

2012-04-15 Thread Ary Manzana
On 4/16/12 12:00 PM, F i L wrote: On Monday, 16 April 2012 at 03:25:15 UTC, bearophile wrote: F i L: I should be able to tackle something like adding a compiler flag to default FP variables to zero. If I write the code, would anyone object to having a flag for this? I strongly doubt Walter

Re: Insert an element into an Associative Array ?

2012-04-05 Thread Ary Manzana
On 4/5/12 2:57 AM, Chris Pons wrote: I'm playing around with associative arrays right now and I can't seem to figure out how to add additional objects to the array. I tried insert but it doesn't recognize both arguments. Also, if I do this it produces an error: Node[bool] test; Node node;

Re: DDoc with cross-references

2012-04-02 Thread Ary Manzana
On 4/2/12 2:07 PM, Jonathan M Davis wrote: On Monday, April 02, 2012 13:52:47 Ary Manzana wrote: On 4/2/12 12:39 PM, Jonathan M Davis wrote: On Monday, April 02, 2012 12:20:31 Ary Manzana wrote: I'm planning to add cross-references to the default ddoc output. At least that's the simplest

Re: DDoc with cross-references

2012-04-02 Thread Ary Manzana
On 4/2/12 2:16 PM, Ary Manzana wrote: On 4/2/12 2:07 PM, Jonathan M Davis wrote: On Monday, April 02, 2012 13:52:47 Ary Manzana wrote: On 4/2/12 12:39 PM, Jonathan M Davis wrote: On Monday, April 02, 2012 12:20:31 Ary Manzana wrote: I'm planning to add cross-references to the default ddoc

Help with C++

2012-04-02 Thread Ary Manzana
Hi, I'm trying to make some additions to DMD. First I want to add a virtual function: virtual void emitLink(OutBuffer *buf) to the struct Type. I did that. Then on doc.c I implement it empty: void Type::emitLink(OutBuffer *buf) { } Then I use it somewhere, like in

Re: Help with C++

2012-04-02 Thread Ary Manzana
On 4/3/12 4:01 AM, Dmitry Olshansky wrote: On 02.04.2012 18:27, Ary Manzana wrote: Hi, I'm trying to make some additions to DMD. First I want to add a virtual function: virtual void emitLink(OutBuffer *buf) to the struct Type. I did that. Then on doc.c I implement it empty: void Type

Re: Getting only the data members of a type

2012-04-01 Thread Ary Manzana
On 4/1/12 8:09 PM, Jacob Carlborg wrote: On 2012-04-01 08:18, Ali Çehreli wrote: On 03/31/2012 09:09 PM, Artur Skawina wrote: enum s = cast(S*)null; foreach (i, m; s.tupleof) { enum name = S.tupleof[i].stringof[4..$]; alias typeof(m) type; writef((%s) %s\n, type.stringof, name); }

DDoc with cross-references

2012-04-01 Thread Ary Manzana
I'm planning to add cross-references to the default ddoc output. At least that's the simplest thing I could do right now that might improve ddoc somehow. I see the documentation generated for phobos, for example: http://dlang.org/phobos/std_array.html#Appender has anchors to the many symbols

Re: DDoc with cross-references

2012-04-01 Thread Ary Manzana
On 4/2/12 12:20 PM, Ary Manzana wrote: I'm planning to add cross-references to the default ddoc output. At least that's the simplest thing I could do right now that might improve ddoc somehow. I see the documentation generated for phobos, for example: http://dlang.org/phobos/std_array.html

Re: DDoc with cross-references

2012-04-01 Thread Ary Manzana
On 4/2/12 12:39 PM, Jonathan M Davis wrote: On Monday, April 02, 2012 12:20:31 Ary Manzana wrote: I'm planning to add cross-references to the default ddoc output. At least that's the simplest thing I could do right now that might improve ddoc somehow. I see the documentation generated

Compiling DMD's source code in Mac OSX

2012-03-29 Thread Ary Manzana
Hi, Does anyone have a build script or something similar for compiling DMD under Mac? I cloned the repo but all I can see is a win32.mak file. I renamed it to Makefile and tried make but no luck. I don't have much experience with make or makefiles. Thanks, Ary

Re: Can I do an or in a version block?

2012-03-13 Thread Ary Manzana
On 3/13/12 2:21 PM, Ali Çehreli wrote: On 03/09/2012 06:20 AM, Andrej Mitrovic wrote: The same story goes for unittests which can't be independently ran to get a list of all failing unittests D unittest blocks are for code correctness (as opposed to other meanings of the unfortunately

Re: Tempfiles in unittests

2012-03-11 Thread Ary Manzana
On 03/11/2012 06:14 PM, Jonathan M Davis wrote: On Sunday, March 11, 2012 13:33:34 Magnus Lie Hetland wrote: On 2012-03-10 17:10:52 +, Jonathan M Davis said: Otherwise, this wouldn't have been a problem :) Then you'll probably have to write a wrapper function which just uses byLine and

Re: Can I do an or in a version block?

2012-03-08 Thread Ary Manzana
On 3/8/12 2:38 AM, Tyler Jameson Little wrote: I would like to do something like this: version (linux || BSD) { // do something... } else { version (Windows) { // do something else } else { // do something else assert(false, Unsupported operating system); } } The only way I've been able to do

Re: Can I do an or in a version block?

2012-03-08 Thread Ary Manzana
On 3/8/12 6:11 PM, H. S. Teoh wrote: On Thu, Mar 08, 2012 at 05:56:09PM -0300, Ary Manzana wrote: [...] I don't think it would be hard to implement boolean logic inside version. It's not hard at all. Would it make sense if I make a pull request for it? Walter would reject it. He has

Re: 0 negative loop condition bug or misunderstanding on my part

2012-03-07 Thread Ary Manzana
On 3/7/12 2:28 AM, Ali Çehreli wrote: On 03/06/2012 09:11 PM, ixid wrote: I'm writing my first basic algorithms, this one is merge sort. This version throws an exception when array.length - setSize is negative (which should be fine, the rest of my function would deal with it): template

Re: Make alias parameter optional?

2012-02-27 Thread Ary Manzana
On 2/25/12 10:04 PM, Robert Rouse wrote: On Saturday, 25 February 2012 at 23:10:51 UTC, Ary Manzana wrote: On 2/25/12 7:31 PM, Robert Rouse wrote: On Saturday, 25 February 2012 at 22:12:55 UTC, Ali Çehreli wrote: On 02/25/2012 01:55 PM, Robert Rouse wrote: On Saturday, 25 February 2012

Re: Make alias parameter optional?

2012-02-25 Thread Ary Manzana
On 2/25/12 7:31 PM, Robert Rouse wrote: On Saturday, 25 February 2012 at 22:12:55 UTC, Ali Çehreli wrote: On 02/25/2012 01:55 PM, Robert Rouse wrote: On Saturday, 25 February 2012 at 18:54:35 UTC, Trass3r wrote: void foo(T, T2, alias thing = (){})(T a, T2 b) { thing(); } void bar(){} void

Re: Make a variable single-assignment?

2011-11-22 Thread Ary Manzana
On 11/21/11 1:17 PM, Kapps wrote: For one reason, public fields that lack a set without having to create a backing field, followed by a bulky property. It does sound lazy, but when it's something you have to repeat many times, it gets annoying. On 21/11/2011 9:43 AM, Ary Manzana wrote: On 11

Re: Make a variable single-assignment?

2011-11-21 Thread Ary Manzana
On 11/21/11 11:04 AM, Alex Rønne Petersen wrote: Hi, Is there any way to make a variable single-assignment, regardless of its type? I.e.: void foo() { some magical keyword? int i = 0; i = 2; // Error: i cannot be reassigned } I realize const and immutable will do this, but they are transitive

Re: std.container ranges

2011-11-02 Thread Ary Manzana
On 11/2/11 8:48 AM, Steven Schveighoffer wrote: On Tue, 01 Nov 2011 16:53:26 -0400, Max Wolter awishform...@gmail.com wrote: On 10/30/2011 9:28 PM, Jonathan M Davis wrote: On Sunday, October 30, 2011 20:53:02 Max Wolter wrote: Hello there. Thank you very much for the explanation. However,

Re: how to use curl to download a file

2011-11-02 Thread Ary Manzana
On 11/1/11 11:49 PM, Mike Parker wrote: On 11/2/2011 3:20 AM, Frédéric Galusik wrote: Hi, As the curl documentation is a little bit ...wow. http://www.digitalmars.com/d/2.0/phobos/etc_c_curl.html Do someone have a simple example on how to download a simple file ? Thank you. ++ I don't

Re: std.container ranges

2011-11-02 Thread Ary Manzana
On 11/2/11 10:12 AM, Steven Schveighoffer wrote: On Wed, 02 Nov 2011 08:40:19 -0400, Ary Manzana a...@esperanto.org.ar wrote: On 11/2/11 8:48 AM, Steven Schveighoffer wrote: The basic response to this is, when dealing with containers generically (that is, you know you have a container

Re: FIFO stack

2011-10-27 Thread Ary Manzana
On 10/27/11 8:38 AM, Nick Sabalausky wrote: Ary Manzanaa...@esperanto.org.ar wrote in message news:j89gle$9nn$1...@digitalmars.com... On 10/26/11 1:28 PM, Jonathan M Davis wrote: On Wednesday, October 26, 2011 09:00 Dominic Jones wrote: Also an plain array is a good stack. :) I'd rather

Re: FIFO stack

2011-10-26 Thread Ary Manzana
On 10/26/11 1:28 PM, Jonathan M Davis wrote: On Wednesday, October 26, 2011 09:00 Dominic Jones wrote: Also an plain array is a good stack. :) I'd rather not use a plain array because (I assume) that when I push or pop using arrays, a swap array is created to resize the original. If this is

Re: What's the technical reason that class ctors aren't virtual?

2011-08-24 Thread Ary Manzana
On 8/24/11 12:27 PM, Ali Çehreli wrote: On Wed, 24 Aug 2011 16:59:46 +0200, Andrej Mitrovic wrote: class Foo { this(int x, int y) { } } class Bar : Foo { } Bar has to define its own ctor even if it only forwards the call to the super() ctor, e.g.: class Bar : Foo { this(int x, int

Re: enum inheritance?

2011-08-14 Thread Ary Manzana
On 8/13/11 9:42 PM, Simen Kjaeraas wrote: On Sun, 14 Aug 2011 01:15:29 +0200, mimocrocodil 4deni...@gmail.com wrote: Hi! I am want to extend available enum to provide more items to them. How I can do this job without manual copying of exsisting enum items? If what you want is a new enum

Re: swap doesn't work in CTFE?

2011-07-05 Thread Ary Manzana
On 7/4/11 11:39 PM, Daniel Murphy wrote: bearophilebearophileh...@lycos.com wrote in message news:iut093$1bjg$1...@digitalmars.com... Daniel Murphy: Same thing happens with pointers. Reduced: Pointers to structs in CTFE will work in DMD 2.054 :-) When they don't crash the compiler, that

Re: nested comments

2011-05-30 Thread Ary Manzana
On 5/31/11 7:58 AM, Nick Sabalausky wrote: bearophilebearophileh...@lycos.com wrote in message news:is1dj6$ihb$1...@digitalmars.com... Jesse Phillips: The purpose is commenting out code, but note that there is also version(none) { } which is never compiled in. version(none) {} is probably

Re: Matrix creation quiz

2011-04-30 Thread Ary Manzana
On 4/28/11 8:02 PM, bearophile wrote: A little quiz. This is related to a recent post of mine in the main D newsgroup, but please don't take a look at that post yet. This is the original function: What are unsigned values good for?

Re: What are delimited strings good for?

2011-04-10 Thread Ary Manzana
On 4/10/11 11:03 AM, simendsjo wrote: Ref http://digitalmars.com/d/2.0/lex.html What are some possible use cases for delimited strings? What is solved by having this in the language? Readability. auto s = This is 'something' that \could\ have been made easier to read; auto t = q[This is

Re: What are delimited strings good for?

2011-04-10 Thread Ary Manzana
On 4/10/11 5:51 PM, Jonathan M Davis wrote: On 4/10/11 11:03 AM, simendsjo wrote: Ref http://digitalmars.com/d/2.0/lex.html What are some possible use cases for delimited strings? What is solved by having this in the language? Readability. auto s = This is 'something' that \could\ have been

Re: Want to help DMD bugfixing? Write a simple utility.

2011-03-20 Thread Ary Manzana
On 3/19/11 9:11 PM, Don wrote: Here's the task: Given a .d source file, strip out all of the unittest {} blocks, including everything inside them. Strip out all comments as well. Print out the resulting file. Motivation: Bug reports frequently come with very large test cases. Even ones which

Re: I seem to be able to crash writefln

2011-03-10 Thread Ary Manzana
On 3/10/11 4:15 AM, Andrew Wiley wrote: On Wed, Mar 9, 2011 at 5:19 PM, Joel Christensenjoel...@gmail.com wrote: This is on Windows 7. Using a def file to stop the terminal window coming up. win.def EXETYPE NT SUBSYSTEM WINDOWS bug.d import std.stdio; import std.string; void main() {

Re: I seem to be able to crash writefln

2011-03-10 Thread Ary Manzana
On 3/10/11 4:40 AM, Andrew Wiley wrote: On Thu, Mar 10, 2011 at 1:31 AM, Jonathan M Davisjmdavisp...@gmx.com wrote: On Wednesday 09 March 2011 23:15:13 Andrew Wiley wrote: On Wed, Mar 9, 2011 at 5:19 PM, Joel Christensenjoel...@gmail.com wrote: This is on Windows 7. Using a def file to stop

Re: How do you test pre-/post-conditions and invariants?

2011-02-25 Thread Ary Manzana
On 2/25/11 1:48 PM, spir wrote: On 02/25/2011 04:30 PM, Magnus Lie Hetland wrote: Or, more generally, how do you test asserts (which is what I'm using in my preconditions etc.)? As far as I can see, collectException() won't collect errors, which is what assert() throws -- so what's the

Re: Context-Free Grammars? What about arrays?

2011-02-11 Thread Ary Manzana
On 2/11/11 6:03 AM, %u wrote: Hi, I think I'm having a little trouble understanding what's meant by context-free grammar. I've read that D is context-free, but is it really? What about an expression like: int[U] s; ? You can't tell -- without looking at the context -- whether U is a data type

Re: Accessing this of containing class

2011-02-03 Thread Ary Manzana
On 2/3/11 10:29 AM, Steven Schveighoffer wrote: On Thu, 03 Feb 2011 03:43:43 -0500, Jonathan M Davis jmdavisp...@gmx.com wrote: On Thursday 03 February 2011 00:38:08 Jacob Carlborg wrote: On 2011-02-03 07:21, Jonathan M Davis wrote: On Wednesday 02 February 2011 21:26:00 Mandeep Singh Brar

Re: Source code annotations alla Java

2011-01-21 Thread Ary Manzana
On 1/20/11 5:48 PM, Jacob Carlborg wrote: On 2011-01-20 21:34, Steven Schveighoffer wrote: On Thu, 20 Jan 2011 15:03:55 -0500, Jacob Carlborg d...@me.com wrote: On 2011-01-20 19:18, Steven Schveighoffer wrote: On Thu, 20 Jan 2011 13:07:58 -0500, Jacob Carlborg d...@me.com wrote: On