Re: [fpc-pascal] IE 200307043

2009-05-28 Thread Frank Peelo
Prince Riley wrote: Hello Frank, If my past post was unclear as to whether I think the constant 'nil' is an address, then let me be clear. I quoted the Borland Object Pascal's statement nil 'does not reference anything' I was not equating it to a zero address value. While a pointer with a '

Re: [fpc-pascal] IE 200307043

2009-05-27 Thread Jonas Maebe
On 27 May 2009, at 19:26, Prince Riley wrote: p := p + nil; is INVALID (expression is valid, operands valid but result is invalid) -- execution error, execution addressing exception This will always be invalid regardless of how nil is handled, because you cannot add two pointers togethe

Re: [fpc-pascal] IE 200307043

2009-05-27 Thread Prince Riley
Hello Frank, If my past post was unclear as to whether I think the constant 'nil' is an address, then let me be clear. I quoted the Borland Object Pascal's statement nil 'does not reference anything' I was not equating it to a zero address value. While a pointer with a 'zero' address value shoul

Re: [fpc-pascal] IE 200307043

2009-05-27 Thread Frank Peelo
JoshyFun wrote: Hello Frank, Wednesday, May 27, 2009, 2:49:26 PM, you wrote: FP> But I'm more puzzled by what it would /mean/. In spite of your bracketed FP> comment here, you seem to be thinking that nil is an address: i.e. FP> adding/subtracting/multiplying a literal would mean something. I'm

Re: [fpc-pascal] IE 200307043

2009-05-27 Thread Jürgen Hestermann
From my point of view nil is like the infinite in mathematics, so it is not range bounded and operations like nil+1 are impossible, or in the worst case equal to nil again. Once you assigned nil to a pointer the value becomes in range so it can be operated as usual. Yes, doing arithmetics with N

Re: [fpc-pascal] IE 200307043

2009-05-27 Thread Frank Peelo
Prince Riley wrote: Frank, I think the crux of the matter here is how to make the distinction between a pointer with 'no value' and one that is initialized or set to the 'lowest possible value in the range'. The quote I mentioned comes directly from Borland's Object Pascal Langage Manual

Re: [fpc-pascal] IE 200307043

2009-05-25 Thread Prince Riley
Frank, I think the crux of the matter here is how to make the distinction between a pointer with 'no value' and one that is initialized or set to the 'lowest possible value in the range'. The quote I mentioned comes directly from Borland's Object Pascal Langage Manual You can check on this, but

Re: [fpc-pascal] IE 200307043

2009-05-25 Thread Frank Peelo
Prince Riley wrote: Hello, I had a chance to go to a reference and check on what the reserved word 'nil' , a special constant, seems to mean. According to the Object Pascal manual (Borland) ... "The reserved word nil is a special constant that can be assigned to any pointer. When nil is ass

Re: [fpc-pascal] IE 200307043

2009-05-25 Thread John Coppens
On Mon, 25 May 2009 21:09:44 + Prince Riley wrote: > Type checking for valid > pointer arithmetic and the difference between a 'null' or empty pointer > and one that has the lowest value of it's type. Maybe the use of 'nil' in an expression should not be allowed at all (except comparisons).

Re: [fpc-pascal] IE 200307043

2009-05-25 Thread Prince Riley
Jonas Thank you Jonas, for clearing that up. I agree. You have more courage than I my friend to say that, for down that path lies monsters. For while I must agree with your point, in theory it raises a bigger concern. The 'nil' for a pointer constant is problematic in two ways. Fixing this 'bug

Re: [fpc-pascal] IE 200307043

2009-05-25 Thread Jonas Maebe
On 25 May 2009, at 22:39, Prince Riley wrote: That's a very interesting answer. So am I understanding you to say that the expression of the form var := constant + numeric literal ; is an invalid expression (syntax) in Object Pascal? No, I meant that there was a bug (error) in the compiler

Re: [fpc-pascal] IE 200307043

2009-05-25 Thread Prince Riley
Jonas, Thanks for the reply. That's a very interesting answer. So am I understanding you to say that the expression of the form var := constant + numeric literal ; is an invalid expression (syntax) in Object Pascal? Why would the expression adding a numeric literal and a numeric constant creat

Re: [fpc-pascal] IE 200307043

2009-05-25 Thread Prince Riley
Hello, I had a chance to go to a reference and check on what the reserved word 'nil' , a special constant, seems to mean. According to the Object Pascal manual (Borland) ... "The reserved word nil is a special constant that can be assigned to any pointer. When nil is assigned to a pointer, the po

Re: [fpc-pascal] IE 200307043

2009-05-25 Thread Jonas Maebe
On 25 May 2009, at 19:48, Prince Riley wrote: There seems to be a bigger issue on this... but perhaps someone else confirm that the following programs, similar to the failing one, work. That's because the error was in the constant evaluation (nil and 1 are both constants). Jonas __

Re: [fpc-pascal] IE 200307043

2009-05-25 Thread Prince Riley
Hello, There seems to be a bigger issue on this... but perhaps someone else confirm that the following programs, similar to the failing one, work. program test1; var p: Pointer; begin p := nil; p := p + 1; end. Does work and the following program program test2; var

Re: [fpc-pascal] IE 200307043

2009-05-24 Thread Joost van der Sluis
Op zondag 24-05-2009 om 23:14 uur [tijdzone +0200], schreef Aleksa Todorovic: > Hi, all! > > I've just tried to compile some of my old Pascal code, and got IE > 200307043. I've tried both 2.2.4 and svn trunk versions. Simple > program to generate it: > > program test; > var > p: Pointer; > begi

Re: [fpc-pascal] IE 200307043

2009-05-24 Thread Jonas Maebe
On 24 May 2009, at 23:14, Aleksa Todorovic wrote: I couldn't find issue about this in bug tracker, should I report it? Yes, please. Jonas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-