Re: [fpc-pascal] Operator precendence of ^

2020-03-16 Thread Maël Hörz

As I explained there, it *can* be considered an operator, even in the
documentation.
But yes, the discussion continues in the forum.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Operator precendence of ^

2020-03-16 Thread Bart via fpc-pascal
On Mon, Mar 16, 2020 at 8:31 AM Maël Hörz  wrote:

> But I could not find any mention of the derefence operator ^.

As was explained to you in
https://forum.lazarus.freepascal.org/index.php/topic,48911.0.html, the
dereferencing a pointer (by using ^) isn't an operator.



-- 
Bart
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Killing the mail list

2020-03-16 Thread Jonas Maebe
On 16/03/2020 03:16, Ryan Joseph via fpc-pascal wrote:
> Thanks, this looks really helpful. How does this nabble.com site work? It 
> looks like it can intercept the messages from the mail list or something.

Please move this discussion to the fpc-other mailing list.

Thanks,


Jonas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] Operator precendence of ^

2020-03-16 Thread Maël Hörz

Hello,

I read the documentation on operator precedence:
https://www.freepascal.org/docs-html/ref/refch12.html

But I could not find any mention of the derefence operator ^.

How does it fit within the order given in the link above?

I also wonder how operators are determined.

For example
Parent.AnotherParent.Items[2]
would be one operand in an expression such as:

Parent.AnotherParent.Items[2] + 10

But what is the grammar/rules for determining what tokens belong to a
complex operand, such as "Parent.AnotherParent.Items[2]"?

Best regards,
Maël Hörz
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Pass open array to static array?

2020-03-16 Thread Sven Barth via fpc-pascal
Ryan Joseph via fpc-pascal  schrieb am
Mo., 16. März 2020, 07:33:

> Ok, that makes sense now. Dynamic arrays can't be passed to static arrays.
> I
> remember when I tried to make aligned dynamic arrays I got to look around
> in
> the code and it seems plausible you could just make a memcpy call in the
> RTL
> for dynamic arrays being passed to static arrays. Seems deceptively easy.
> :)
>

You forget managed types. You can't do a simple Move for them.


> Shouldn't it be a constant array though? I'm not sure how the compiler
> works
> but from the programers perspective I thought I was getting something
> without runtime allocation because the array contained only constant
> values.
>

It's only a constant array if it's declared in the const section. Inside
normal code it can also contain variables, function calls, just any
expression really.

Though it would be a potential optimization if all entries are constant to
treat it as a constant array. Again that is something that *could* be done,
but is not right now.

Regards,
Sven

>
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal