[fpc-pascal] Re: Class const of array of record.
Everton Vieira
tonvieira at gmail.com
Tue Feb 28 14:13:37 CET 2012
I see. I only said so because i thought would became more pretty if his
was bolded like de inline next to him.
2012/2/28 Jonas Maebe <jonas.maebe at elis.ugent.be>
>
> On 28 Feb 2012, at 13:25, Everton Vieira wrote:
>
> 2012/2/24 Jonas Maebe <jonas.maebe at elis.ugent.be>
>>
>> On 24 Feb 2012, at 18:07, Everton Vieira wrote:
>>>
>>> static; should be a keyword, doesn't?
>>>>
>>>
>>> No, it's not a keyword.
>>>
>>
>> But is used like one. Why is that so?
>>
>
> It's not used like one. Keyword means "it's a reserved word by the
> language, and you can never use it for anything other than how it's defined
> by the language". Examples of keywords are "begin" and "procedure". Some
> identifiers are only keywords in certain language modes (e.g.
> try/except/on/finally/raise are only keywords in language modes that know
> about exception handling).
>
> There are other identifiers that can have a special meaning in a
> particular context (such as "cdecl" and "static"), but outside that context
> they behave like any other modifier. Or they may simply be types or
> routines that are part of the system unit. The reason is that code written
> for language dialects that do not treat those identifiers as keywords can
> otherwise not be compiled. To illustrate:
>
> {$mode objfpc}
>
> type
> longint = string;
> cdecl = longint;
> protected = longint;
> varargs = char;
> sin = byte;
>
> var
> stdcall: cdecl;
>
> // note that the final "cdecl;" here does have the "original" meaning of
> cdecl
> function static(const inline: protected): varargs; cdecl;
> begin
> static:=stdcall[sin(inline[1])**];
> end;
>
> begin
> end.
>
>
>
> Jonas
>
> ______________________________**_________________
> fpc-pascal maillist - fpc-pascal at lists.freepascal.**org<fpc-pascal at lists.freepascal.org>
> http://lists.freepascal.org/**mailman/listinfo/fpc-pascal<http://lists.freepascal.org/mailman/listinfo/fpc-pascal>
>
--
Everton Vieira.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20120228/251838bd/attachment.html>
More information about the fpc-pascal
mailing list