Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #162570
| From | Keith Thompson <Keith.S.Thompson+u@gmail.com> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: int(*const parse_packet)(const char *, size_t, char **); |
| Date | 2021-09-01 21:01 -0700 |
| Organization | None to speak of |
| Message-ID | <87eea7hbhz.fsf@nosuchdomain.example.com> (permalink) |
| 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> |
"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 */
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
int(*const parse_packet)(const char *, size_t, char **); "hongy...@gmail.com" <hongyi.zhao@gmail.com> - 2021-08-31 03:35 -0700
Re: int(*const parse_packet)(const char *, size_t, char **); Bonita Montero <Bonita.Montero@gmail.com> - 2021-08-31 12:59 +0200
Re: int(*const parse_packet)(const char *, size_t, char **); "hongy...@gmail.com" <hongyi.zhao@gmail.com> - 2021-08-31 06:07 -0700
Re: int(*const parse_packet)(const char *, size_t, char **); Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2021-08-31 08:01 -0700
Re: int(*const parse_packet)(const char *, size_t, char **); Manfred <noname@add.invalid> - 2021-08-31 15:01 +0200
Re: int(*const parse_packet)(const char *, size_t, char **); John Bode <jfbode1029@gmail.com> - 2021-08-31 16:08 -0500
Re: int(*const parse_packet)(const char *, size_t, char **); "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2021-08-31 14:32 -0700
Re: int(*const parse_packet)(const char *, size_t, char **); Bart <bc@freeuk.com> - 2021-08-31 22:39 +0100
Re: int(*const parse_packet)(const char *, size_t, char **); "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2021-09-01 14:40 -0700
Re: int(*const parse_packet)(const char *, size_t, char **); "hongy...@gmail.com" <hongyi.zhao@gmail.com> - 2021-08-31 18:21 -0700
Re: int(*const parse_packet)(const char *, size_t, char **); Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2021-08-31 19:54 -0700
Re: int(*const parse_packet)(const char *, size_t, char **); Kaz Kylheku <563-365-8930@kylheku.com> - 2021-09-01 05:07 +0000
Re: int(*const parse_packet)(const char *, size_t, char **); "hongy...@gmail.com" <hongyi.zhao@gmail.com> - 2021-08-31 23:19 -0700
Re: int(*const parse_packet)(const char *, size_t, char **); James Kuyper <jameskuyper@alumni.caltech.edu> - 2021-09-01 10:34 -0400
Re: int(*const parse_packet)(const char *, size_t, char **); Bart <bc@freeuk.com> - 2021-09-01 16:22 +0100
Re: int(*const parse_packet)(const char *, size_t, char **); "hongy...@gmail.com" <hongyi.zhao@gmail.com> - 2021-09-01 20:02 -0700
Re: int(*const parse_packet)(const char *, size_t, char **); Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2021-09-01 21:01 -0700
Re: int(*const parse_packet)(const char *, size_t, char **); "hongy...@gmail.com" <hongyi.zhao@gmail.com> - 2021-09-01 23:18 -0700
Re: int(*const parse_packet)(const char *, size_t, char **); scott@slp53.sl.home (Scott Lurndal) - 2021-09-02 15:02 +0000
Re: int(*const parse_packet)(const char *, size_t, char **); Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2021-09-02 15:24 +0000
Re: int(*const parse_packet)(const char *, size_t, char **); Bart <bc@freeuk.com> - 2021-09-02 10:40 +0100
Re: int(*const parse_packet)(const char *, size_t, char **); Paul N <gw7rib@aol.com> - 2021-09-01 08:32 -0700
csiph-web