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
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
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?
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
Why pragma(lib, "name"); for .di files does not causes adding -lname to
the linker command line?
For .d it works.
(Compiler is DMD)
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
If try to link with any another lib (.so or .a) it works fine. Looks very
strange!
Jesse Phillips:
Bingo! it is compiles and works!
Many thanks! :)
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?
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
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
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?
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
subj
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[]
:)
to Timon Gehr:
Thanks! Yes, I am used -m64
16 matches
Mail list logo