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():
_D4test3fooF
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 i
On 1/24/11, BlazingWhitester 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)
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[] ?
http://d.puremagic.com/issues/show
Robert Clipsham wrote:
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
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
== 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:
>
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 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
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 expression ["abc":"abc","def":"def"]
What's non-c
Er, bit exaggerated..
450 to below 300 pls :)
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?
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-consta
On Mon, 24 Jan 2011 14:39:33 -0500, Simen kjaeraas
wrote:
pragma 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(IEnumerable data)
{
foreach (var d in data)
{
do_some_stuff(d
Jesse Phillips wrote:
Simen kjaeraas Wrote:
pragma 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(IEnumerable data)
> {
> foreach (var d in data)
> {
> do_some_stu
Simen kjaeraas Wrote:
> pragma 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(IEnumerable data)
> > {
> > foreach (var d in data)
> > {
> > do_some_
pragma 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(IEnumerable data)
{
foreach (var d in data)
{
do_some_stuff(d);
}
}
i guess the D equivalent to IEnumerable is Range? how
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(IEnumerable data)
{
foreach (var d in data)
{
do_some_stuff(d);
}
}
i guess the D equivalent to IEnumerable is Range? how would it look like i
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
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?
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 des
21 matches
Mail list logo