Why enum of structs are not initialised?

2011-08-11 Thread mimocrocodil
code: private struct request_variant { package: immutable string sql_query; } enum test : request_variant { current_time = request_variant( "SELECT now()" ), //users = { sql_query: "SELECT 'users list'::text" } } causes syntax error if I am uncommit second

Re: Why enum of structs are not initialised?

2011-08-11 Thread mimocrocodil
bearophile: >> causes syntax error if I am uncommit second string in enum > I think D enums are mostly meant for enumerations, of things like ints, > ushorts, chars, etc. (But enhancement requests are possible). I want to use this enum in 'final switch' statement. > Also is that "package:" act

Anybody seen *working* postgresql client library binding?

2011-08-11 Thread mimocrocodil
Or, may be, more high level library for Postgresql 9.0 ? I am checked: dpq dbi ddb no one is not compiling by dmd 2. It is need to start doing "dpq2" with a neat and beautiful code for working with libpq and D2?

Re: Anybody seen *working* postgresql client library binding?

2011-08-12 Thread mimocrocodil
Trass3r (u...@known.com): > Maybe http://arsdnet.net/dcode/postgres.d This is not pure binding, and it is not compiles with current std library without warnings and errors: std.stdarg is deprecated. You should import core.vararg instead. /usr/include/d/dmd/druntime/import/core/stdc/stdarg.di(9

pragma(lib, "name") for .di files

2011-08-12 Thread mimocrocodil
Why pragma(lib, "name"); for .di files does not causes adding -lname to the linker command line? For .d it works. (Compiler is DMD)

undefined reference to symbol '_end'

2011-08-12 Thread mimocrocodil
I am trying to link my program with libpq: $ dmd main.d dbwork.d -ofmain -v -L-lpq [skipped good output] importstd.c.linux.socket(/usr/include/d/dmd/phobos/std/c/linux/socket.d) importcore.sys.posix.netdb (/usr/include/d/dmd/druntime/import/core/sys/posix/netdb.di) importcore.sy

Re: undefined reference to symbol '_end'

2011-08-12 Thread mimocrocodil
If try to link with any another lib (.so or .a) it works fine. Looks very strange!

Re: undefined reference to symbol '_end'

2011-08-12 Thread mimocrocodil
Jesse Phillips: Bingo! it is compiles and works! Many thanks! :)

enum inheritance?

2011-08-13 Thread mimocrocodil
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?

Exception: constructor arguments?

2011-08-14 Thread mimocrocodil
Where I can find description of Exception class? I seen this URLs, but they do not contain this information: http://www.d-programming-language.org/phobos/std_exception.html http://www.d-programming-language.org/phobos/core_exception.html http://www.d-programming-language.org/errors.html

Re: Exception: constructor arguments?

2011-08-14 Thread mimocrocodil
Johannes Pfau: thanks! Next question: Why do we always have to send a text message with a standard class of Exception? After all, it might be never used, for example due to the fact that error messages are not sent to the user "as is": exception can be analyzed and translated for international

Re: const main args?

2011-08-15 Thread mimocrocodil
I seen what sendmail actually changes they arguments of command line for nice output of "ps ax" command. May be it changes his argc/argv for this?

byte* and int length -> byte[]

2011-08-15 Thread mimocrocodil
I obtain immutable(byte)* and int where contained length of bytes block from C library. Can I convert this into byte[] without explict copying etc. Something like: byte* p; // bytes int size; // size of bytes block byte[] b; b.length = size; b.ptr = p; // now b contains bytes from library

how to enable core dumps for assert() triggering?

2011-08-15 Thread mimocrocodil
subj

Re: byte* and int length -> byte[]

2011-08-15 Thread mimocrocodil
to Vijay Nayar: Thanks! Heh... Inside the my code this data also not be changed, so that I would agree to obtain something like immutable byte[] :)

Re: how to enable core dumps for assert() triggering?

2011-08-16 Thread mimocrocodil
to Timon Gehr: Thanks! Yes, I am used -m64