Re: Re[4]: [fpc-pascal] variant part of a record

2006-09-20 Thread Marco van de Voort
> On 20 sep 2006, at 14:19, ??? wrote: > > Hacking the parser to support this directly is a waste of time imho > (not to mention that it would break the code's compatibility with > every other Pascal compiler out there afaik). Actually,?I wished for this one time or another. Usua

Re[4]: [fpc-pascal] variant part of a record

2006-09-20 Thread Пётр Косаревский
About contributing: is it useful to comment some parts of documentation ("html with comments") with improvements, corrections or compilable examples? For example, would it be meaningful to add an example on the discussed matter with a comment stating, that there are no such checks tonow?

Re: Re[2]: [fpc-pascal] variant part of a record

2006-09-20 Thread Jonas Maebe
On 20 sep 2006, at 16:09, Пётр Косаревский wrote: Well, I think, that the part "It's not because you don't pay me ..., that you do not have influence on the project ..." means, that I don't have direct influence on the project No. It was simply your "but I don't have anything to say anyway

Re[2]: [fpc-pascal] variant part of a record

2006-09-20 Thread Пётр Косаревский
About contributing: is it useful to comment some parts of documentation ("html with comments") with improvements, corrections or compilable examples? > >> It's not because you don't pay me, or because you cannot demand > >> anything from me or anyone else working on FPC, that you do not have

Re: [fpc-pascal] variant part of a record

2006-09-20 Thread Jonas Maebe
On 20 sep 2006, at 15:44, Vincent Snijders wrote: I *think* all he said was: Even if you don't pay me, even if you cannot demand anything from me, you still can have an influence on the project or on what I do. Yes. Jonas ___ fpc-pascal maillis

Re: [fpc-pascal] variant part of a record

2006-09-20 Thread Vincent Snijders
Пётр Косаревский schreef: It's not because you don't pay me, or because you cannot demand anything from me or anyone else working on FPC, that you do not have influence on the project or even on what I do (both positively and negatively). That was a difficult sentence. I think I understood

Re[8]: [fpc-pascal] variant part of a record

2006-09-20 Thread Пётр Косаревский
> It's not because you don't pay me, or because you cannot demand > anything from me or anyone else working on FPC, that you do not have > influence on the project or even on what I do (both positively and > negatively). > Jonas If I get it right, I don't have the influence, mainly because I

Re: Re[6]: [fpc-pascal] variant part of a record

2006-09-20 Thread Jonas Maebe
On 20 sep 2006, at 14:41, Пётр Косаревский wrote: That would be more easily doable than the above, though again it would break compatibility with other Pascal compilers afaik. I thought so. But FPC isn't very compatible as it is: if you don't care for compatibility much, Delphi won't compi

Re[6]: [fpc-pascal] variant part of a record

2006-09-20 Thread Пётр Косаревский
> That would be more easily doable than the above, though again it > would break compatibility with other Pascal compilers afaik. > Jonas I thought so. But FPC isn't very compatible as it is: if you don't care for compatibility much, Delphi won't compile a program. Of course, TP will fail too.

Re: Re[4]: [fpc-pascal] variant part of a record

2006-09-20 Thread Jonas Maebe
On 20 sep 2006, at 14:19, Пётр Косаревский wrote: It's on my todo list to implement such checks (when enabled by a command line switch, of course). It's not that easy as it may look at first sight though. Jonas It's great news! However, in the case of such checks, ability to explicitly place

Re[4]: [fpc-pascal] variant part of a record

2006-09-20 Thread Пётр Косаревский
> It's on my todo list to implement such checks (when enabled by a > command line switch, of course). It's not that easy as it may look at > first sight though. > Jonas It's great news! However, in the case of such checks, ability to explicitly place tag variable in the record structure or t

Re[2]: [fpc-pascal] variant part of a record

2006-09-20 Thread Пётр Косаревский
> Maybe you should take a look at the GNAT source code, Ada Compiler's do > that sort of checks since 1983. ;) > Vinzent. Uh. See also intel 432 processor (1981, smalltalk and ada were main languages for it later, if I get it right)... ___ fpc-pascal ma

Re: [fpc-pascal] variant part of a record

2006-09-20 Thread Jonas Maebe
On 20 sep 2006, at 13:35, Vinzent Hoefler wrote: Maybe you should take a look at the GNAT source code, Ada Compiler's do that sort of checks since 1983. ;) I doubt GNAT's symtable implementation is even remotely similar to FPC's symtable implementation... Jonas

Re: [fpc-pascal] variant part of a record

2006-09-20 Thread Vinzent Hoefler
On Wednesday 20 September 2006 11:25, Jonas Maebe wrote: > On 20 sep 2006, at 13:20, Пётр Косаревский wrote: > > I'm vague: for the first time I hoped that when you access the > > variant part, if the "case" variable was named, program checks it > > run-time. Hoping that it was implemented this way

Re: Re[2]: [fpc-pascal] variant part of a record

2006-09-20 Thread Jonas Maebe
On 20 sep 2006, at 13:20, Пётр Косаревский wrote: I'm vague: for the first time I hoped that when you access the variant part, if the "case" variable was named, program checks it run-time. Hoping that it was implemented this way, I asked about control over the relative place in the memory

Re[2]: [fpc-pascal] variant part of a record

2006-09-20 Thread Пётр Косаревский
> Yes, there is a language feature called object orientation. But still > that means you would have to translate the binary structure into a > class instance somehow. > Vinzent. The object I presented compiles well, but there is almost no gain in OO approach: I still have to nest structures and

Re: [fpc-pascal] variant part of a record

2006-09-20 Thread Vinzent Hoefler
On Wednesday 20 September 2006 08:26, Пётр Косаревский wrote: > I use > > {$A-} > abc= record > something: byte; > case byte of >1: (a,b: byte); >2: (c: word); > end; > {$A+} // or even a: byte; rsrvd1: array[1..3] of byte; b: word; ... > {$IF sizeof(abc)<>1234} >

Re[2]: [fpc-pascal] variant part of a record

2006-09-20 Thread Пётр Косаревский
> Vinzent H?fler> Probably you should used a "packed record", though. And it's > in no > Vinzent H?fler> way portable, of course. > Also correct. > Jonas I use {$A-} abc= record something: byte; case byte of 1: (a,b: byte); 2: (c: word); end; {$A+} // or even a:

Re: [fpc-pascal] variant part of a record

2006-09-20 Thread Jonas Maebe
On 20 sep 2006, at 02:10, Vinzent Höfler wrote: so I have to use record Something: byte; case byte of 1: (x,y: word); 2: (z: longword); end; No, AFAIK you don't have to, it's the same, just a different syntax. Correct. Probably you should used a "packed record", though. An

Re: [fpc-pascal] variant part of a record

2006-09-19 Thread Vinzent Höfler
Пётр Косаревский wrote: Yes, you do. :) Nevertheless some_type = record case Something : byte of 1: (x,y: word); 2: (z: longword); end; Thank you, Jonas and Vincent, but I was vague: what I want is blockread'ing, so I have to use record Something: byte; case byte

Re[2]: [fpc-pascal] variant part of a record

2006-09-19 Thread Пётр Косаревский
> Yes, you do. :) > Nevertheless >some_type = record > case Something : byte of > 1: (x,y: word); > 2: (z: longword); >end; Thank you, Jonas and Vincent, but I was vague: what I want is blockread'ing, so I have to use record Something: byte; case byte of 1: (x

Re: [fpc-pascal] variant part of a record

2006-09-19 Thread Vinzent Hoefler
On Tuesday 19 September 2006 15:21, Пётр Косаревский wrote: > Do I get it right, that a construction like > record > Something: byte; > case Something of > 1: (x,y: word); > 2: (z: longword); > end; > Is impossible in FPC? Yes, you do. :) Nevertheless some_type =

Re: [fpc-pascal] variant part of a record

2006-09-19 Thread Jonas Maebe
On 19 sep 2006, at 17:21, Пётр Косаревский wrote: Do I get it right, that a construction like record Something: byte; case Something of 1: (x,y: word); 2: (z: longword); end; Is impossible in FPC? You have to write record case Something: byte of 1:

[fpc-pascal] variant part of a record

2006-09-19 Thread Пётр Косаревский
Do I get it right, that a construction like record Something: byte; case Something of 1: (x,y: word); 2: (z: longword); end; Is impossible in FPC? ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepa