22.01.2011 23:04, Sean Eskapp пишет:
I'm using the Derelict SDL bindings, and I'm wrapping some parts of SDL in my
own objects. Originally, I was using classes, but this caused a number of
errors when the program exited, since Derelict unloaded itself before the
garbage collector took care of
Is this a bug?
import std.stdio;
string[string] values = [abc:abc, def:def];
void main()
{
string[string] values2 = [abc:abc, def:def];
}
test.d(3): Error: non-constant expression [abc:abc,def:def]
What's non-constant about that expression?
Tobias Pankrath wrote:
Hello,
I just got my hands on a copy of TDPL and I like the book and D is very
promising. But I run into problems with the easiest of program. I just
want to write to and from a stream, just the way it is possible with
C++ stringstreams. But this program produces an empty
Hi i come from a c# background
I would like to write the following code in the according D style but i'm not
sure howto do it
c# code:
void foo(IEnumerabledouble[] data)
{
foreach (var d in data)
{
do_some_stuff(d);
}
}
i guess the D equivalent to IEnumerable is Range? how would it
pragma the_ignora...@hotmail.com wrote:
Hi i come from a c# background
I would like to write the following code in the according D style but
i'm not
sure howto do it
c# code:
void foo(IEnumerabledouble[] data)
{
foreach (var d in data)
{
do_some_stuff(d);
}
}
i guess the D
Jesse Phillips jessekphillip...@gmail.com wrote:
Simen kjaeraas Wrote:
pragma the_ignora...@hotmail.com wrote:
Hi i come from a c# background
I would like to write the following code in the according D style but
i'm not
sure howto do it
c# code:
void foo(IEnumerabledouble[] data)
{
On Mon, 24 Jan 2011 14:39:33 -0500, Simen kjaeraas
simen.kja...@gmail.com wrote:
pragma the_ignora...@hotmail.com wrote:
Hi i come from a c# background
I would like to write the following code in the according D style but
i'm not
sure howto do it
c# code:
void foo(IEnumerabledouble[]
On 01/24/2011 04:45 PM, Andrej Mitrovic wrote:
Is this a bug?
import std.stdio;
string[string] values = [abc:abc, def:def];
void main()
{
string[string] values2 = [abc:abc, def:def];
}
test.d(3): Error: non-constant expression [abc:abc,def:def]
What's non-constant about that
How do I get dmd's memory usage a few hundred MBs down?
I keep having to close everything in order not to get an out of memory error
while compiling (-w -full).
I'd like to get it from 700-800 to below 400 :)
Any way to inspect which part is the biggest drain?
Er, bit exaggerated..
450 to below 300 pls :)
On 24/01/11 22:14, %u wrote:
How do I get dmd's memory usage a few hundred MBs down?
I keep having to close everything in order not to get an out of memory error
while compiling (-w -full).
I'd like to get it from 700-800 to below 400 :)
Any way to inspect which part is the biggest drain?
CTFE
in the following:
void main(){
char[] x;
string s;
string y;
y = s ~ x;
}
tok.d(5): Error: cannot implicitly convert expression
(cast(const(char)[])s ~ x) of type char[] to string
why should typeof(s ~ x) == char[] ?
== Quote from Robert Clipsham (rob...@octarineparrot.com)'s article
CTFE and templates will use up the most memory - particularly if you use
a lot of strings, as the memory allocated is never freed. You can work
around it be compiling files one at a time or a few at a time, so
instead of:
$
On 24/01/11 23:09, Ellery Newcomer wrote:
in the following:
void main(){
char[] x;
string s;
string y;
y = s ~ x;
}
tok.d(5): Error: cannot implicitly convert expression
(cast(const(char)[])s ~ x) of type char[] to string
why should typeof(s ~ x) == char[] ?
x is a mutable array of mutable
Ellery Newcomer ellery-newco...@utulsa.edu wrote:
in the following:
void main(){
char[] x;
string s;
string y;
y = s ~ x;
}
tok.d(5): Error: cannot implicitly convert expression
(cast(const(char)[])s ~ x) of type char[] to string
why should typeof(s ~ x) == char[] ?
On 1/24/11, BlazingWhitester max.kl...@gmail.com wrote:
On 2011-01-24 17:45:03 +0200, Andrej Mitrovic said:
Is this a bug?
import std.stdio;
string[string] values = [abc:abc, def:def];
void main()
{
string[string] values2 = [abc:abc, def:def];
}
test.d(3): Error: non-constant
On 25.01.2011 00:22, Robert Clipsham wrote:
If you append something mutable to something immutable, the resulting
type must be mutable, as some of the contents is mutable and could be
changed - if that can happen the result can't be immutable. To get
around this there's .idup I believe.
This
Andrej Mitrovic:
It's interesting that enum works but immutable doesn't. enum will do, Thanks.
But there are some problems with enum AAs. Take a look at this little program:
enum int[int] aa = [1:2, 3:4];
int foo(int x) {
return aa[x];
}
void main() {}
And the asm of foo():
18 matches
Mail list logo