Aaaargh, I've used function imports, completely disregarding that
they're not present in 2.053 and now I can't deploy code to github
because people won't be able to compile it.
Ahh the joys.. Well I'm glad I caught this now before embarrassing myself.
On 6/21/11, Nick Sabalausky wrote:
> UFCS barely works at all in D2. Another example:
Couple that with the classically buggy 'with' statement and you've got
yourself a party! \o/
"Andrej Mitrovic" wrote in message
news:mailman.1030.1308543325.14074.digitalmar...@puremagic.com...
>I think I've just found the first bug:
>
> module test;
> void main()
> {
> }
>
> void foo()
> {
>import std.utf;
>"bla".toUTF16z;
> }
>
> Error: undefined identifier module test.toUTF16
On 6/20/11 3:04 PM, Jacob Carlborg wrote:
On 2011-06-20 05:18, Ary Manzana wrote:
On 6/19/11 5:20 AM, Andrej Mitrovic wrote:
This is such a great debugging tool. I mean ddbg is great on its own.
But being able to quickly import std.stdio and do a few debug writes
in some library function is fan
On 2011-06-20 05:18, Ary Manzana wrote:
On 6/19/11 5:20 AM, Andrej Mitrovic wrote:
This is such a great debugging tool. I mean ddbg is great on its own.
But being able to quickly import std.stdio and do a few debug writes
in some library function is fantastic.
print-debugging is so common... i
I think I've just found the first bug:
module test;
void main()
{
}
void foo()
{
import std.utf;
"bla".toUTF16z;
}
Error: undefined identifier module test.toUTF16z
UFCS doesn't work with function imports. This is a bug, right?
On 6/19/11 5:20 AM, Andrej Mitrovic wrote:
This is such a great debugging tool. I mean ddbg is great on its own.
But being able to quickly import std.stdio and do a few debug writes
in some library function is fantastic.
print-debugging is so common... in Ruby you always have "puts"
available,
This is such a great debugging tool. I mean ddbg is great on its own.
But being able to quickly import std.stdio and do a few debug writes
in some library function is fantastic.
On 2011-06-12 23:15, Walter Bright wrote:
Nobody seems to have noticed yet, but yesterday I removed the
restriction preventing import declarations from being used in functions.
These now work:
void test1()
{
import std.c.stdio;
printf("hello world\n");
}
void test2()
{
static import std.c.stdio
Well it seems to work fine. :)
On 6/13/2011 8:48 PM, Andrej Mitrovic wrote:
> I'm guessing this is what you're after:
>
> http://codepad.org/TCtG68Fw
> http://codepad.org/65GBDjPS
>
> rdmd main.d
> shared ctor!
> ctor!
> foo.test
> dtor!
> shared dtor!
Actually, not what I was thinking. I was thinking something like this:
f
Should DLLs even have module ctors/dtors?
I think this is what DLLMain's DLL_PROCESS_ATTACH, DLL_THREAD_ATTACH
and their detach counterparts are for.
I'm guessing this is what you're after:
http://codepad.org/TCtG68Fw
http://codepad.org/65GBDjPS
rdmd main.d
shared ctor!
ctor!
foo.test
dtor!
shared dtor!
And they do run, I've tested it in a non-DLL example.
When I add module ctors/dtors, I get the ModuleInfoZ shenanigans again.
On 6/13/2011 8:28 PM, Andrej Mitrovic wrote:
> Walter, it looks like this addition inadvertently fixes the issue of
> DLLs not linkable due to Phobos imports.
>
> I've had this DLL (alongside with dllmodule.d which had initialization
> calls inside DLLMain):
> module EdrLib;
>
> import std.utf;
>
Walter, it looks like this addition inadvertently fixes the issue of
DLLs not linkable due to Phobos imports.
I've had this DLL (alongside with dllmodule.d which had initialization
calls inside DLLMain):
module EdrLib;
import std.utf;
pragma(lib, "gdi32.lib");
pragma(lib, "comdlg32.lib");
import
On Jun 14, 11 03:55, Andrej Mitrovic wrote:
Btw, it's disappointing that I can't call split with a separator at
compile-time:
enum result = split("bla, bla"); // ok
enum result = split("bla, bla", ","); // nope
That's due to (at least) http://d.puremagic.com/issues/show_bug.cgi?id=4047.
Btw, it's disappointing that I can't call split with a separator at
compile-time:
enum result = split("bla, bla"); // ok
enum result = split("bla, bla", ","); // nope
I'm having some fun with this.
import std.array;
void main()
{
with (namespace!("std.stdio std.algorithm std.range"))
{
auto squares = map!("a * a")([2, 4, 6]);
writeln(squares);
}
}
template namespace(string x)
{
mixin(namespaceImpl(x));
}
string namespaceImpl(s
On 12/06/2011 22:15, Walter Bright wrote:
Nobody seems to have noticed yet, but yesterday I removed the
restriction preventing import declarations from being used in functions.
These now work:
void test1()
{
import std.c.stdio;
printf("hello world\n");
}
void test2()
{
static import std.c.stdio
On 6/12/11 5:08 PM, Andrej Mitrovic wrote:
This seems like a way to simulate namespaces in C++, right? I wouldn't
know, but it looks similar to that 'using foo' trick.
I hope not :o). C++ namespaces are quite lacking.
Andrei
On 6/13/11, Jonathan M Davis wrote:
< snip>
So much for my blurry recollection of C++ features. :-)
On 2011-06-12 15:08, Andrej Mitrovic wrote:
> This seems like a way to simulate namespaces in C++, right? I wouldn't
> know, but it looks similar to that 'using foo' trick.
C++ namespaces are completely different. Everything in a namespace has to be
referenced by its namespace explicitly unless y
On 13.06.2011 1:15, Walter Bright wrote:
Nobody seems to have noticed yet, but yesterday I removed the
restriction preventing import declarations from being used in
functions. These now work:
void test1()
{
import std.c.stdio;
printf("hello world\n");
}
void test2()
{
static impor
On Sun, 12 Jun 2011 14:15:27 -0700, Walter Bright wrote:
> Nobody seems to have noticed yet, but yesterday I removed the
> restriction preventing import declarations from being used in functions.
> These now work:
>
> void test1()
> {
> import std.c.stdio;
> printf("hello world\n");
> }
This seems like a way to simulate namespaces in C++, right? I wouldn't
know, but it looks similar to that 'using foo' trick.
On 06/12/2011 04:33 PM, Adam D. Ruppe wrote:
This is awesome!
Another benefit here is code running programs are simplified. For
"D script" kind of things, a technique I use is to simply wrap some
code inside a main function. Almost every feature worked there -
nested functions, structs, classes,
This is awesome!
Another benefit here is code running programs are simplified. For
"D script" kind of things, a technique I use is to simply wrap some
code inside a main function. Almost every feature worked there -
nested functions, structs, classes, etc. Now imports do too! Yay!
On 06/12/2011 04:15 PM, Walter Bright wrote:
Nobody seems to have noticed yet, but yesterday I removed the
restriction preventing import declarations from being used in functions.
These now work:
void test1()
{
import std.c.stdio;
printf("hello world\n");
}
void test2()
{
static import std.c.st
Nobody seems to have noticed yet, but yesterday I removed the restriction
preventing import declarations from being used in functions. These now work:
void test1()
{
import std.c.stdio;
printf("hello world\n");
}
void test2()
{
static import std.c.stdio;
std.c.stdio.printf("hell
31 matches
Mail list logo