Thread overview | |||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
December 10, 2001 bug report(s) on alpha 0.01 | ||||
---|---|---|---|---|
| ||||
The code was: // inter.d interface IStream { bit read(void* buffer, int size); } interface OStream { bit write(void* buffer, int size); } > mars -I..\src\phobos inter.d Assertion failure: 'structsize >= 8' on line 425 in file 'glue.c' Seems to happen every time interfaces are used. BTW. Could you pleeease make the "bool" data type - might be just an always-defined enum bool { false, true = !false }! |
December 10, 2001 unnamed parameters | ||||
---|---|---|---|---|
| ||||
Posted in reply to Pavel Minayev | int main(char[][]) "no identifier for parameter 1 of main()" Hey, you said it's possible to omit parameter names! =) |
December 10, 2001 no function ... matches argument list | ||||
---|---|---|---|---|
| ||||
Posted in reply to Pavel Minayev | Something's definitely wrong! // file.d (Phobos) class File { ... static void write(char[] name, char[] buffer) ... } // my program char[] pc, dc; ... File.write(pc, dc); Compiler output: "..\src\phobos\file.d(77): no function write matches argument list (char [],char [])" ???????????????? |
December 10, 2001 on other hand... | ||||
---|---|---|---|---|
| ||||
Posted in reply to Pavel Minayev | "Pavel Minayev" <evilone@omen.ru> wrote in message news:9v344o$1k4n$2@digitaldaemon.com... > char[] pc, dc; > ... > File.write(pc, dc); Even more funny: char[] pc; char[] dc; ... File.write(pc, dc); Now it works!? |
December 11, 2001 array concatenation | ||||
---|---|---|---|---|
| ||||
Posted in reply to Pavel Minayev | The test snippet was: int main(char[][] args) { char[] s, t; s ~= t; s ~= "test"; } > mars -I..\src\phobos concat.d concat.d(5): can only concatenate arrays Note that appending t to s works, the problem is with constant strings. Also, not a bug really (although not sure): why can't elements, rather then arrays, be concatenated/ appended? char[] s; s = 'a' ~ 'r'; // "ar" s = 'm' ~ s; // "mar" s ~= 's'; // "mars" Since binary ~ is not used elsewhere, I don't see any reasons why this shouldn't work. BTW. Having used it for a while, ~ seems quite suitable for concatenation. I take my request (that one to change it with something else) away, it's fine already. |
December 11, 2001 Re: array concatenation | ||||
---|---|---|---|---|
| ||||
Posted in reply to Pavel Minayev | Ok, I'll work on the problems you found. I agree ~ does take a little getting used to. "Pavel Minayev" <evilone@omen.ru> wrote in message news:9v5jr1$c5a$1@digitaldaemon.com... > The test snippet was: > > int main(char[][] args) > { > char[] s, t; > s ~= t; > s ~= "test"; > } > > > mars -I..\src\phobos concat.d > concat.d(5): can only concatenate arrays > > Note that appending t to s works, the problem is > with constant strings. > > Also, not a bug really (although not sure): why > can't elements, rather then arrays, be concatenated/ > appended? > > char[] s; > s = 'a' ~ 'r'; // "ar" > s = 'm' ~ s; // "mar" > s ~= 's'; // "mars" > > Since binary ~ is not used elsewhere, I don't see > any reasons why this shouldn't work. > > BTW. Having used it for a while, ~ seems quite suitable > for concatenation. I take my request (that one to change > it with something else) away, it's fine already. > > |
December 12, 2001 Re: bug report(s) on alpha 0.01 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Pavel Minayev | In digging into this, I find I screwed up how interfaces are implemented. It'll take a couple days to rework it all. Please be patient! -Walter "Pavel Minayev" <evilone@omen.ru> wrote in message news:9v3243$1ivg$1@digitaldaemon.com... > The code was: > > > // inter.d > > interface IStream > { > bit read(void* buffer, int size); > } > > interface OStream > { > bit write(void* buffer, int size); > } > > > > mars -I..\src\phobos inter.d > Assertion failure: 'structsize >= 8' on line 425 in file 'glue.c' > > Seems to happen every time interfaces are used. > > BTW. Could you pleeease make the "bool" data type - might be just an always-defined enum bool { false, true = !false }! > > |
December 13, 2001 overloading functions taking objects | ||||
---|---|---|---|---|
| ||||
Posted in reply to Pavel Minayev | Just try to compile the following simple snippet: class Apple { } class Orange { } void Eat(Apple a) { } void Eat(Orange o) { } int main() { } D doesn't allow to overload Eat() for Oranges... |
December 14, 2001 Re: overloading functions taking objects | ||||
---|---|---|---|---|
| ||||
Posted in reply to Pavel Minayev | That's definitely a bug in the D compiler. The compiler should also issue an error for not returning a value from int main(). "Pavel Minayev" <evilone@omen.ru> wrote in message news:9varco$pa8$1@digitaldaemon.com... > Just try to compile the following simple snippet: > > class Apple { } > class Orange { } > > void Eat(Apple a) { } > void Eat(Orange o) { } > > int main() { } > > D doesn't allow to overload Eat() for Oranges... > > |
December 14, 2001 Re: on other hand... | ||||
---|---|---|---|---|
| ||||
Posted in reply to Pavel Minayev | "Pavel Minayev" <evilone@omen.ru> wrote in message news:9v34jn$1kjl$1@digitaldaemon.com... > "Pavel Minayev" <evilone@omen.ru> wrote in message news:9v344o$1k4n$2@digitaldaemon.com... > > > char[] pc, dc; > > ... > > File.write(pc, dc); > > Even more funny: > > char[] pc; char[] dc; > ... > File.write(pc, dc); > > Now it works!? You're right. I need to work on the declaration parsing for multiple names. It was working like in C, but then I just changed it, and it's broken. |
Copyright © 1999-2021 by the D Language Foundation