[fpc-devel] Syntax choice (was: Blocks support)
Jonas Maebe
jonas.maebe at elis.ugent.be
Mon Jul 21 00:28:18 CEST 2014
On 20/07/14 22:27, Dmitry Boyarintsev wrote:
> I was curious about the proposed syntax option, why "in block" rather
> than just "block"? There's no "block" reserved word in FPC yet (unlike
> mentioned earlier Oxygen).
I proposed to use "is block" because of the analogy with the already
existing "is nested". Neither "block" nor "nested" was/is/would be a
reserved word afterwards, just like many other words that have a special
meaning in one context or another (look at compiler/tokens.pas; most
tokens are not reserved words".
> In general "reference to" seems like a poor choice made by Embarcadero
> (and FPC has to follow).
We don't have to (except in Delphi mode), but it's fine by me.
> * using "in block" seems more reasonable and more consistent with pascal
> "postfix" or "suffix" functions declarations in general.
> * name "reference to" somewhat overlaps with "^" syntax. Which is also
> named "reference to".
It's also a similar concept (you have a pointer to something that
describes a function), but it's incompatible and different so you need a
different syntax. Any different syntax is fine, as far as I'm concerned.
> Is it planned to use explicit term "C-block" (or "Apple-block") for the
> feature. To avoid conflicts with pascal declaration blocks
> http://www.freepascal.org/docs-html/ref/refse98.html
"C-block" is fine by me.
Jonas
More information about the fpc-devel
mailing list