January 29, 2005
I was experimenting with arrays.. this is what i get on compiling

Internal error: ..\ztc\cgcs.c 353

this code

import std.stdio;

void main()
{
char[] s="bobef";
delete s[1..3];
writef(s~"\n");
}


January 29, 2005
In article <ctel5g$109l$1@digitaldaemon.com>, bobef says...
>
>I was experimenting with arrays.. this is what i get on compiling
>
>Internal error: ..\ztc\cgcs.c 353
>
>this code
>
>import std.stdio;
>
>void main()
>{
>char[] s="bobef";
>delete s[1..3];
>writef(s~"\n");
>}
>

No offense intended to Walter, but that has got to be some kind of record for the fewest number of bytes needed to kill the compiler.  (well at least in the past two years anyway)

Nice work!

- EricAnderton at yahoo
January 29, 2005
bobef wrote:

> I was experimenting with arrays.. this is what i get on compiling
> 
> Internal error: ..\ztc\cgcs.c 353

No compiler errors with GDC, then again the code is invalid :

> this code
> 
> import std.stdio;
> 
> void main()
> {
> char[] s="bobef";
> delete s[1..3];
> writef(s~"\n");
> }

Wonder why are you trying to "delete" a char[] ?
Removing entries with delete only works with AA.

import std.stdio;

void main()
{
  char[] s="bobef";
  s = s[0..1] ~ s[3..s.length];
  writefln(s);
}

Should output what I think you meant ?
There is no slice delete syntax (yet)

--anders
January 29, 2005
pragma wrote:
> In article <ctel5g$109l$1@digitaldaemon.com>, bobef says...
> 
>>I was experimenting with arrays.. this is what i get on compiling
>>
>>Internal error: ..\ztc\cgcs.c 353
>>
>>this code
>>
>>import std.stdio;
>>
>>void main()
>>{
>>char[] s="bobef";
>>delete s[1..3];
>>writef(s~"\n");
>>}
>>
> 
> 
> No offense intended to Walter, but that has got to be some kind of record for
> the fewest number of bytes needed to kill the compiler.  (well at least in the
> past two years anyway)
> 
> Nice work!
> 
> - EricAnderton at yahoo

Here goes a shorter dmd killer :)
class C{this(){super();}}
January 29, 2005
zwang wrote:
| pragma wrote:
|
|> In article <ctel5g$109l$1@digitaldaemon.com>, bobef says...
|>
|>> I was experimenting with arrays.. this is what i get on compiling
|>>
|>> Internal error: ..\ztc\cgcs.c 353

- -> nntp://news.digitalmars.com/digitalmars.D.bugs

[snip]

| Here's a one-liner version :)
| void main(char[][]a){delete a[0..0];}

Zwang, I've added your ultra short version to DStress
http://dstress.kuehne.cn/nocompile/bug_cgcs_353_B.d

Thomas



Top | Discussion index | About this forum | D home