On 04 Nov 2009, at 02:37, Ivo Steinmann wrote:
The more important question is: should we do it this way or should I
also write a 2nd implementation by modifying the compiler (branched)?
Then we don't need an external tool at all.
I prefer the compiler not to be modified for something like
Alexander Klenin wrote:
Yet another bug:
---
type T = (a1, b1=5);
var
ch: T;
begin
for ch in T do Writeln(ch);
end.
This is caused by the problem in the for-to loop:
for ch := Low(T) to High(T) do
WriteLn(ch)
How should I solve the problem in the for-in loop?
I tried the next way:
Paul Ishenin schrieb:
Alexander Klenin wrote:
Yet another bug:
---
type T = (a1, b1=5);
var
ch: T;
begin
for ch in T do Writeln(ch);
end.
This is caused by the problem in the for-to loop:
for ch := Low(T) to High(T) do
WriteLn(ch)
How should I solve the problem in the
On Wed, Nov 4, 2009 at 22:36, Paul Ishenin webpi...@mail.ru wrote:
Alexander Klenin wrote:
Yet another bug:
---
type T = (a1, b1=5);
var
ch: T;
begin
for ch in T do Writeln(ch);
end.
This is caused by the problem in the for-to loop:
for ch := Low(T) to High(T) do
WriteLn(ch)
Florian Klaempfl wrote:
You can use the rtti generated for those enums.
For me it is still the question if for-to loop should work:
for ch := Low(T) to High(T) do
WriteLn(ch)
Best regards,
Paul Ishenin.
___
fpc-devel maillist -
In our previous episode, Paul Ishenin said:
Yet another bug:
---
{$apptype console}
type T = (a1, b1=5);
var
ch: T;
begin
for ch in T do Writeln(ch);
end.
CodeGear Delphi for Win32 compiler version 20.0
Copyright (c) 1983,2008 CodeGear
testx.dpr(6) Error: E2029 '(' expected
Marco van de Voort schreef:
In our previous episode, Paul Ishenin said:
Yet another bug:
---
{$apptype console}
type T = (a1, b1=5);
var
ch: T;
begin
for ch in T do Writeln(ch);
end.
CodeGear Delphi for Win32 compiler version 20.0
Copyright (c) 1983,2008 CodeGear
testx.dpr(6) Error:
In our previous episode, Micha Nelissen said:
Does it work on not sparse enums?
Those are dense enums? :-)
true enums.
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel
Vincent Snijders wrote:
Since I suspected that D2009 doesn't work on sparse enums, I tried,
and the
above is the result.
Does it work on not sparse enums?
Delphi compiler does not support for-in loop for types (enums, integer,
...). This is fpc extension :)
Best regards,
Paul Ishenin.
In our previous episode, Vincent Snijders said:
yy end.
CodeGear Delphi for Win32 compiler version 20.0
Copyright (c) 1983,2008 CodeGear
testx.dpr(6) Error: E2029 '(' expected but 'DO' found
testx.dpr(7) Error: E2430 for-in statement cannot operate on collection
type 'T'
In our previous episode, Paul Ishenin said:
Since I suspected that D2009 doesn't work on sparse enums, I tried,
and the
above is the result.
Does it work on not sparse enums?
Delphi compiler does not support for-in loop for types (enums, integer,
...). This is fpc extension :)
Do
Marco van de Voort wrote:
Do you have unit tests for multidimensional arrays. I saw quite funky
examples (involving dummy variables) in the D2009 help for that.
No. I know delphi allows to enumerate multidimensional arrays but fpc
traverses only the first dimension.
Best regards,
Paul
In our previous episode, Alexander Klenin said:
? WriteLn(ch);
? inc(ch);
But it fails the same way.
ch := succ(ch);
OTOH, I am not sure -- obviously either Succ or Inc is buggy, but which one?
Maybe runtime instead of compile-time error is actually correct?
Sparse enums are simply
Marco van de Voort wrote:
Sparse enums are simply a kludge. They were needed because they exist in the
Windows API, and afaik for that only. IOW for easy translation of Windows types.
They were added to Delphi in version 6. I though they added them to
support Qt and the CLX, which relied
In our previous episode, Matt Emson said:
Sparse enums are simply a kludge. They were needed because they exist in
the Windows API, and afaik for that only. IOW for easy translation of
Windows types.
They were added to Delphi in version 6. I though they added them to
support Qt and
Jonas Maebe schrieb:
On 04 Nov 2009, at 02:37, Ivo Steinmann wrote:
The more important question is: should we do it this way or should I
also write a 2nd implementation by modifying the compiler (branched)?
Then we don't need an external tool at all.
I prefer the compiler not to be
Paul Ishenin wrote:
Marco van de Voort wrote:
Do you have unit tests for multidimensional arrays. I saw quite funky
examples (involving dummy variables) in the D2009 help for that.
No. I know delphi allows to enumerate multidimensional arrays but fpc
traverses only the first dimension.
To
Ivo Steinmann wrote:
but one thing would be nice to have. A compiler switch and/or built in
function to check wheter a symbol is used or not. With this information
is easy to implement smart loading.
The problem is that when compiling a unit, you never know which symbols will be used in the
Matt Emson memson.li...@googlemail.com:
The problem I always had with Pascal supporting them was that a Pascal
enum was designed to represents the position in a sequence and not
necessarily an underlying integral value - where as a sparse enum is
simply a grouping for a bunch of numerical
19 matches
Mail list logo