Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

A nasty looking dwarf throws a knife at you.


devel / comp.lang.c / Re: int(*const parse_packet)(const char *, size_t, char **);

SubjectAuthor
* int(*const parse_packet)(const char *, size_t, char **);hongy...@gmail.com
+* Re: int(*const parse_packet)(const char *, size_t, char **);Bonita Montero
|`* Re: int(*const parse_packet)(const char *, size_t, char **);hongy...@gmail.com
| `- Re: int(*const parse_packet)(const char *, size_t, char **);Keith Thompson
+- Re: int(*const parse_packet)(const char *, size_t, char **);Manfred
+* Re: int(*const parse_packet)(const char *, size_t, char **);John Bode
|+* Re: int(*const parse_packet)(const char *, size_t, char **);Chris M. Thomasson
||`* Re: int(*const parse_packet)(const char *, size_t, char **);Bart
|| `- Re: int(*const parse_packet)(const char *, size_t, char **);Chris M. Thomasson
|+* Re: int(*const parse_packet)(const char *, size_t, char **);hongy...@gmail.com
||`- Re: int(*const parse_packet)(const char *, size_t, char **);Keith Thompson
|`* Re: int(*const parse_packet)(const char *, size_t, char **);Kaz Kylheku
| `- Re: int(*const parse_packet)(const char *, size_t, char **);hongy...@gmail.com
+* Re: int(*const parse_packet)(const char *, size_t, char **);James Kuyper
|`* Re: int(*const parse_packet)(const char *, size_t, char **);Bart
| `* Re: int(*const parse_packet)(const char *, size_t, char **);hongy...@gmail.com
|  +* Re: int(*const parse_packet)(const char *, size_t, char **);Keith Thompson
|  |+- Re: int(*const parse_packet)(const char *, size_t, char **);hongy...@gmail.com
|  |`* Re: int(*const parse_packet)(const char *, size_t, char **);Scott Lurndal
|  | `- Re: int(*const parse_packet)(const char *, size_t, char **);Lew Pitcher
|  `- Re: int(*const parse_packet)(const char *, size_t, char **);Bart
`- Re: int(*const parse_packet)(const char *, size_t, char **);Paul N

1
int(*const parse_packet)(const char *, size_t, char **);

<83c10100-bedf-47eb-b595-7a8db983ac51n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18092&group=comp.lang.c#18092

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:622a:1452:: with SMTP id v18mr2005776qtx.214.1630406119624;
Tue, 31 Aug 2021 03:35:19 -0700 (PDT)
X-Received: by 2002:a0c:e3cb:: with SMTP id e11mr27925754qvl.16.1630406119513;
Tue, 31 Aug 2021 03:35:19 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Tue, 31 Aug 2021 03:35:19 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=128.199.172.34; posting-account=kF0ZaAoAAACPbiK5gldhAyX5qTd3krV2
NNTP-Posting-Host: 128.199.172.34
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <83c10100-bedf-47eb-b595-7a8db983ac51n@googlegroups.com>
Subject: int(*const parse_packet)(const char *, size_t, char **);
From: hongyi.z...@gmail.com (hongy...@gmail.com)
Injection-Date: Tue, 31 Aug 2021 10:35:19 +0000
Content-Type: text/plain; charset="UTF-8"
 by: hongy...@gmail.com - Tue, 31 Aug 2021 10:35 UTC

See the following c code snippet located at here [1]:

typedef struct protocol {
const int default_port;
int(*const parse_packet)(const char *, size_t, char **);
} protocol_t;

In the above definition, it seems to me that the `int ...' line is difficult to understand. Any hints will be highly appreciated.

[1] https://github.com/hongyi-zhao/shadowsocksr-libev/blob/1be671bd5fe7cd55d3823d4669786c9ba7913b9e/src/protocol.h#L29

Regards,
HY

Re: int(*const parse_packet)(const char *, size_t, char **);

<sgl23b$uh0$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18093&group=comp.lang.c#18093

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c
Subject: Re: int(*const parse_packet)(const char *, size_t, char **);
Date: Tue, 31 Aug 2021 12:59:54 +0200
Organization: A noiseless patient Spider
Lines: 18
Message-ID: <sgl23b$uh0$1@dont-email.me>
References: <83c10100-bedf-47eb-b595-7a8db983ac51n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 31 Aug 2021 10:59:55 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="0e9542a84700f159f63fce8b6de20456";
logging-data="31264"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19LmPpZcHa25GZJmMxjoTzByBVq1QYUH8M="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.13.0
Cancel-Lock: sha1:SX8yW38txTgoEtn3rxW08y03SLY=
In-Reply-To: <83c10100-bedf-47eb-b595-7a8db983ac51n@googlegroups.com>
Content-Language: de-DE
 by: Bonita Montero - Tue, 31 Aug 2021 10:59 UTC

Am 31.08.2021 um 12:35 schrieb hongy...@gmail.com:
> See the following c code snippet located at here [1]:
>
> typedef struct protocol {
> const int default_port;
> int(*const parse_packet)(const char *, size_t, char **);
> } protocol_t;
>
> In the above definition, it seems to me that the `int ...' line is difficult to understand. Any hints will be highly appreciated.
>
> [1] https://github.com/hongyi-zhao/shadowsocksr-libev/blob/1be671bd5fe7cd55d3823d4669786c9ba7913b9e/src/protocol.h#L29

That's just a pointer to a function that gets a const char *, a size_t
and a char ** and returns an int; you could assign a function-"name" to
it that returns an int and takes the same parameters in the same order.
For the above definition the parameters don't need to be named since
this isn't a function-definition, but just a variable-definition.

Re: int(*const parse_packet)(const char *, size_t, char **);

<sgl97j$1o4q$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18094&group=comp.lang.c#18094

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!aioe.org!Puiiztk9lHEEQC0y3uUjRA.user.46.165.242.75.POSTED!not-for-mail
From: non...@add.invalid (Manfred)
Newsgroups: comp.lang.c
Subject: Re: int(*const parse_packet)(const char *, size_t, char **);
Date: Tue, 31 Aug 2021 15:01:39 +0200
Organization: Aioe.org NNTP Server
Message-ID: <sgl97j$1o4q$1@gioia.aioe.org>
References: <83c10100-bedf-47eb-b595-7a8db983ac51n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="57498"; posting-host="Puiiztk9lHEEQC0y3uUjRA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.13.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
 by: Manfred - Tue, 31 Aug 2021 13:01 UTC

On 8/31/2021 12:35 PM, hongy...@gmail.com wrote:
> See the following c code snippet located at here [1]:
>
> typedef struct protocol {
> const int default_port;
> int(*const parse_packet)(const char *, size_t, char **);
> } protocol_t;
>
> In the above definition, it seems to me that the `int ...' line is difficult to understand. Any hints will be highly appreciated.
>
> [1] https://github.com/hongyi-zhao/shadowsocksr-libev/blob/1be671bd5fe7cd55d3823d4669786c9ba7913b9e/src/protocol.h#L29
>
> Regards,
> HY
>

That is a pointer-to-function declaration.
Declaring this pointer as member of struct protocol keeps it bound to
the context of this structure.

Pointers to functions as struct members are often used as the C
counterpart of what member functions are in C++, although their
semantics would be somewhat different from this example.

Re: int(*const parse_packet)(const char *, size_t, char **);

<b95e6981-068e-4abc-a446-6b913c522cd3n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18095&group=comp.lang.c#18095

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:620a:a8f:: with SMTP id v15mr2984319qkg.329.1630415276527;
Tue, 31 Aug 2021 06:07:56 -0700 (PDT)
X-Received: by 2002:a0c:aa55:: with SMTP id e21mr28593896qvb.41.1630415276351;
Tue, 31 Aug 2021 06:07:56 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Tue, 31 Aug 2021 06:07:56 -0700 (PDT)
In-Reply-To: <sgl23b$uh0$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=103.138.53.239; posting-account=kF0ZaAoAAACPbiK5gldhAyX5qTd3krV2
NNTP-Posting-Host: 103.138.53.239
References: <83c10100-bedf-47eb-b595-7a8db983ac51n@googlegroups.com> <sgl23b$uh0$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b95e6981-068e-4abc-a446-6b913c522cd3n@googlegroups.com>
Subject: Re: int(*const parse_packet)(const char *, size_t, char **);
From: hongyi.z...@gmail.com (hongy...@gmail.com)
Injection-Date: Tue, 31 Aug 2021 13:07:56 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 20
 by: hongy...@gmail.com - Tue, 31 Aug 2021 13:07 UTC

On Tuesday, August 31, 2021 at 7:00:07 PM UTC+8, Bonita Montero wrote:
> Am 31.08.2021 um 12:35 schrieb hongy...@gmail.com:
> > See the following c code snippet located at here [1]:
> >
> > typedef struct protocol {
> > const int default_port;
> > int(*const parse_packet)(const char *, size_t, char **);
> > } protocol_t;
> >
> > In the above definition, it seems to me that the `int ...' line is difficult to understand. Any hints will be highly appreciated.
> >
> > [1] https://github.com/hongyi-zhao/shadowsocksr-libev/blob/1be671bd5fe7cd55d3823d4669786c9ba7913b9e/src/protocol.h#L29
> That's just a pointer to a function that gets a const char *, a size_t
> and a char ** and returns an int; you could assign a function-"name" to
> it that returns an int and takes the same parameters in the same order.
> For the above definition the parameters don't need to be named since
> this isn't a function-definition, but just a variable-definition.

Do you mean this is something similar to lambda discussed here [1]?

[1] https://stackoverflow.com/questions/41700729/how-can-this-c-code-have-lambda

Re: int(*const parse_packet)(const char *, size_t, char **);

<878s0hirpk.fsf@nosuchdomain.example.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18097&group=comp.lang.c#18097

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.lang.c
Subject: Re: int(*const parse_packet)(const char *, size_t, char **);
Date: Tue, 31 Aug 2021 08:01:11 -0700
Organization: None to speak of
Lines: 31
Message-ID: <878s0hirpk.fsf@nosuchdomain.example.com>
References: <83c10100-bedf-47eb-b595-7a8db983ac51n@googlegroups.com>
<sgl23b$uh0$1@dont-email.me>
<b95e6981-068e-4abc-a446-6b913c522cd3n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="92d4ef50dec0029532564256321dcd53";
logging-data="6103"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19yIsXUXKLwigRMcDOJtMT9"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:Ke21k/DrBX+w+lYdJsZ0fSOjuSo=
sha1:qmJ4X8wWoBO6nFi54xTzhO1Q/SM=
 by: Keith Thompson - Tue, 31 Aug 2021 15:01 UTC

"hongy...@gmail.com" <hongyi.zhao@gmail.com> writes:
> On Tuesday, August 31, 2021 at 7:00:07 PM UTC+8, Bonita Montero wrote:
>> Am 31.08.2021 um 12:35 schrieb hongy...@gmail.com:
>> > See the following c code snippet located at here [1]:
>> >
>> > typedef struct protocol {
>> > const int default_port;
>> > int(*const parse_packet)(const char *, size_t, char **);
>> > } protocol_t;
>> >
>> > In the above definition, it seems to me that the `int ...' line is difficult to understand. Any hints will be highly appreciated.
>> >
>> > [1] https://github.com/hongyi-zhao/shadowsocksr-libev/blob/1be671bd5fe7cd55d3823d4669786c9ba7913b9e/src/protocol.h#L29
>> That's just a pointer to a function that gets a const char *, a size_t
>> and a char ** and returns an int; you could assign a function-"name" to
>> it that returns an int and takes the same parameters in the same order.
>> For the above definition the parameters don't need to be named since
>> this isn't a function-definition, but just a variable-definition.
>
> Do you mean this is something similar to lambda discussed here [1]?
>
> [1] https://stackoverflow.com/questions/41700729/how-can-this-c-code-have-lambda

It has some similarities to lambdas, but C doesn't have lambdas. It's
best just to think of it as a function pointer (and learn what C
function pointers are if you don't already know).

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for Philips
void Void(void) { Void(); } /* The recursive call of the void */

Re: int(*const parse_packet)(const char *, size_t, char **);

<sgm5pd$u9g$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18100&group=comp.lang.c#18100

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: jfbode1...@gmail.com (John Bode)
Newsgroups: comp.lang.c
Subject: Re: int(*const parse_packet)(const char *, size_t, char **);
Date: Tue, 31 Aug 2021 16:08:59 -0500
Organization: A noiseless patient Spider
Lines: 62
Message-ID: <sgm5pd$u9g$1@dont-email.me>
References: <83c10100-bedf-47eb-b595-7a8db983ac51n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 31 Aug 2021 21:09:02 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="0155159c996c8136a239488069bde40b";
logging-data="31024"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18y9jAVkiHcvoINJn8sb8cQ"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0)
Gecko/20100101 Thunderbird/78.13.0
Cancel-Lock: sha1:+WpMvIir1EMME+uvlQaHutIE60E=
In-Reply-To: <83c10100-bedf-47eb-b595-7a8db983ac51n@googlegroups.com>
Content-Language: en-US
 by: John Bode - Tue, 31 Aug 2021 21:08 UTC

On 8/31/21 5:35 AM, hongy...@gmail.com wrote:
> See the following c code snippet located at here [1]:
>
> typedef struct protocol {
> const int default_port;
> int(*const parse_packet)(const char *, size_t, char **);
> } protocol_t;
>
> In the above definition, it seems to me that the `int ...' line is difficult to understand. Any hints will be highly appreciated.
>
> [1] https://github.com/hongyi-zhao/shadowsocksr-libev/blob/1be671bd5fe7cd55d3823d4669786c9ba7913b9e/src/protocol.h#L29
>
> Regards,
> HY
>

When reading complex declarations, start by finding the leftmost
identifier and work your way out, remembering the following rules:

T *ap[N]; // ap is an array of pointer to T
T (*pa)[N]; // pa is a pointer to an array of T
T *fp(); // fp is a function returning pointer to T
T (*pf)(); // pf is a pointer to a function returning T

T const *p; // p is a pointer to const T
const T *p; // same as above

T * const p; // p is a const pointer to T

Apply these rules recursively to any function parameters. Given that,
this declaration breaks down as

parse_packet -- parse_packet
(*const parse_packet) -- is a const pointer to

(*const parse_packet)( ) -- function taking
(*const parse_packet)( ) -- unnamed parameter
(*const parse_packet)( * ) -- is a pointer to
(*const parse_packet)(const char * ) -- const char
(*const parse_packet)(const char *,
) -- unnamed parameter
(*const parse_packet)(const char *,
size_t ) -- is a size_t
(*const parse_packet)(const char *,
size_t,
) -- unnamed parameter
(*const parse_packet)(const char *,
size_t,
* ) -- is a pointer to
(*const parse_packet)(const char *,
size_t,
** ) -- a pointer to
(*const parse_packet)(const char *,
size_t,
char ** ) -- char
int (*const parse_packet)(const char *,
size_t,
char ** ) -- returning int

In plain English, parse_packet is a const pointer to a function taking
three arguments of type const char *, size_t, and char **, and returning
an int.

Re: int(*const parse_packet)(const char *, size_t, char **);

<sgm74u$eq6$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18101&group=comp.lang.c#18101

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!aioe.org!ux6ld97kLXxG8kVFFLnoWg.user.46.165.242.75.POSTED!not-for-mail
From: chris.m....@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c
Subject: Re: int(*const parse_packet)(const char *, size_t, char **);
Date: Tue, 31 Aug 2021 14:32:12 -0700
Organization: Aioe.org NNTP Server
Message-ID: <sgm74u$eq6$1@gioia.aioe.org>
References: <83c10100-bedf-47eb-b595-7a8db983ac51n@googlegroups.com>
<sgm5pd$u9g$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="15174"; posting-host="ux6ld97kLXxG8kVFFLnoWg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.13.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
 by: Chris M. Thomasson - Tue, 31 Aug 2021 21:32 UTC

On 8/31/2021 2:08 PM, John Bode wrote:
> On 8/31/21 5:35 AM, hongy...@gmail.com wrote:
>> See the following c code snippet located at here [1]:
>>
>> typedef struct protocol {
>> const int default_port;
>> int(*const parse_packet)(const char *, size_t, char **);
>> } protocol_t;
>>
>> In the above definition, it seems to me that the `int ...' line is
>> difficult to understand. Any hints will be highly appreciated.
>>
>> [1]
>> https://github.com/hongyi-zhao/shadowsocksr-libev/blob/1be671bd5fe7cd55d3823d4669786c9ba7913b9e/src/protocol.h#L29
>>
>>
>> Regards,
>> HY
>>
>
> When reading complex declarations, start by finding the leftmost
> identifier and work your way out, remembering the following rules:
[...]

I must be misunderstanding you, however, I like to go from right to left:

struct foo const* const p = &foo;

p would be a constant pointer, to a constant foo structure.

Re: int(*const parse_packet)(const char *, size_t, char **);

<sgm7im$9lb$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18102&group=comp.lang.c#18102

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: bc...@freeuk.com (Bart)
Newsgroups: comp.lang.c
Subject: Re: int(*const parse_packet)(const char *, size_t, char **);
Date: Tue, 31 Aug 2021 22:39:28 +0100
Organization: A noiseless patient Spider
Lines: 51
Message-ID: <sgm7im$9lb$1@dont-email.me>
References: <83c10100-bedf-47eb-b595-7a8db983ac51n@googlegroups.com>
<sgm5pd$u9g$1@dont-email.me> <sgm74u$eq6$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 31 Aug 2021 21:39:34 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="2a04540787db5caf20407f46a9f58e6f";
logging-data="9899"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/JsT9p0Py9q77v9QL8A/qndt/BhseKp/g="
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:aHkiTyGgBoXkCWVY1dKfHVDDUR8=
In-Reply-To: <sgm74u$eq6$1@gioia.aioe.org>
X-Antivirus-Status: Clean
Content-Language: en-GB
X-Antivirus: AVG (VPS 210831-8, 31/8/2021), Outbound message
 by: Bart - Tue, 31 Aug 2021 21:39 UTC

On 31/08/2021 22:32, Chris M. Thomasson wrote:
> On 8/31/2021 2:08 PM, John Bode wrote:
>> On 8/31/21 5:35 AM, hongy...@gmail.com wrote:
>>> See the following c code snippet located at here [1]:
>>>
>>> typedef struct protocol {
>>> const int default_port;
>>> int(*const parse_packet)(const char *, size_t, char **);
>>> } protocol_t;
>>>
>>> In the above definition, it seems to me that the `int ...' line is
>>> difficult to understand. Any hints will be highly appreciated.
>>>
>>> [1]
>>> https://github.com/hongyi-zhao/shadowsocksr-libev/blob/1be671bd5fe7cd55d3823d4669786c9ba7913b9e/src/protocol.h#L29
>>>
>>>
>>> Regards,
>>> HY
>>>
>>
>> When reading complex declarations, start by finding the leftmost
>> identifier and work your way out, remembering the following rules:
> [...]
>
> I must be misunderstanding you, however, I like to go from right to left:
>
> struct foo const* const p = &foo;
>
> p would be a constant pointer, to a constant foo structure.
>

That doesn't work. Compare:

const struct foo *p[];
const struct foo (*p)[];

They can't both be array of pointer, and the 'const' shouldn't be at the
end.

What about:

int A[10][20];

Is is array 20 of array 10, or the other way around?

>> When reading complex declarations, start by finding the leftmost
>> identifier

This doesn't work either when there is no identifier (cast or unnamed
parameter).

Re: int(*const parse_packet)(const char *, size_t, char **);

<7fc85399-c075-478a-b970-de43eb2ce8aan@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18103&group=comp.lang.c#18103

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a0c:bf4d:: with SMTP id b13mr32376029qvj.33.1630459302502;
Tue, 31 Aug 2021 18:21:42 -0700 (PDT)
X-Received: by 2002:a0c:e3cb:: with SMTP id e11mr31838337qvl.16.1630459302370;
Tue, 31 Aug 2021 18:21:42 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Tue, 31 Aug 2021 18:21:42 -0700 (PDT)
In-Reply-To: <sgm5pd$u9g$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=128.199.66.218; posting-account=kF0ZaAoAAACPbiK5gldhAyX5qTd3krV2
NNTP-Posting-Host: 128.199.66.218
References: <83c10100-bedf-47eb-b595-7a8db983ac51n@googlegroups.com> <sgm5pd$u9g$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <7fc85399-c075-478a-b970-de43eb2ce8aan@googlegroups.com>
Subject: Re: int(*const parse_packet)(const char *, size_t, char **);
From: hongyi.z...@gmail.com (hongy...@gmail.com)
Injection-Date: Wed, 01 Sep 2021 01:21:42 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 79
 by: hongy...@gmail.com - Wed, 1 Sep 2021 01:21 UTC

On Wednesday, September 1, 2021 at 5:09:13 AM UTC+8, jfbod...@gmail.com wrote:
> On 8/31/21 5:35 AM, hongy...@gmail.com wrote:
> > See the following c code snippet located at here [1]:
> >
> > typedef struct protocol {
> > const int default_port;
> > int(*const parse_packet)(const char *, size_t, char **);
> > } protocol_t;
> >
> > In the above definition, it seems to me that the `int ...' line is difficult to understand. Any hints will be highly appreciated.
> >
> > [1] https://github.com/hongyi-zhao/shadowsocksr-libev/blob/1be671bd5fe7cd55d3823d4669786c9ba7913b9e/src/protocol.h#L29
> >
> > Regards,
> > HY
> >
> When reading complex declarations, start by finding the leftmost
> identifier and work your way out, remembering the following rules:
>
> T *ap[N]; // ap is an array of pointer to T
> T (*pa)[N]; // pa is a pointer to an array of T
> T *fp(); // fp is a function returning pointer to T
> T (*pf)(); // pf is a pointer to a function returning T
>
> T const *p; // p is a pointer to const T
> const T *p; // same as above
>
> T * const p; // p is a const pointer to T

But cdecl [1-2] doesn't work with these rules, e.g.:

$ cdecl
Type `help' or `?' for help
cdecl> explain T *ap[N];
syntax error
cdecl>
But it works for the example discussed here:

cdecl> explain int(*const parse_packet)(const char *, size_t, char **);
declare parse_packet as const pointer to function (pointer to const char, size_t, pointer to pointer to char) returning int

[1] https://github.com/ridiculousfish/cdecl-blocks
[2] https://github.com/paul-j-lucas/cdecl

HY

> Apply these rules recursively to any function parameters. Given that,
> this declaration breaks down as
>
> parse_packet -- parse_packet
> (*const parse_packet) -- is a const pointer to
>
> (*const parse_packet)( ) -- function taking
> (*const parse_packet)( ) -- unnamed parameter
> (*const parse_packet)( * ) -- is a pointer to
> (*const parse_packet)(const char * ) -- const char
> (*const parse_packet)(const char *,
> ) -- unnamed parameter
> (*const parse_packet)(const char *,
> size_t ) -- is a size_t
> (*const parse_packet)(const char *,
> size_t,
> ) -- unnamed parameter
> (*const parse_packet)(const char *,
> size_t,
> * ) -- is a pointer to
> (*const parse_packet)(const char *,
> size_t,
> ** ) -- a pointer to
> (*const parse_packet)(const char *,
> size_t,
> char ** ) -- char
> int (*const parse_packet)(const char *,
> size_t,
> char ** ) -- returning int
>
> In plain English, parse_packet is a const pointer to a function taking
> three arguments of type const char *, size_t, and char **, and returning
> an int.

Re: int(*const parse_packet)(const char *, size_t, char **);

<87wno1gg4l.fsf@nosuchdomain.example.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18104&group=comp.lang.c#18104

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.lang.c
Subject: Re: int(*const parse_packet)(const char *, size_t, char **);
Date: Tue, 31 Aug 2021 19:54:18 -0700
Organization: None to speak of
Lines: 39
Message-ID: <87wno1gg4l.fsf@nosuchdomain.example.com>
References: <83c10100-bedf-47eb-b595-7a8db983ac51n@googlegroups.com>
<sgm5pd$u9g$1@dont-email.me>
<7fc85399-c075-478a-b970-de43eb2ce8aan@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="0fcd40d019e906d2a510dd7f75cb5cc9";
logging-data="10569"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Ku5/8+wRX+KmQ0bTrmOPU"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:8e87q6emilOErn1UKhylDO/ZqTE=
sha1:UnkX15NSB/7K9Nj3dTVbKZNtmXI=
 by: Keith Thompson - Wed, 1 Sep 2021 02:54 UTC

"hongy...@gmail.com" <hongyi.zhao@gmail.com> writes:
[...]
> But cdecl [1-2] doesn't work with these rules, e.g.:
>
> $ cdecl
> Type `help' or `?' for help
> cdecl> explain T *ap[N];
> syntax error
> cdecl>
[...]

cdecl's parser is relatively simple, certainly in comparison to the
parser in a C compiler. In your example, it doesn't know what "T" or
"N" is, and isn't smart enough to assume that T is a type name and N is
a numeric constant.

It also treats certain English words (like "declare", "explain",
"pointer", "ptr", "array", "of", and "to") as keywords. If I recall
correctly it uses a single grammar for its C-to-English and English-to-C
translations.

If you have a declaration with a named type, replace it with "int" or
"char" before feeding it to cdecl. If you have a named constant like N,
replace it with an actual constant.

cdecl is quirky but useful.

$ cdecl
Type `help' or `?' for help
cdecl> explain T *ap[N]
syntax error
cdecl> explain int *ap[42]
declare ap as array 42 of pointer to int
cdecl>

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for Philips
void Void(void) { Void(); } /* The recursive call of the void */

Re: int(*const parse_packet)(const char *, size_t, char **);

<20210831215224.823@kylheku.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18107&group=comp.lang.c#18107

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!rocksolid2!news.neodome.net!weretis.net!feeder8.news.weretis.net!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: 563-365-...@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.c
Subject: Re: int(*const parse_packet)(const char *, size_t, char **);
Date: Wed, 1 Sep 2021 05:07:03 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 84
Message-ID: <20210831215224.823@kylheku.com>
References: <83c10100-bedf-47eb-b595-7a8db983ac51n@googlegroups.com>
<sgm5pd$u9g$1@dont-email.me>
Injection-Date: Wed, 1 Sep 2021 05:07:03 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="f29f3f63b26b56e61a5449415ace592e";
logging-data="8897"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18FxBQCvqjsG68ZRWL0tjNPri9cX9nb+Cg="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:3moYAnFWeDj4eczFUmC6ZlqzS/s=
 by: Kaz Kylheku - Wed, 1 Sep 2021 05:07 UTC

On 2021-08-31, John Bode <jfbode1029@gmail.com> wrote:
> On 8/31/21 5:35 AM, hongy...@gmail.com wrote:
>> See the following c code snippet located at here [1]:
>>
>> typedef struct protocol {
>> const int default_port;
>> int(*const parse_packet)(const char *, size_t, char **);
>> } protocol_t;
>>
>> In the above definition, it seems to me that the `int ...' line is difficult to understand. Any hints will be highly appreciated.
>>
>> [1] https://github.com/hongyi-zhao/shadowsocksr-libev/blob/1be671bd5fe7cd55d3823d4669786c9ba7913b9e/src/protocol.h#L29
>>
>> Regards,
>> HY
>>
>
> When reading complex declarations, start by finding the leftmost
> identifier and work your way out, remembering the following rules:

When reading complex declarators, first consider any precedence
parentheses. Read these inside out.

Within every parenthesized grouping, consider what are the postfix type
constructors on the right, and the unary type constructors on the left.
The postfix constructors all have a higher precedence. All operators
proceed away from the thing being declared: postfix are
left-associative, unary are right-associative.

If there are no such parentheses, there is only one grouping.

E.g.

(* ( **a[3][4] ) (int) )
^ ^ ^ ^
| ` inner par `
` '
` outer par ---------'

We start within the inner parens. The postix type constructor operators
are [3][4] and they apply in that order:

a is an array of 3 elements, which are arrays of 4

Having dealt with postfix, we look at the lower-precedence unaries,
which indicate what a is an array of. There are two stars, so pointer to
pointer:

a is an array of 3 elements, which are arrays of 4
... pointers to pointer

OK, we are done at this parenthesis level; we take the elevator
out one floor. The only postfix operator there is the function parameter
list declarator syntax (int):

a is an array of 3 elements, which are arrays of 4
... pointers to pointer
... to a function that takes an int parameter, returning ...

Then we look at the unary: what the function returns:

a is an array of 3 elements, which are arrays of 4
... pointers to pointer
... to a function that takes an int parameter, returning
... a pointer

We are now done with the declarator. We must look at the declaration
specifiers. For instance, if those are "struct foo".

a is an array of 4 arrays of 3
... pointers to pointer
... to a function that takes an int parameter, returning
... a pointer
... to struct foo

The parentheses in a declarator prevent all of its postfix operators
from applying before all of its unaries; they are necessary precisely
when the type we are constructing is a sequence of constructions that
requires a mixing of unary and postfix type construction operators.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal

Re: int(*const parse_packet)(const char *, size_t, char **);

<ed5882da-54e2-4aec-967d-67c89fe9d3c1n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18108&group=comp.lang.c#18108

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a0c:c285:: with SMTP id b5mr15667461qvi.33.1630477186707;
Tue, 31 Aug 2021 23:19:46 -0700 (PDT)
X-Received: by 2002:a05:620a:15b9:: with SMTP id f25mr6745979qkk.400.1630477186503;
Tue, 31 Aug 2021 23:19:46 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Tue, 31 Aug 2021 23:19:46 -0700 (PDT)
In-Reply-To: <20210831215224.823@kylheku.com>
Injection-Info: google-groups.googlegroups.com; posting-host=60.249.28.127; posting-account=kF0ZaAoAAACPbiK5gldhAyX5qTd3krV2
NNTP-Posting-Host: 60.249.28.127
References: <83c10100-bedf-47eb-b595-7a8db983ac51n@googlegroups.com>
<sgm5pd$u9g$1@dont-email.me> <20210831215224.823@kylheku.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ed5882da-54e2-4aec-967d-67c89fe9d3c1n@googlegroups.com>
Subject: Re: int(*const parse_packet)(const char *, size_t, char **);
From: hongyi.z...@gmail.com (hongy...@gmail.com)
Injection-Date: Wed, 01 Sep 2021 06:19:46 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 90
 by: hongy...@gmail.com - Wed, 1 Sep 2021 06:19 UTC

On Wednesday, September 1, 2021 at 1:07:14 PM UTC+8, Kaz Kylheku wrote:
> On 2021-08-31, John Bode <jfbod...@gmail.com> wrote:
> > On 8/31/21 5:35 AM, hongy...@gmail.com wrote:
> >> See the following c code snippet located at here [1]:
> >>
> >> typedef struct protocol {
> >> const int default_port;
> >> int(*const parse_packet)(const char *, size_t, char **);
> >> } protocol_t;
> >>
> >> In the above definition, it seems to me that the `int ...' line is difficult to understand. Any hints will be highly appreciated.
> >>
> >> [1] https://github.com/hongyi-zhao/shadowsocksr-libev/blob/1be671bd5fe7cd55d3823d4669786c9ba7913b9e/src/protocol.h#L29
> >>
> >> Regards,
> >> HY
> >>
> >
> > When reading complex declarations, start by finding the leftmost
> > identifier and work your way out, remembering the following rules:
> When reading complex declarators, first consider any precedence
> parentheses. Read these inside out.
>
> Within every parenthesized grouping, consider what are the postfix type
> constructors on the right, and the unary type constructors on the left.
> The postfix constructors all have a higher precedence. All operators
> proceed away from the thing being declared: postfix are
> left-associative, unary are right-associative.
>
> If there are no such parentheses, there is only one grouping.
>
> E.g.
>
> (* ( **a[3][4] ) (int) )
> ^ ^ ^ ^
> | ` inner par `
> ` '
> ` outer par ---------'
>
>
> We start within the inner parens. The postix type constructor operators
> are [3][4] and they apply in that order:
>
> a is an array of 3 elements, which are arrays of 4
>
> Having dealt with postfix, we look at the lower-precedence unaries,
> which indicate what a is an array of. There are two stars, so pointer to
> pointer:
>
> a is an array of 3 elements, which are arrays of 4
> ... pointers to pointer
>
> OK, we are done at this parenthesis level; we take the elevator
> out one floor. The only postfix operator there is the function parameter
> list declarator syntax (int):
>
> a is an array of 3 elements, which are arrays of 4
> ... pointers to pointer
> ... to a function that takes an int parameter, returning ...
>
> Then we look at the unary: what the function returns:
>
> a is an array of 3 elements, which are arrays of 4
> ... pointers to pointer
> ... to a function that takes an int parameter, returning
> ... a pointer
>
> We are now done with the declarator. We must look at the declaration
> specifiers. For instance, if those are "struct foo".
>
> a is an array of 4 arrays of 3
> ... pointers to pointer
> ... to a function that takes an int parameter, returning
> ... a pointer
> ... to struct foo

See the explanation given by cdecl:

cdecl> explain struct foo (* ( **a[3][4] ) (int) )
declare a as array 3 of array 4 of pointer to pointer to function (int) returning pointer to struct foo

HY
> The parentheses in a declarator prevent all of its postfix operators
> from applying before all of its unaries; they are necessary precisely
> when the type we are constructing is a sequence of constructions that
> requires a mixing of unary and postfix type construction operators.
>
> --
> TXR Programming Language: http://nongnu.org/txr
> Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal

Re: int(*const parse_packet)(const char *, size_t, char **);

<sgo32h$eal$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18114&group=comp.lang.c#18114

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: jameskuy...@alumni.caltech.edu (James Kuyper)
Newsgroups: comp.lang.c
Subject: Re: int(*const parse_packet)(const char *, size_t, char **);
Date: Wed, 1 Sep 2021 10:34:57 -0400
Organization: A noiseless patient Spider
Lines: 44
Message-ID: <sgo32h$eal$2@dont-email.me>
References: <83c10100-bedf-47eb-b595-7a8db983ac51n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 1 Sep 2021 14:34:57 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="5d09d483edb296dddf90ac330c7be7ea";
logging-data="14677"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19c2TLiWbNUeaEnGGByZWanb/mzeMD5/4M="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.13.0
Cancel-Lock: sha1:On5Qgy6nxusFvT9+n+LPPvEQEm0=
In-Reply-To: <83c10100-bedf-47eb-b595-7a8db983ac51n@googlegroups.com>
Content-Language: en-US
 by: James Kuyper - Wed, 1 Sep 2021 14:34 UTC

On 8/31/21 6:35 AM, hongy...@gmail.com wrote:
> See the following c code snippet located at here [1]:
>
> typedef struct protocol {
> const int default_port;
> int(*const parse_packet)(const char *, size_t, char **);
> } protocol_t;
>
> In the above definition, it seems to me that the `int ...' line is difficult to understand. Any hints will be highly appreciated.

The key concept in C declarations is that declaration of a variable
mirrors the usages of that variable. This declaration contains one of
the key exceptions to that rule: "const char *, size_t, char **"
indicates that there's a function taking three arguments, which must be
implicitly convertible to the types specified in that list.

The first "const" is another violation of that principle: it indicates
that parse_packet is const-qualified.

When you ignore those two parts, that's where "declarations mirror
usage" finally comes in: "int (*parse_packet)()" indicates that
(*parse_packet)() is a valid expression with a type of int. If you're
familiar enough with C, that should tell you that *parse_packet must
identify a function, and that parse_packet itself must therefore be a
pointer to a function.

Combining that all together: parse_packet is a pointer to a function
that takes three arguments of types const char*, size_t, and char**
respectively, and returns a value of type int.

This leads to a tricky point. In C, an expression that designates a
function, such as *parse_packet, gets implicitly converted into a
pointer to a function. It used to be the case that function calls
required a function designator as their left operand, but when they
added the implicit conversion to a function pointer, they also changed
the semantics of function calls. The left operand of a function call is
now required to be a pointer to a function, rather than a function
designator, so it all works out. But that also means that the function
can be called directly: due to that implicit conversion,
(*parse_packet)(a, b, c) now has exactly the same meaning as
parse_packet(a, b, c), which is simpler. This change was made for the
sake of convenience, but it can also result in confusion: it means that
parse_packet, *parse_packet, **parse_packet and
***************parse_packet all have the same exact meaning.

Re: int(*const parse_packet)(const char *, size_t, char **);

<sgo5sp$63c$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18115&group=comp.lang.c#18115

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: bc...@freeuk.com (Bart)
Newsgroups: comp.lang.c
Subject: Re: int(*const parse_packet)(const char *, size_t, char **);
Date: Wed, 1 Sep 2021 16:22:57 +0100
Organization: A noiseless patient Spider
Lines: 76
Message-ID: <sgo5sp$63c$1@dont-email.me>
References: <83c10100-bedf-47eb-b595-7a8db983ac51n@googlegroups.com>
<sgo32h$eal$2@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 1 Sep 2021 15:23:05 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="74c7c3dbb28afe2b958a79352cf5b19e";
logging-data="6252"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18VmZY5Q5Vs87ygH8S1KjkSz4FDMo2VdJ8="
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:zb/QgmmIaePikSVxDWwo9v6hICY=
In-Reply-To: <sgo32h$eal$2@dont-email.me>
X-Antivirus-Status: Clean
Content-Language: en-GB
X-Antivirus: AVG (VPS 210901-0, 1/9/2021), Outbound message
 by: Bart - Wed, 1 Sep 2021 15:22 UTC

On 01/09/2021 15:34, James Kuyper wrote:
> On 8/31/21 6:35 AM, hongy...@gmail.com wrote:
>> See the following c code snippet located at here [1]:
>>
>> typedef struct protocol {
>> const int default_port;
>> int(*const parse_packet)(const char *, size_t, char **);
>> } protocol_t;
>>
>> In the above definition, it seems to me that the `int ...' line is difficult to understand. Any hints will be highly appreciated.
>
> The key concept in C declarations is that declaration of a variable
> mirrors the usages of that variable. This declaration contains one of
> the key exceptions to that rule: "const char *, size_t, char **"
> indicates that there's a function taking three arguments, which must be
> implicitly convertible to the types specified in that list.
>
> The first "const" is another violation of that principle: it indicates
> that parse_packet is const-qualified.
>
> When you ignore those two parts, that's where "declarations mirror
> usage" finally comes in: "int (*parse_packet)()" indicates that
> (*parse_packet)() is a valid expression with a type of int. If you're
> familiar enough with C, that should tell you that *parse_packet must
> identify a function, and that parse_packet itself must therefore be a
> pointer to a function.
>
> Combining that all together: parse_packet is a pointer to a function
> that takes three arguments of types const char*, size_t, and char**
> respectively, and returns a value of type int.
>
> This leads to a tricky point. In C, an expression that designates a
> function, such as *parse_packet, gets implicitly converted into a
> pointer to a function. It used to be the case that function calls
> required a function designator as their left operand, but when they
> added the implicit conversion to a function pointer, they also changed
> the semantics of function calls. The left operand of a function call is
> now required to be a pointer to a function, rather than a function
> designator, so it all works out. But that also means that the function
> can be called directly: due to that implicit conversion,
> (*parse_packet)(a, b, c) now has exactly the same meaning as
> parse_packet(a, b, c), which is simpler. This change was made for the
> sake of convenience, but it can also result in confusion: it means that
> parse_packet, *parse_packet, **parse_packet and
> ***************parse_packet all have the same exact meaning.
>

I made changes to my own systems language yesterday to relax the need
for explicit derefs for things like function pointers.

I was worried that, as well as resulting in some loss of transparency in
code (F in F() could be a function, or a pointer to a function), it
would inherit C's problems where you can add arbitrary number of derefs
and it would still work.

But apparently not. The example here would be declared as:

ref function(ref char, int, ref ref char)=>int parse_packet

and can be called as either of:

parse_packet(x,y,z)
parse_packet^(x,y,z) # ^ is post-fix deref op

but not as:

parse_packet^^(x,y,z) # or ^^^ etc

It uses a different approach: if the F in F() (or A[i] or P.m) is not
the right type, but is a pointer type, it will try dereferencing until
it is. Then it will insert those deref ops into the AST, so that the
first call above is, internally, always:

parse_packet^(x,y,z)

So fewer derefs are OK (it will match my dynamic code), but not more.

Re: int(*const parse_packet)(const char *, size_t, char **);

<d39cec68-de75-413d-a60d-c53459230437n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18116&group=comp.lang.c#18116

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:620a:135c:: with SMTP id c28mr234902qkl.18.1630510358245;
Wed, 01 Sep 2021 08:32:38 -0700 (PDT)
X-Received: by 2002:ac8:7594:: with SMTP id s20mr8785739qtq.381.1630510358127;
Wed, 01 Sep 2021 08:32:38 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Wed, 1 Sep 2021 08:32:37 -0700 (PDT)
In-Reply-To: <83c10100-bedf-47eb-b595-7a8db983ac51n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2.97.129.12; posting-account=0B-afgoAAABP6274zLUJKa8ZpdIdhsYx
NNTP-Posting-Host: 2.97.129.12
References: <83c10100-bedf-47eb-b595-7a8db983ac51n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d39cec68-de75-413d-a60d-c53459230437n@googlegroups.com>
Subject: Re: int(*const parse_packet)(const char *, size_t, char **);
From: gw7...@aol.com (Paul N)
Injection-Date: Wed, 01 Sep 2021 15:32:38 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 24
 by: Paul N - Wed, 1 Sep 2021 15:32 UTC

On Tuesday, August 31, 2021 at 11:35:26 AM UTC+1, hongy...@gmail.com wrote:
> See the following c code snippet located at here [1]:
>
> typedef struct protocol {
> const int default_port;
> int(*const parse_packet)(const char *, size_t, char **);
> } protocol_t;
>
> In the above definition, it seems to me that the `int ...' line is difficult to understand. Any hints will be highly appreciated.

You can use a typedef to make things clearer, for instance one of my programs has the line:

typedef void(*FN)(void);

so you can then just do

FN f;

to define a variable of type pointer-to-function. (In my case, a function which takes void and returns void.) This could be useful if you are using a lot of function pointers. However, I note that in your example the code is already in a typedef, so it may be easier just to accept that this is the messy bit which makes the rest of the code clearer!

Re: int(*const parse_packet)(const char *, size_t, char **);

<sgos0f$1jmo$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18137&group=comp.lang.c#18137

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!aioe.org!ux6ld97kLXxG8kVFFLnoWg.user.46.165.242.75.POSTED!not-for-mail
From: chris.m....@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c
Subject: Re: int(*const parse_packet)(const char *, size_t, char **);
Date: Wed, 1 Sep 2021 14:40:29 -0700
Organization: Aioe.org NNTP Server
Message-ID: <sgos0f$1jmo$1@gioia.aioe.org>
References: <83c10100-bedf-47eb-b595-7a8db983ac51n@googlegroups.com>
<sgm5pd$u9g$1@dont-email.me> <sgm74u$eq6$1@gioia.aioe.org>
<sgm7im$9lb$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="52952"; posting-host="ux6ld97kLXxG8kVFFLnoWg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.13.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
 by: Chris M. Thomasson - Wed, 1 Sep 2021 21:40 UTC

On 8/31/2021 2:39 PM, Bart wrote:
> On 31/08/2021 22:32, Chris M. Thomasson wrote:
>> On 8/31/2021 2:08 PM, John Bode wrote:
>>> On 8/31/21 5:35 AM, hongy...@gmail.com wrote:
>>>> See the following c code snippet located at here [1]:
>>>>
>>>> typedef struct protocol {
>>>> const int default_port;
>>>> int(*const parse_packet)(const char *, size_t, char **);
>>>> } protocol_t;
>>>>
>>>> In the above definition, it seems to me that the `int ...' line is
>>>> difficult to understand. Any hints will be highly appreciated.
>>>>
>>>> [1]
>>>> https://github.com/hongyi-zhao/shadowsocksr-libev/blob/1be671bd5fe7cd55d3823d4669786c9ba7913b9e/src/protocol.h#L29
>>>>
>>>>
>>>> Regards,
>>>> HY
>>>>
>>>
>>> When reading complex declarations, start by finding the leftmost
>>> identifier and work your way out, remembering the following rules:
>> [...]
>>
>> I must be misunderstanding you, however, I like to go from right to left:
>>
>> struct foo const* const p = &foo;
>>
>> p would be a constant pointer, to a constant foo structure.
>>
>
> That doesn't work. Compare:
>
>   const struct foo *p[];

Its just a habit of mine. Basically, its similar to:

https://cseweb.ucsd.edu//~ricko/rt_lt.rule.html

>   const struct foo (*p)[];
>
> They can't both be array of pointer, and the 'const' shouldn't be at the
> end.
>
> What about:
>
>   int A[10][20];
>
> Is is array 20 of array 10, or the other way around?
>
> >> When reading complex declarations, start by finding the leftmost
> >> identifier
>
> This doesn't work either when there is no identifier (cast or unnamed
> parameter).

Re: int(*const parse_packet)(const char *, size_t, char **);

<18381f9e-e544-40cc-b87b-7349a8fdc925n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18147&group=comp.lang.c#18147

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:620a:2298:: with SMTP id o24mr1124027qkh.235.1630551755591;
Wed, 01 Sep 2021 20:02:35 -0700 (PDT)
X-Received: by 2002:ac8:7c98:: with SMTP id y24mr1030806qtv.30.1630551755432;
Wed, 01 Sep 2021 20:02:35 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Wed, 1 Sep 2021 20:02:35 -0700 (PDT)
In-Reply-To: <sgo5sp$63c$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=128.199.172.34; posting-account=kF0ZaAoAAACPbiK5gldhAyX5qTd3krV2
NNTP-Posting-Host: 128.199.172.34
References: <83c10100-bedf-47eb-b595-7a8db983ac51n@googlegroups.com>
<sgo32h$eal$2@dont-email.me> <sgo5sp$63c$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <18381f9e-e544-40cc-b87b-7349a8fdc925n@googlegroups.com>
Subject: Re: int(*const parse_packet)(const char *, size_t, char **);
From: hongyi.z...@gmail.com (hongy...@gmail.com)
Injection-Date: Thu, 02 Sep 2021 03:02:35 +0000
Content-Type: text/plain; charset="UTF-8"
 by: hongy...@gmail.com - Thu, 2 Sep 2021 03:02 UTC

On Wednesday, September 1, 2021 at 11:23:19 PM UTC+8, Bart wrote:
> On 01/09/2021 15:34, James Kuyper wrote:
> [...]
> I made changes to my own systems language yesterday to relax the need
> for explicit derefs for things like function pointers.
>
> I was worried that, as well as resulting in some loss of transparency in
> code (F in F() could be a function, or a pointer to a function), it
> would inherit C's problems where you can add arbitrary number of derefs
> and it would still work.
>
> But apparently not. The example here would be declared as:
>
> ref function(ref char, int, ref ref char)=>int parse_packet
>
> and can be called as either of:
>
> parse_packet(x,y,z)
> parse_packet^(x,y,z) # ^ is post-fix deref op
>
> but not as:
>
> parse_packet^^(x,y,z) # or ^^^ etc
>
> It uses a different approach: if the F in F() (or A[i] or P.m) is not
> the right type, but is a pointer type, it will try dereferencing until
> it is. Then it will insert those deref ops into the AST, so that the
> first call above is, internally, always:

What's the meaning of AST?
> parse_packet^(x,y,z)
>
> So fewer derefs are OK (it will match my dynamic code), but not more.

Re: int(*const parse_packet)(const char *, size_t, char **);

<87eea7hbhz.fsf@nosuchdomain.example.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18150&group=comp.lang.c#18150

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.lang.c
Subject: Re: int(*const parse_packet)(const char *, size_t, char **);
Date: Wed, 01 Sep 2021 21:01:12 -0700
Organization: None to speak of
Lines: 42
Message-ID: <87eea7hbhz.fsf@nosuchdomain.example.com>
References: <83c10100-bedf-47eb-b595-7a8db983ac51n@googlegroups.com>
<sgo32h$eal$2@dont-email.me> <sgo5sp$63c$1@dont-email.me>
<18381f9e-e544-40cc-b87b-7349a8fdc925n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="4cfacb04df28b927d7c937dd51e9642b";
logging-data="18727"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Y+1gUeUkMSR40u59zmI0+"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:cGgVQ4ltFCQxg6LIv7fkUiu1peo=
sha1:c5vUyUd01xZR7JsoYgp3GAbvS1Q=
 by: Keith Thompson - Thu, 2 Sep 2021 04:01 UTC

"hongy...@gmail.com" <hongyi.zhao@gmail.com> writes:
> On Wednesday, September 1, 2021 at 11:23:19 PM UTC+8, Bart wrote:
>> On 01/09/2021 15:34, James Kuyper wrote:
>> [...]
>> I made changes to my own systems language yesterday to relax the need
>> for explicit derefs for things like function pointers.
>>
>> I was worried that, as well as resulting in some loss of transparency in
>> code (F in F() could be a function, or a pointer to a function), it
>> would inherit C's problems where you can add arbitrary number of derefs
>> and it would still work.
>>
>> But apparently not. The example here would be declared as:
>>
>> ref function(ref char, int, ref ref char)=>int parse_packet
>>
>> and can be called as either of:
>>
>> parse_packet(x,y,z)
>> parse_packet^(x,y,z) # ^ is post-fix deref op
>>
>> but not as:
>>
>> parse_packet^^(x,y,z) # or ^^^ etc
>>
>> It uses a different approach: if the F in F() (or A[i] or P.m) is not
>> the right type, but is a pointer type, it will try dereferencing until
>> it is. Then it will insert those deref ops into the AST, so that the
>> first call above is, internally, always:
>
> What's the meaning of AST?

https://www.google.com/search?q=parse+AST

>> parse_packet^(x,y,z)
>>
>> So fewer derefs are OK (it will match my dynamic code), but not more.

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for Philips
void Void(void) { Void(); } /* The recursive call of the void */

Re: int(*const parse_packet)(const char *, size_t, char **);

<3e5d6a8b-3b40-4106-ac96-bbbd2fe62357n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18154&group=comp.lang.c#18154

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:ac8:5845:: with SMTP id h5mr1491206qth.91.1630563526072; Wed, 01 Sep 2021 23:18:46 -0700 (PDT)
X-Received: by 2002:a37:e14:: with SMTP id 20mr1691604qko.229.1630563525923; Wed, 01 Sep 2021 23:18:45 -0700 (PDT)
Path: i2pn2.org!i2pn.org!news.uzoreto.com!tr3.eu1.usenetexpress.com!feeder.usenetexpress.com!tr3.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Wed, 1 Sep 2021 23:18:45 -0700 (PDT)
In-Reply-To: <87eea7hbhz.fsf@nosuchdomain.example.com>
Injection-Info: google-groups.googlegroups.com; posting-host=103.138.53.161; posting-account=kF0ZaAoAAACPbiK5gldhAyX5qTd3krV2
NNTP-Posting-Host: 103.138.53.161
References: <83c10100-bedf-47eb-b595-7a8db983ac51n@googlegroups.com> <sgo32h$eal$2@dont-email.me> <sgo5sp$63c$1@dont-email.me> <18381f9e-e544-40cc-b87b-7349a8fdc925n@googlegroups.com> <87eea7hbhz.fsf@nosuchdomain.example.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <3e5d6a8b-3b40-4106-ac96-bbbd2fe62357n@googlegroups.com>
Subject: Re: int(*const parse_packet)(const char *, size_t, char **);
From: hongyi.z...@gmail.com (hongy...@gmail.com)
Injection-Date: Thu, 02 Sep 2021 06:18:46 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 9
 by: hongy...@gmail.com - Thu, 2 Sep 2021 06:18 UTC

On Thursday, September 2, 2021 at 12:01:24 PM UTC+8, Keith Thompson wrote:
> [...]
> > What's the meaning of AST?
> https://www.google.com/search?q=parse+AST

It led me here:

https://en.wikipedia.org/wiki/Abstract_syntax_tree

HY

Re: int(*const parse_packet)(const char *, size_t, char **);

<sgq65q$2nc$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18155&group=comp.lang.c#18155

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: bc...@freeuk.com (Bart)
Newsgroups: comp.lang.c
Subject: Re: int(*const parse_packet)(const char *, size_t, char **);
Date: Thu, 2 Sep 2021 10:40:01 +0100
Organization: A noiseless patient Spider
Lines: 75
Message-ID: <sgq65q$2nc$1@dont-email.me>
References: <83c10100-bedf-47eb-b595-7a8db983ac51n@googlegroups.com>
<sgo32h$eal$2@dont-email.me> <sgo5sp$63c$1@dont-email.me>
<18381f9e-e544-40cc-b87b-7349a8fdc925n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 2 Sep 2021 09:40:11 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="00253cb320d6901ba1085aa6b98166ee";
logging-data="2796"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18nHvearyCGq+G1EVmf2YY3cloj8TC8YAE="
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:9f7JfAx19GJ/smN52oKgLB+CrFQ=
In-Reply-To: <18381f9e-e544-40cc-b87b-7349a8fdc925n@googlegroups.com>
X-Antivirus-Status: Clean
Content-Language: en-GB
X-Antivirus: AVG (VPS 210902-0, 2/9/2021), Outbound message
 by: Bart - Thu, 2 Sep 2021 09:40 UTC

On 02/09/2021 04:02, hongy...@gmail.com wrote:
> On Wednesday, September 1, 2021 at 11:23:19 PM UTC+8, Bart wrote:
>> On 01/09/2021 15:34, James Kuyper wrote:
>> [...]
>> I made changes to my own systems language yesterday to relax the need
>> for explicit derefs for things like function pointers.
>>
>> I was worried that, as well as resulting in some loss of transparency in
>> code (F in F() could be a function, or a pointer to a function), it
>> would inherit C's problems where you can add arbitrary number of derefs
>> and it would still work.
>>
>> But apparently not. The example here would be declared as:
>>
>> ref function(ref char, int, ref ref char)=>int parse_packet
>>
>> and can be called as either of:
>>
>> parse_packet(x,y,z)
>> parse_packet^(x,y,z) # ^ is post-fix deref op
>>
>> but not as:
>>
>> parse_packet^^(x,y,z) # or ^^^ etc
>>
>> It uses a different approach: if the F in F() (or A[i] or P.m) is not
>> the right type, but is a pointer type, it will try dereferencing until
>> it is. Then it will insert those deref ops into the AST, so that the
>> first call above is, internally, always:
>
> What's the meaning of AST?

It's the internal representation of program code. In the case of source
code like this:

F(x)

The AST (syntax tree), if printed out, might be displayed like this:

Call
Name F
Name x

The next stage is to generate some intermediate code, eg.

Push x
Call F

and, eventually, some native code, which can be displayed as this x64
assembly for Windows:

mov D10, [x]
call F

(It varies tremendously across compilers, and the native code depends on
the processor and target OS; this what mine.)

Anyway it is in that AST stage that a lot of stuff can be done, such as
name resolution, or type-checking. There if it finds that F is not the
name of a function, but is a function pointer, then it might kindly
change the AST for that bit into:

Call
Deref
Name F
Name x

which is what would have been generated if the source (in C syntax) was
this:

(*F)(x)

Alternately it could report a type error, and then you have to fix your
code.

Re: int(*const parse_packet)(const char *, size_t, char **);

<rI5YI.3385$d82.2643@fx21.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18165&group=comp.lang.c#18165

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!news-out.netnews.com!news.alt.net!fdc2.netnews.com!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx21.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: sco...@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: int(*const parse_packet)(const char *, size_t, char **);
Newsgroups: comp.lang.c
References: <83c10100-bedf-47eb-b595-7a8db983ac51n@googlegroups.com> <sgo32h$eal$2@dont-email.me> <sgo5sp$63c$1@dont-email.me> <18381f9e-e544-40cc-b87b-7349a8fdc925n@googlegroups.com> <87eea7hbhz.fsf@nosuchdomain.example.com>
Lines: 9
Message-ID: <rI5YI.3385$d82.2643@fx21.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Thu, 02 Sep 2021 15:02:47 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Thu, 02 Sep 2021 15:02:47 GMT
X-Received-Bytes: 1115
 by: Scott Lurndal - Thu, 2 Sep 2021 15:02 UTC

Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
>"hongy...@gmail.com" <hongyi.zhao@gmail.com> writes:

>> What's the meaning of AST?
>
>https://www.google.com/search?q=parse+AST
>

As an old VAX programmer, AST was 'Asynchronous System Trap' :-).

Re: int(*const parse_packet)(const char *, size_t, char **);

<sgqqas$gun$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18166&group=comp.lang.c#18166

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: lew.pitc...@digitalfreehold.ca (Lew Pitcher)
Newsgroups: comp.lang.c
Subject: Re: int(*const parse_packet)(const char *, size_t, char **);
Date: Thu, 2 Sep 2021 15:24:12 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 19
Message-ID: <sgqqas$gun$1@dont-email.me>
References: <83c10100-bedf-47eb-b595-7a8db983ac51n@googlegroups.com>
<sgo32h$eal$2@dont-email.me> <sgo5sp$63c$1@dont-email.me>
<18381f9e-e544-40cc-b87b-7349a8fdc925n@googlegroups.com>
<87eea7hbhz.fsf@nosuchdomain.example.com> <rI5YI.3385$d82.2643@fx21.iad>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 2 Sep 2021 15:24:12 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="061b1cc80db1139fc34fdd18667909d6";
logging-data="17367"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18DayOhMY4/y4Be+EOvOHYKjobrbNcznf0="
User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508
git://git.gnome.org/pan2)
Cancel-Lock: sha1:Se4SiMfOlnMFfwy4Cfi+BrwLbPk=
 by: Lew Pitcher - Thu, 2 Sep 2021 15:24 UTC

On Thu, 02 Sep 2021 15:02:47 +0000, Scott Lurndal wrote:

> Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
>>"hongy...@gmail.com" <hongyi.zhao@gmail.com> writes:
>
>>> What's the meaning of AST?
>>
>>https://www.google.com/search?q=parse+AST
>>
>
> As an old VAX programmer, AST was 'Asynchronous System Trap' :-).

My IBM mainframe education says "APAR Status Tracking".
My Minix education says "Andrew S. Tanenbaum"
;-)

--
Lew Pitcher
"In Skills, We Trust"

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor