Closed typeswitch-dev closed 5 months ago
This PR expands and replaces def-external with external. The new external declaration can be used the same way as def-external, but it also allows you to make C declarations directly. E.g.,
def-external
external
external( "#include <stdio.h>" "void printint(int x) { printf(\"%d\", x); }" printint [ +World CInt -- +World ] )
This example has both raw C declarations (the string literals), and an external function declaration printint [ +World CInt -- +World ].
printint [ +World CInt -- +World ]
Note the new syntax for declaring an external function, where the type signature is passed in the brackets:
name [ type-sig ] name -> symbol [ type-sig ]
The old syntax (passing the type signature as a separate argument) is still supported, but not recommended.
This PR expands and replaces
def-external
withexternal
. The newexternal
declaration can be used the same way asdef-external
, but it also allows you to make C declarations directly. E.g.,This example has both raw C declarations (the string literals), and an external function declaration
printint [ +World CInt -- +World ]
.Note the new syntax for declaring an external function, where the type signature is passed in the brackets:
The old syntax (passing the type signature as a separate argument) is still supported, but not recommended.