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 '
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
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
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
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
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 just
FP> pointing
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
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
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
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).
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
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
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
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
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
__
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
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
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-
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;
begin
p := nil + 1;
end.
I couldn't find issue about this in bug tracker, should I report it?
Bes
19 matches
Mail list logo