Re: [fpc-pascal] For .. in .. loops with sets and valued enums

2015-06-20 Thread Bernd Oppolzer
Maybe types should be forbidden at this place completely. Look at this: 1.) with subrg type - works ok !! program testin; type subrg = 1..10; var i: integer; begin for i in subrg do begin writeln (i) end end. 2.) with subrg type in in-expression - gives syntax error program tes

Re: [fpc-pascal] For .. in .. loops with sets and valued enums

2015-06-20 Thread Michael Van Canneyt
On Sat, 20 Jun 2015, Jonas Maebe wrote: On 20/06/15 12:01, Michael Van Canneyt wrote: On Sat, 20 Jun 2015, Jonas Maebe wrote: On 20/06/15 11:41, Michael Van Canneyt wrote: But it is a bug that the compiler does not give an error for the set type. Please report it. Should it work with a

Re: [fpc-pascal] For .. in .. loops with sets and valued enums

2015-06-20 Thread Adriaan van Os
Jonas Maebe wrote: Again: set *variables* or set *types*? Indeed. Think of var i: integer; for i in integer do which would be amusing. Regards, Adriaan van Os ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http:

Re: [fpc-pascal] For .. in .. loops with sets and valued enums

2015-06-20 Thread Jonas Maebe
On 20/06/15 12:01, Michael Van Canneyt wrote: > > > On Sat, 20 Jun 2015, Jonas Maebe wrote: > >> On 20/06/15 11:41, Michael Van Canneyt wrote: >>> But it is a bug that the compiler does not give an error for the set >>> type. Please report it. >> >> Should it work with any set types at all? (I d

Re: [fpc-pascal] For .. in .. loops with sets and valued enums

2015-06-20 Thread Michael Van Canneyt
On Sat, 20 Jun 2015, Jonas Maebe wrote: On 20/06/15 11:41, Michael Van Canneyt wrote: But it is a bug that the compiler does not give an error for the set type. Please report it. Should it work with any set types at all? (I don't mean set variables, but set types) Or even with any type? It

Re: [fpc-pascal] For .. in .. loops with sets and valued enums

2015-06-20 Thread Jonas Maebe
On 20/06/15 11:41, Michael Van Canneyt wrote: > But it is a bug that the compiler does not give an error for the set > type. Please report it. Should it work with any set types at all? (I don't mean set variables, but set types) Or even with any type? It seems very much like something that was acc

Re: [fpc-pascal] For .. in .. loops with sets and valued enums

2015-06-20 Thread Michael Van Canneyt
On Fri, 19 Jun 2015, Torsten Bonde Christiansen wrote: Consider the following program: program Project1; type   TMyEnum = (     a = 1,     b = 3,     c = 5   );   TMySet = set of TMyEnum; var   Item: TMyEnum; begin   for Item in TMySet do     Writeln('Value = ', Integer(Item)); end.    

Re: [fpc-pascal] For .. in .. loops with sets and valued enums

2015-06-19 Thread Peter
On 19/06/15 08:46, Torsten Bonde Christiansen wrote: > program Project1; > > type > TMyEnum = ( > a = 1, > b = 3, > c = 5 > ); > TMySet = set of TMyEnum; > var > Item: TMyEnum; > > begin > for Item in TMySet do > Writeln('Value = ', Integer(Item)); > end. My guess is that

[fpc-pascal] For .. in .. loops with sets and valued enums

2015-06-19 Thread Torsten Bonde Christiansen
Consider the following program: program Project1; type TMyEnum = ( a = 1, b = 3, c = 5 ); TMySet = set of TMyEnum; var Item: TMyEnum; begin for Item in TMySet do Writeln('Value = ', Integer(Item)); end. I would expect the output of the program to contain the values 1