OK, took me a few re-reads to see the sought path there.
I'd expect some fairly complex forms of "features" could be designed, and putting that heavy work on the compiler to syntax check is unfair. Imagine someone implementing something similar to the OPEN command which could include optional sub-keywords like ACCESS, LOCK, HANDLE, CHAR, BASE, SHARED, READ, WRITE, (and READ WRITE!), BINARY, RANDOM, APPEND, INPUT, OUTPUT, etc. Too much for the compiler to deal with syntactically.
Although, I guess you could so something like this...
.
Although, in the end, the compiler does not actually compile 3rd-Party library calls of that type, so it is moot. Code calls must be in sub/function parameter list calling format, or as an object method/property. Unless of course your pre-processor is re-organizing your calls into a format the compiler can actually compile. But that puts us right back to let your pre-processor do all the syntax checking. The sky is the limit however YOU want to implement a calling structure, as long as your pre-processor can syntax check and then reformat things to the standard function/object call format that is compilable.
I'd expect some fairly complex forms of "features" could be designed, and putting that heavy work on the compiler to syntax check is unfair. Imagine someone implementing something similar to the OPEN command which could include optional sub-keywords like ACCESS, LOCK, HANDLE, CHAR, BASE, SHARED, READ, WRITE, (and READ WRITE!), BINARY, RANDOM, APPEND, INPUT, OUTPUT, etc. Too much for the compiler to deal with syntactically.
Although, I guess you could so something like this...
.
#SUPPORT "MyLibrary OPEN $ [FOR (INPUT|OUTPUT|APPEND|BINARY|RANDOM)] ACCESS (READ|WRITE|READ WRITE) [LOCK (SHARED|WRITE|READ|READ WRITE)] AS #LONG [LEN = #LONG] [BASE = #LONG] [CHAR = (ANSI|WIDE)]"
- Where "$" specifies a user supplied text string
- "#" specifies a user supplied number (with type after)
- "[..]" blocks denote optional items
- "(...|...)" blocks specify arrays.
Although, in the end, the compiler does not actually compile 3rd-Party library calls of that type, so it is moot. Code calls must be in sub/function parameter list calling format, or as an object method/property. Unless of course your pre-processor is re-organizing your calls into a format the compiler can actually compile. But that puts us right back to let your pre-processor do all the syntax checking. The sky is the limit however YOU want to implement a calling structure, as long as your pre-processor can syntax check and then reformat things to the standard function/object call format that is compilable.
Comment