www.digitalmars.com         C & C++   DMDScript  

D - Problems and bugs in 0.76. - 0.76.zip

reply one_mad_alien hotmail.com writes:
I have returned to D (as I have some apps that would take a long time to port to
a different lang) 
I like the changes to phobos (and I'll update my DFC/win32 com libs hopefully
over the weekend) for those who are using them.

however, it seems that 0.76 still has a few issues ...

I've given up ranting about semantics over implementation 
instead here's some basics that don't work!

this archive contains the following scripts.

newtest.d : unable to 'new' a 2d array of object
newtest.d(3): Integer constant expression expected instead of w
the following code causes the error .... 
int[][] create_2d( int w, int h ) {
return new int[w][h];
}

platetest.d : template forward reference problems.
instance UserControl(MyApp ) does not match any template declaration
it does only MyApp is a forward ref.

twintest.d : more template importing tests.
instance MyControl(MyApp2 ) cannot resolve forward reference
same again, unfortunatly I can not re produce the actual error I was tracking
which was due to an typo in an included template causing the same error but not
warning that the included template contained an error.
it would be good if errors showed the included files (like gcc does)
i.e. error in foo.d(99) included from bar.d(4) included from main.d(9)


imptest.d : unable to always use fully qualified names.
imptest.d(15): undefined identifier std
I have been unable to actually repro the error but there are issues with using 
fully qualified names without an import
i.e 'std.c.stdio.printf( ..... );' 

noret.d : no return assert is NOT an Exception or Error!!
also the import is 'import std.asserterror;'
but the module is  'module std.assertexception;'
Why is AssertError NOT and Error!, and why is Error and Exception
would it not be better to follow the Java model ?
Throwable;
Error : Throwable;
Exception : Throwable;
and throw can only throw a Throwable (rather than an Object (throwables have
space for stack trace etc)
am I the only one driven to dispare 'cos A AssertError is not and Exception
and B no warning/error is given that a function has a missing return or missing
default in a switch.

inttest.d : more 'C' style cast problems (again due to forward refs etc).
inttest.d(8): can only * a pointer, not a 'int'
MORE problems with 'C' style casts, they can NEVER work in D as unlike C the
nature of statment segment '(id)' can not be determined at parse time (C/C++
knows if 'id' is a typedef of var etc at the time it is parsed).
how many times must ppl request the removal of 'C' casts 

gctest.d : phobos errors (unable to 'import internal.gc.gc;')
Attempting to compile gctest.d
Error: Error reading file 'gcx.d'
it seems that 'internal.*' are not importable.

innertest.d : an attempt to use operator new to create 'Java(tm)' style inner
classes
this was an experiment in attempting to use the 'operator new' to create Java
Style inner classes
Foo f = new( parent ) Foo( params );
however it imposible to effect the classinfo.init of the Foo or set memebers
within the new.
I think if 'new' is called then it should be able to operate in two modes
mode 1 ... it just allocates the memory D runtime does all the setup
mode 2 ... it calls into D (or D gives it the memory) and pre inits values
so D does the following:
if there is a static new with the right params
p = call operator new ( size, new params );
else
p = _d_newclass;

d initialisation of memory for class

if there is a non static new
call p.operator new ( new params )

call construction with construction params;


matchtest.d : static and instance functions with same names (different params)
matchtest.d(16): need 'this' to access member func

I have two functions both with the same name, only different params and one is
static and one is a member function, the above error implies that an explicit
'this' is required, but when it put in the error implies that D is now matching
with the static version!

matchtest2.d : static and instance functions with same names (different params)
this used but the error is about the static form
matchtest2.d(15): Error: expected 4 arguments, not 3
matchtest2.d(15): cannot implicitly convert char[3] to int



begin 0644 0.76.zip
M4$L#!!0````(`.N3A"\D4#K"A $``+ &```.````,"XW-B]B=6EL9"YB872E
ME,%/ S`4QN\D_`]O!Y+M(!J.)DLTHXO&.1*VN,LNI:NCIK0+E$W_>X$-!H)$
MZHGPO7[O_=JOZ0.:/7G S>>FL4)K<%_=Z>Q^NXMVVX")_&L:Q0JL%(T.BHD]
M*`E$1 ?&:0R"GA1-E)TMLS*O!3>DKK%WL)#O>_X"O:&%-9W>P;AH][R&C>>_
M(!>6WF8TF !:K!`4I8L="!8 I(*`EN-*EL<N%CAPK& +IJ'JX%0-! .I$Q,M
MGKJH U/Z!].P3/H)4]-T6"[VP2A"QK0&4OW^RA"G0N0]BI60SZQC%):R"R2A
M3/FNG&4:A=[1VW'.;H+3?:  VP).$AHKH)^$9LA2 &W;,#Z%7\7F9/!!B;JM
MJA/3H"240.-8QL#ID7) 26-(?QY"M?.X:EIYG.V#\]B3%LE5T $YNX=?42&R
M`!HH#4GO3"X-NFFJ\E_2U)F?"ASD;X&$)+NZ3#!UQ#Q-\LWF+UWO>418D;`5
M34/50:H:#`ZH<CK=1,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=>?Y_>X^3_2CJ>%`M^'"3H;C5[?C^_?C.`71N.V
M^CT?C?#J<$K$R6F[ZM6'-C^%-ATEIRT;O-_D/S 4''[.)OCS ?*;I'Y?"*E7
M)O7T3YS,KJ'^)UA>MX9A$09+J:5/E=!KO^D S6:%E5L:,!12-YS1W5U/X(T7
MICF&+S?OR_?8H\F7I<7Q$2P_.^'_/?FL/<9X='AV<8*>6Z3?,D6/$OC\A.&?
MTEMGOS]OV;<^YZB\NU?_C]U\\.V/FBD%]X_OYVG_"AX._ 502P,$%````` `
M0Z^#+]Q)DERC````% $```X````P+C<V+W1W:6YL:6(N9&6.,0O",!"%YP;Z
M'VYL%\'5XB#. HONL1X:N"8AN52D]+^;)FU%7-^[=]_7F7L !'XI3>K6E*(4
M+4GOX>+1':R%H12%T Q][`I^*E_5,$`/>] V,,[E`_DJ*6#J'')P>J['Z2-C
M9TDRPNE]-)J=H0KB;U*M9&4T[%9:G7C9(!ZSHQ1D\,_&2H>1/`%]L.BJ-<E:
MB]<YI7]VTMK-USI/%MU2?`!02P,$%````` `,Z^#+YBJ*RJ"````O0````\`
M```P+C<V+W1W:6YT97-T+F1%C;T*`C$, .<6^ X9V\7!47$09T<?X.P5+/32
MTD0.D7OW2WO^+.'CRQ<RY?&9`O`<D0/QT6BCXU1RY>Y2O&\*B0?T`:ZO2T:N
M.5G!<RE[<'_74Y\&HN_R`#<*51#>1JM?N!/BFL#+D"/%CTC6]48U!R?`,,-6
MT:>VK7(M7XQ>VJL54$L#!`H``````*R4A"\````````````````%````,"XW
M-B]02P$"%``4````"`#KDX0O)%`ZPH8!``"X! ``# `````````!`"``_X$`
M````,"XW-B]B=6EL9"YB87102P$"%``4````"``(;80OCY7VPV<```!\````
M#0`````````!`"``MH&R`0``,"XW-B]G8W1E<W0N9%!+`0(4`!0````(`'*W
M R^6) 3P=````(X````-``````````$`(`"V 40"```P+C<V+VEM<&5R<BYD
M4$L!`A0`%````` `#;>#+Z[RC(1,````5 ````T``````````0` `+:!XP(`
M`#`N-S8O:6UP;&EB+F102P$"%``4````"``)N(,OQEW>5_\```"(`0``# ``
M```````!`"``MH%:`P``,"XW-B]I;7!T97-T+F102P$"%``4````"`"* X0O
MLA-$R(`"``"4!P``$``````````!`"``MH&%!```,"XW-B]I;FYE<G1E<W0N
M9%!+`0(4`!0````(`*T.A"_'D*^I ````+<````.``````````$`(`"V 3,'
M```P+C<V+VEN='1E<W0N9%!+`0(4`!0````(`-:3A"\R'];TBP```/\````0
M``````````$`(`"V =\'```P+C<V+VUA=&-H=&5S="YD4$L!`A0`%````` `
M!)2$+\)<, 6.`````P$``!$``````````0` `+:!F` ``#`N-S8O;6%T8VAT
M97-T,BYD4$L!`A0`%````` `>*&#+UYYL5AP````G ````X``````````0` 
M`+:!50D``#`N-S8O;F5W=&5S="YD4$L!`A0`%````` `L J$+T\IL/.S`0``
ML ,```P``````````0` `+:!\0D``#`N-S8O;F]R970N9%!+`0(4`!0````(
M`#JC R\PP Z:^`````D"```0``````````$`(`"V <X+```P+C<V+W!L871E
M=&5S="YD4$L!`A0`%````` `DI2$+X2('\QI!```5PT```\``````````0` 
M`+:!]`P``#`N-S8O<F5A9&UE+G1X=%!+`0(4`!0````(`$.O R_<29)<HP``
M`!8!```.``````````$`(`"V 8H1```P+C<V+W1W:6YL:6(N9%!+`0(4`!0`
M```(`#.O R^8JBLJ  ```+T````/``````````$`(`"V 5D2```P+C<V+W1W
M:6YT97-T+F102P$"%``*``````"LE(0O````````````````!0``````````
D`!``_T$($P``,"XW-B]02P4&`````!``$`"]`P``*Q,`````
`
end
Dec 04 2003
next sibling parent reply J C Calvarese <jcc7 cox.net> writes:
one_mad_alien hotmail.com wrote:
 I have returned to D (as I have some apps that would take a long time to port
to
 a different lang) 
Welcome back.
 I like the changes to phobos (and I'll update my DFC/win32 com libs hopefully
 over the weekend) for those who are using them.
I've already spent some time working on getting your libs to compile with DMD 0.76. I don't know if it helps you any, but you can find my efforts at: http://jcc_7.tripod.com/d/ I didn't keep track of where I made changes but I've found a free program that helps compare two similar text files called WinMerge: http://winmerge.sourceforge.net/ Scroll down to see my suggestions for how fix some of you problems...
 
 however, it seems that 0.76 still has a few issues ...
 
 I've given up ranting about semantics over implementation 
 instead here's some basics that don't work!
 
 this archive contains the following scripts.
 
 newtest.d : unable to 'new' a 2d array of object
 newtest.d(3): Integer constant expression expected instead of w
 the following code causes the error .... 
 int[][] create_2d( int w, int h ) {
 return new int[w][h];
 }
I think you might want something like this (at least it compiles)... int[][] create_2d( int w, int h ) { int[][] dummy; dummy.length = h; for (int i = 0; i < h; i++) dummy[i].length = w; return dummy; }
 
 platetest.d : template forward reference problems.
 instance UserControl(MyApp ) does not match any template declaration
 it does only MyApp is a forward ref.
 
 twintest.d : more template importing tests.
 instance MyControl(MyApp2 ) cannot resolve forward reference
 same again, unfortunatly I can not re produce the actual error I was tracking
 which was due to an typo in an included template causing the same error but not
 warning that the included template contained an error.
 it would be good if errors showed the included files (like gcc does)
 i.e. error in foo.d(99) included from bar.d(4) included from main.d(9)
 
 
 imptest.d : unable to always use fully qualified names.
 imptest.d(15): undefined identifier std
 I have been unable to actually repro the error but there are issues with using 
 fully qualified names without an import
 i.e 'std.c.stdio.printf( ..... );' 
Add this line before main in imptest (compiles for me now): import std.c.stdio; /* added by JCC */
 
 noret.d : no return assert is NOT an Exception or Error!!
 also the import is 'import std.asserterror;'
 but the module is  'module std.assertexception;'
 Why is AssertError NOT and Error!, and why is Error and Exception
 would it not be better to follow the Java model ?
 Throwable;
 Error : Throwable;
 Exception : Throwable;
 and throw can only throw a Throwable (rather than an Object (throwables have
 space for stack trace etc)
 am I the only one driven to dispare 'cos A AssertError is not and Exception
 and B no warning/error is given that a function has a missing return or missing
 default in a switch.
 
 inttest.d : more 'C' style cast problems (again due to forward refs etc).
 inttest.d(8): can only * a pointer, not a 'int'
 MORE problems with 'C' style casts, they can NEVER work in D as unlike C the
 nature of statment segment '(id)' can not be determined at parse time (C/C++
 knows if 'id' is a typedef of var etc at the time it is parsed).
 how many times must ppl request the removal of 'C' casts 
 
 gctest.d : phobos errors (unable to 'import internal.gc.gc;')
 Attempting to compile gctest.d
 Error: Error reading file 'gcx.d'
 it seems that 'internal.*' are not importable.
Try replacing import internal.gc.gc; with import std.gc; The compiler seems to like the change. Good luck with these problems. Justin
 
 innertest.d : an attempt to use operator new to create 'Java(tm)' style inner
 classes
 this was an experiment in attempting to use the 'operator new' to create Java
 Style inner classes
 Foo f = new( parent ) Foo( params );
 however it imposible to effect the classinfo.init of the Foo or set memebers
 within the new.
 I think if 'new' is called then it should be able to operate in two modes
 mode 1 ... it just allocates the memory D runtime does all the setup
 mode 2 ... it calls into D (or D gives it the memory) and pre inits values
 so D does the following:
 if there is a static new with the right params
 p = call operator new ( size, new params );
 else
 p = _d_newclass;
 
 d initialisation of memory for class
 
 if there is a non static new
 call p.operator new ( new params )
 
 call construction with construction params;
 
 
 matchtest.d : static and instance functions with same names (different params)
 matchtest.d(16): need 'this' to access member func
 
 I have two functions both with the same name, only different params and one is
 static and one is a member function, the above error implies that an explicit
 'this' is required, but when it put in the error implies that D is now matching
 with the static version!
 
 matchtest2.d : static and instance functions with same names (different params)
 this used but the error is about the static form
 matchtest2.d(15): Error: expected 4 arguments, not 3
 matchtest2.d(15): cannot implicitly convert char[3] to int
 
Dec 04 2003
parent one_mad_alien hotmail.com writes:
In article <bqo6dj$1it0$1 digitaldaemon.com>, J C Calvarese says...
one_mad_alien hotmail.com wrote:
 I have returned to D (as I have some apps that would take a long time to port
to
 a different lang) 
Welcome back.
cheers :)
I've already spent some time working on getting your libs to compile 
with DMD 0.76.  I don't know if it helps you any, but you can find my 
efforts at: http://jcc_7.tripod.com/d/
good stuff,
I didn't keep track of where I made changes but I've found a free 
program that helps compare two similar text files called WinMerge:
http://winmerge.sourceforge.net/
I'll check it out, currently I use Araxis Merge (bought it a couple of years ago, as it works well with perforce)
 newtest.d : unable to 'new' a 2d array of object
 newtest.d(3): Integer constant expression expected instead of w
 the following code causes the error .... 
 int[][] create_2d( int w, int h ) {
 return new int[w][h];
 }
I think you might want something like this (at least it compiles)... int[][] create_2d( int w, int h ) { int[][] dummy; dummy.length = h; for (int i = 0; i < h; i++) dummy[i].length = w; return dummy; }
I used a template as a work around ... template Array( T ) { T[][] create_2D( int w, int h ) { T[][] rv = new T[][h];//new T[w][h]; for( int i = 0; i < h; i++ ) { rv[i] = new T[w]; } return rv; } } // to use int[][] twod = instance Array(int).create_2D( a,b );
 imptest.d : unable to always use fully qualified names.
 imptest.d(15): undefined identifier std
 I have been unable to actually repro the error but there are issues with using 
 fully qualified names without an import
 i.e 'std.c.stdio.printf( ..... );' 
Add this line before main in imptest (compiles for me now): import std.c.stdio; /* added by JCC */
this example did not quite report the same error as I was getting from fully qualified names, but either way they should either work or not work (rather than half work).
 gctest.d : phobos errors (unable to 'import internal.gc.gc;')
 Attempting to compile gctest.d
 Error: Error reading file 'gcx.d'
 it seems that 'internal.*' are not importable.
Try replacing import internal.gc.gc; with import std.gc;
std.gc does not import gc.malloc (well, not on my machine!) Mike.
Dec 06 2003
prev sibling next sibling parent "Matthew Wilson" <matthew.hat stlsoft.dot.org> writes:
 noret.d : no return assert is NOT an Exception or Error!!
 also the import is 'import std.asserterror;'
 but the module is  'module std.assertexception;'
 Why is AssertError NOT and Error!, and why is Error and Exception
 would it not be better to follow the Java model ?
 Throwable;
 Error : Throwable;
 Exception : Throwable;
 and throw can only throw a Throwable (rather than an Object (throwables
have
 space for stack trace etc)
 am I the only one driven to dispare 'cos A AssertError is not and
Exception
 and B no warning/error is given that a function has a missing return or
missing
 default in a switch.
You're not. Several people are currently campaigning to incline Walter to remove such shocking warts
Dec 04 2003
prev sibling parent reply "Charles Sanders" <sanders-consulting comcast.net> writes:
Glad your back mike!

I have modified DFC a bit and added some stuff, renamed it Windy, ill put it
up shortly.
Let me know when you get the COM stuff updated id like to take a gander at
it.

C

<one_mad_alien hotmail.com> wrote in message
news:bqo23h$1cp3$1 digitaldaemon.com...
 I have returned to D (as I have some apps that would take a long time to
port to
 a different lang)
 I like the changes to phobos (and I'll update my DFC/win32 com libs
hopefully
 over the weekend) for those who are using them.

 however, it seems that 0.76 still has a few issues ...

 I've given up ranting about semantics over implementation
 instead here's some basics that don't work!

 this archive contains the following scripts.

 newtest.d : unable to 'new' a 2d array of object
 newtest.d(3): Integer constant expression expected instead of w
 the following code causes the error ....
 int[][] create_2d( int w, int h ) {
 return new int[w][h];
 }

 platetest.d : template forward reference problems.
 instance UserControl(MyApp ) does not match any template declaration
 it does only MyApp is a forward ref.

 twintest.d : more template importing tests.
 instance MyControl(MyApp2 ) cannot resolve forward reference
 same again, unfortunatly I can not re produce the actual error I was
tracking
 which was due to an typo in an included template causing the same error
but not
 warning that the included template contained an error.
 it would be good if errors showed the included files (like gcc does)
 i.e. error in foo.d(99) included from bar.d(4) included from main.d(9)


 imptest.d : unable to always use fully qualified names.
 imptest.d(15): undefined identifier std
 I have been unable to actually repro the error but there are issues with
using
 fully qualified names without an import
 i.e 'std.c.stdio.printf( ..... );'

 noret.d : no return assert is NOT an Exception or Error!!
 also the import is 'import std.asserterror;'
 but the module is  'module std.assertexception;'
 Why is AssertError NOT and Error!, and why is Error and Exception
 would it not be better to follow the Java model ?
 Throwable;
 Error : Throwable;
 Exception : Throwable;
 and throw can only throw a Throwable (rather than an Object (throwables
have
 space for stack trace etc)
 am I the only one driven to dispare 'cos A AssertError is not and
Exception
 and B no warning/error is given that a function has a missing return or
missing
 default in a switch.

 inttest.d : more 'C' style cast problems (again due to forward refs etc).
 inttest.d(8): can only * a pointer, not a 'int'
 MORE problems with 'C' style casts, they can NEVER work in D as unlike C
the
 nature of statment segment '(id)' can not be determined at parse time
(C/C++
 knows if 'id' is a typedef of var etc at the time it is parsed).
 how many times must ppl request the removal of 'C' casts

 gctest.d : phobos errors (unable to 'import internal.gc.gc;')
 Attempting to compile gctest.d
 Error: Error reading file 'gcx.d'
 it seems that 'internal.*' are not importable.

 innertest.d : an attempt to use operator new to create 'Java(tm)' style
inner
 classes
 this was an experiment in attempting to use the 'operator new' to create
Java
 Style inner classes
 Foo f = new( parent ) Foo( params );
 however it imposible to effect the classinfo.init of the Foo or set
memebers
 within the new.
 I think if 'new' is called then it should be able to operate in two modes
 mode 1 ... it just allocates the memory D runtime does all the setup
 mode 2 ... it calls into D (or D gives it the memory) and pre inits values
 so D does the following:
 if there is a static new with the right params
 p = call operator new ( size, new params );
 else
 p = _d_newclass;

 d initialisation of memory for class

 if there is a non static new
 call p.operator new ( new params )

 call construction with construction params;


 matchtest.d : static and instance functions with same names (different
params)
 matchtest.d(16): need 'this' to access member func

 I have two functions both with the same name, only different params and
one is
 static and one is a member function, the above error implies that an
explicit
 'this' is required, but when it put in the error implies that D is now
matching
 with the static version!

 matchtest2.d : static and instance functions with same names (different
params)
 this used but the error is about the static form
 matchtest2.d(15): Error: expected 4 arguments, not 3
 matchtest2.d(15): cannot implicitly convert char[3] to int
Dec 05 2003
parent one_mad_alien hotmail.com writes:
In article <bqqqqr$2edb$1 digitaldaemon.com>, Charles Sanders says...
Glad your back mike!
cheers,
I have modified DFC a bit and added some stuff, renamed it Windy, ill put it
up shortly.
Let me know when you get the COM stuff updated id like to take a gander at
it.
hopefully it will be online later (6 hours after this was posted) just got to re-tests the imbedded MSIE code. Mike.
Dec 06 2003