Jan-Jaap van der Heijden wrote:
Guess what: the program compiled and ran fine with gpc, but couldn't possibly compile with BP. :-)
:-) :-) Pathetic 64K limits :-) :-)
Not because of these, but because BP doesn't handle stacke frames with procedural parameters (variables).
If it were only the 64kB limit, that's an old story, I wouldn't even have mentioned it here...
Another little bug I just found:
program x; var x:real value 0; {"initial value is of wrong type} begin end.
It's not a bug, I believe.
From ISO 10206:1990, sec 6.1.7:
unsigned-rel = digit-sequence `.' fractional-part [ `e' scale factor ] | digits-sequence `e' scale factor
I thought EP would allow arbitrary expressions as variable initializers (even things like sin(x+3), AFAIR). So an implicit integer->real conversion should be possible, too, I'd think. Even if the standard doesn't demand it, I think it's a good idea to have it in gpc.
BTW: Isn't there are general rule like (sorry, I don't know the actual identifiers):
real_value = integer_value | ...
(IMHO, there should be. After all, as we mathematicians say, $\Z \subseteq \Q$ :-)
I see a simular definition in my Turbo pascal Programmer's Guide, so BP should not accept it either.
I'll look it up, but BP allows some kinds of expressions (e.g. (a+b)/2 if a and b are constants, not with variables, no sin, ...), so it seems logical to allow simple integers, too.
Try to make it "0.0" or "0e0"
That's one of the (many) things I don't like about C...