My primary programming language, j, was recently open-sourced. In order to improve it, I'm studying the source, which is written in C.
But it's been a long (!) time since I've read or written C, and I wasn't even good at it then. And the way this particular codebase is written is ... idiosyncratic (many APL interpreters, J among them, have their source written in high-level "APL style", even when written in a low-level language; very terse, redundancy eschewed, heavy macro use, etc.)
At the moment, I'm trying to understand the fundamental data structures it employs. The most fundamental one is the typedef A
("A" is for "array"):
typedef struct {I k,flag,m,t,c,n,r,s[1];}* A;
which I understand fine. But I'm struggling to wrap my head around what AF
is, two lines later:
typedef A (*AF)();
What does this syntax mean? In particular, what does it mean when things are later declared as "type AF"? Is an AF
simply a pointer to an A
?
My immediate goal is to interpret memory dumps which include things of type V
(for "verb"), whose first two members are AF
s:
typedef struct {AF f1,f2;A f,g,h;I flag,mr,lr,rr,fdep;C id;} V;
but my overall goal is larger than that, so please elaborate on the syntax employed in the definition of AF.