Re: ditto in DDoc

2010-10-08 Thread Yao G.
r copy of a document. -- Yao G.

Re: dcollection docs

2010-09-27 Thread Yao G.
nd by improve it I mean to remove that cloud-like unordered list of symbols, and use a tree or something similar. CandyDoc sometimes hangs Opera, so I wanted to make a quick replacement, that also worked well without JavaScript. Maybe I'll switch to Kandil or just use the doc generator of Dil. -- Yao G.

Re: dcollection docs

2010-09-27 Thread Yao G.
ODE macros). They don't have licence because I didn't find an equivalent to the Boost Licence but for documentation, but they can be used freely for whatever need you have. I still have to make some improvements, for example create a tree of symbols, like the one in Kandil or CandyDoc. -- Yao G.

Re: date and time

2010-09-25 Thread Yao G.
. Thanks in advance. :-) std.datetime is your friend. http://www.digitalmars.com/d/2.0/phobos/std_date.html -- Yao G.

Re: Translation of C function pointer.

2010-09-15 Thread Yao G.
DlSym).stringof); outputs: void function() function(sqlite3_vfs*, void*, const const(char*) zSymbol) so I think it's a function pointer that takes those parameters and returns a function pointer that takes no parameters and returns nothing. -Steve Thanks Steve! -- Yao G.

Translation of C function pointer.

2010-09-15 Thread Yao G.
don't know how to convert it to a D function pointer. Certainly, the inner pointer is easy: void (* function(sqlite3_vfs*,void*, const(char) *zSymbol) xDlSym)(); But what about the outer one? I am missing something? Thanks in advance. -- Yao G.

Re: Nicer looking ddoc

2010-08-31 Thread Yao G.
hobos ddoc files at: http://www.dsource.org/projects/phobos/browser/trunk/docsrc -- Yao G.

void[] vs byte[]

2010-08-28 Thread Yao G.
the choice is byte[] (chunk in std.stdio). Is there a place where this stuff is documented? Or choosing one or another is just a matter of preference and the differences are trivial? Thanks in advance. -- Yao G.

Re: Compound assignment operators

2010-08-25 Thread Yao G.
Davis Ha ha ha! What a shame, I was reading that page looking for a solution, but it seems that I just skipped that part. Thanks and sorry for the stupid question. -- Yao G.

Re: Compound assignment operators

2010-08-25 Thread Yao G.
ot a scalar, it is a Foo Error: 'f1' is not of arithmetic type, it is a Foo Error: 'f2' is not of arithmetic type, it is a Foo Is there a way to make this work? Even changing the operator string in opBinary to "-" doesn't do nothing. Or those kind of operators can't be overloaded? -- Yao G.

Compound assignment operators

2010-08-25 Thread Yao G.
_bar -= rhv._bar; return this; } private int _bar; } void main() { au -- Yao G.

Re: TDPL: Operator Overloading

2010-08-24 Thread Yao G.
CheckedInt. Maybe someone with more experience on templates can give you a better (or correct, I'm just guessing this :) ) answer. -- Yao G.

Re: TDPL: Operator Overloading

2010-08-24 Thread Yao G.
erstand is how the constructor can be called like that. In my example the mixin would convert the code to: return CheckedInt(10); But if I ever tried a call like "CheckedInt(10)" in a unittest block, it wouldn't work. So how does this magic work? http://www.digitalmars.com/d/2.0/mixin.html -- Yao G.

Re: How do you call GetVersionEx (Windows)?

2010-08-23 Thread Yao G.
For my projects, I rolled my own headers. They are based (like the ones on dsource) on the MinGW32 project. But mine target Windows 2000 as minimal O.S. and use exclusively UTF-32 (the ASCI versions are not defined). Also, Replace UTF-32 with UTF-16 :D -- Using Opera's revolutionary e-mai

Re: How do you call GetVersionEx (Windows)?

2010-08-23 Thread Yao G.
Relevant links: http://dsource.org/projects/bindings/wiki/WindowsApi http://dsource.org/projects/bindings/browser/trunk/win32 -- Yao G.

Re: How do you call GetVersionEx (Windows)?

2010-08-23 Thread Yao G.
e exclusively UTF-32 (the ASCI versions are not defined). Also, some functions for newer O.S. are declared as function pointers (so you can link to them dynamically). They are incomplete, maybe buggy in some cases, but I think that could come handy in my Windows projects. -- Yao G.

Re: How do you call GetVersionEx (Windows)?

2010-08-22 Thread Yao G.
the newer ones. I grabbed the lib files I use from a link that somebody posted here in the NG a few years ago. Sadly I can't find that link anymore. -- Yao G.

Re: How do you call GetVersionEx (Windows)?

2010-08-22 Thread Yao G.
TCHAR alias too. Remember that a lot of Windows functions, specially the ones that deal with strings and characters, have two versions: functionNameA for ASCI/UTF-8 and functionNameW for UTF-16. -- Yao G.

Re: How do you call GetVersionEx (Windows)?

2010-08-22 Thread Yao G.
r 7" ); } } } --- I have several modified lib files with more functions defined. The ones that come bundled with DMD are severely outdated. If you have some linking problems, try to use the aliases that I suggested on the code comments. -- Yao G.

Re: floor, ceil equivalent

2010-08-22 Thread Yao G.
On Sun, 22 Aug 2010 13:49:26 -0500, Blonder wrote: I am looking for a floor/ceil function in D, is there an equivalent function, I haven't found any yet. Floor: http://digitalmars.com/d/2.0/phobos/std_math.html#floor Ceil: http://digitalmars.com/d/2.0/phobos/std_math.html#ceil -- Yao G.

Re: How to avoid the console from apearing.

2010-08-17 Thread Yao G.
ntime; import std.c.windows.windows, std.process; extern(Windows) int WinMain( HINSTANCE, HINSTANCE, LPSTR, int ) { return system( r"bin\someprogram.exe" ); } --- -- Yao G.

Re: typedef alternative

2010-08-14 Thread Yao G.
DatePartImpl!(DatePart.Day) Day; void foo( Year y, Month m, Day d ) {} // Works correctly foo( Year(2010), Month(8), Day(14) ); // But this isn't allowed foo( Day(14), Year(2010), Month(8) ); --- -- Yao G.

Re: typedef alternative

2010-08-14 Thread Yao G.
static if ( type == Type.Sub ) { @disable void opAssign( T value ); } } I think I'll do something similar as this. I don't need either explicit or implicit cast between types. -- Yao G.

Re: typedef alternative

2010-08-14 Thread Yao G.
types that I'm defining are value types. But thanks for the answer -- Yao G.

Re: typedef alternative

2010-08-14 Thread Yao G.
, that if you pass a Year instance to the Month parameter, generate a compiler error. -- Yao G.

typedef alternative

2010-08-14 Thread Yao G.
y(1), Year(1), Month(1) ); --- So, what options do I have? I know that typedef is scheduled to deprecation, so I would like to know if there's something else. -- Yao G.

Re: ddoc file on command line

2010-08-10 Thread Yao G.
I forgot to mention that I'm using the latest (beta) version of DMD 2 on Windows XP. On Tue, 10 Aug 2010 20:52:18 -0500, Yao G. wrote: According to the DDOC spec (http://digitalmars.com/d/2.0/ddoc.html) if you want to redefine some macros, one way is to pass one file with the

ddoc file on command line

2010-08-10 Thread Yao G.
e new ones. The docbook.ddoc is on the same directory where I have the *.d files (code). Thanks in advance. -- Yao G.

Re: D and a bazillion of small objects

2010-06-03 Thread Yao G.
Thanks bearophile. I'll give it a try later. -- Yao.G On Thu, 03 Jun 2010 12:27:20 -0500, bearophile wrote: Yao G.: I think the idea of a memory pool or freelist is good. Can you point me where can I see your libs? Instead of just giving you a link to the dlibs1, I've ext

Re: D and a bazillion of small objects

2010-06-02 Thread Yao G.
Yeah. I think I'll do that. I just hope that no temporary copy is created in other item access or manipulation. Thanks. On Wed, 02 Jun 2010 20:04:53 -0500, Simen kjaeraas wrote: Yao G. wrote: Thanks bearophile. With respect to passing structs as reference, I also have this pr

Re: D and a bazillion of small objects

2010-06-02 Thread Yao G.
splay. So not only I need to allocate for each item instance, but also allocate the text string for each one :D I think the idea of a memory pool or freelist is good. Can you point me where can I see your libs? Thanks again. Yao G. On Wed, 02 Jun 2010 19:18:37 -0500, bearophile wrote

D and a bazillion of small objects

2010-06-02 Thread Yao G.
to manage the copies and to make effective all the item modification across all copies. But then I would be where I started: doing tons of heap allocations. So, how should I deal with this issue? Thanks. Yao G.

Re: String literal arguments

2010-04-07 Thread Yao G.
On Wed, 07 Apr 2010 03:05:34 -0400, Simen kjaeraas wrote: Yao G. wrote: Hello. Greetings. foo( "Hello World", first, second ); --- You can notice that the first argument is a string literal. What I want to know is: If a function argument is declared as a string literal, i

String literal arguments

2010-04-06 Thread Yao G.
Hello. I'm trying to learn more of D templates, but I'm stuck with an issue I cannot resolve. Well, actually, I don't know if this is even allowed, and that's why I'm posting here. Suppose I have a function declared like this: --- import std.traits; void foo(T...)(T args) if( isSomeString!(