Next: , Up: External Calls   [Index]


14.1 External Calls to C

INTERCAL-72 C-INTERCAL CLC-INTERCAL J-INTERCAL
no version 0.28+ no no

Linking C and INTERCAL programs is achieved by placing various constructs into the C programs that are equivalent to various INTERCAL constructs. It is possible to simulate a line with a label and a dummy command (which serves as a COME FROM suckpoint and NEXT target), a command with a line label, NEXT, RESUME, and FORGET, and COME FROM and NEXT FROM. Onespot and twospot variables are accessible from inside the C program, where they can be read and written; however, the INTERCAL program cannot access any variables inside the C program that weren’t part of the INTERCAL program originally.

To prevent various logical impossibilities, there are restrictions on where these can be used and what preparation is needed before they are used. Also, the semantics are not always exactly what you might expect for technical reasons.

It should be observed that the INTERCAL link intrudes on the user namespace. To prevent possible namespace clashes, no identifiers starting with ick_ or ICK_ should be used anywhere in the linked C program for any reason, except where specified in this manual.


Next: , Up: External Calls   [Index]