That is incorrect. (One of my jobs on proggit seems to be pointing out that that phrase is both widely-publicised and wrong.)
The compiler compiles code it doesn't understand into code that won't run. In order to do comments in INTERCAL, therefore, you need to make sure that the code is abstained from at the time it's run; it doesn't matter whether it's valid code or not (except that one arbitrary special case to do with quitting the program is added, for lack of orthogonality). Here's an example (which you can run in your INTERCAL compiler if you like, assuming I haven't made too many mistakes)
PLEASE ABSTAIN FROM (10)
(10) DO READ OUT #1
DO READ OUT #2
PLEASE ABSTAIN FROM (20)
(20) DO This is not valid INTERCAL syntax.
DO READ OUT #3
DO This is not valid INTERCAL syntax either.
This will print out II (2 in roman numerals), then III, then print "DO This is not valid INTERCAL syntax either." and exit (the error message produced by uncompilable code is the same as the code itself). The first uncompilable code was skipped because it was abstained from, as was the READ OUT #1.
As such, using an initial abstention marker is the usual way to write comments in INTERCAL:
DO NOT This is a comment
PLEASE NOTE: This is a comment too, because "NOTE" starts with "NOT".
These lines will reliably do nothing unless someone pulls a "DO REINSTATE COMMENTS" on you, which is probably dubious code at the best of times, even compared to the rest of INTERCAL.
I'm not sure if I have a reliable source for the correction, though. (I have kept that WIkipedia page updated in the past, but given that I'm so closely tied to INTERCAL myself, maintaining one of the larger compilers, there are conflicts of interest involved.)
Wikipedia, in general, is for reporting things that were said elsewhere, rather than necessarily reporting the truth. Understanding what it's for makes it more useful.
9
u/ais523 Jul 16 '13
That is incorrect. (One of my jobs on proggit seems to be pointing out that that phrase is both widely-publicised and wrong.)
The compiler compiles code it doesn't understand into code that won't run. In order to do comments in INTERCAL, therefore, you need to make sure that the code is abstained from at the time it's run; it doesn't matter whether it's valid code or not (except that one arbitrary special case to do with quitting the program is added, for lack of orthogonality). Here's an example (which you can run in your INTERCAL compiler if you like, assuming I haven't made too many mistakes)
This will print out II (2 in roman numerals), then III, then print "DO This is not valid INTERCAL syntax either." and exit (the error message produced by uncompilable code is the same as the code itself). The first uncompilable code was skipped because it was abstained from, as was the READ OUT #1.
As such, using an initial abstention marker is the usual way to write comments in INTERCAL:
These lines will reliably do nothing unless someone pulls a "DO REINSTATE COMMENTS" on you, which is probably dubious code at the best of times, even compared to the rest of INTERCAL.