16-intercal

16-intercal - INTERCAL Aaron Bloomfield CS 216 Spring 2009...

Info iconThis preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
INTERCAL Aaron Bloomfield CS 216 Spring 2009
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 A note about the sources The main sources for this lecture set are: The INTERCAL page in Wikipedia http://en.wikipedia.org/wiki/Intercal The INTERCAL Programming Language Revised Reference Manual On the INTERCAL resources page: http://www.catb.org/~esr/intercal/ Both sources are available under “free” licenses Wikipedia under the GNU Free Documentation License The Reference Manual under the GPL In accordance with these licenses, this work is also released under those same licenses
Background image of page 2
3 History Originally designed in 1972 Main goal: “to have a compiler language which has nothing at all in common with any other major language” Only similarities are “basic” things such as: Variables, arrays, I/O, assignment Nothing else! Including all the arithmetic operators you are familiar with… INTERCAL stands for “Programming language without a pronounceable acronym”
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 Politeness INTERCAL makes sure the programmer is polite Statements may be prefixed by PLEASE If not enough PLEASEes are there, the compiler complains: PROGRAMMER IS INSUFFICIENTLY POLITE IF too many are there, the compiler also complains: PROGRAMMER IS OVERLY POLITE Between ¼ and 1/3 of the statements must have PLEASE
Background image of page 4
5 Constants Constants are prefixed by a mesh (#) Can not be negative, and range from 0 to 65535 Examples on next line #0 #32 #65535
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
6 Variables Two types of variables: 16-bit integer Represented by the spot (.) followed by a number between 0 and 65535 Examples on next line .1 .32 .65535 32-bit integer Represented by the two-spot (:) Examples on next line :0 :32 :4294967295 Note that you can’t have negative numbers You have to keep track of the sign separately Further notes .123 and :123 are distinct variables But .1 and .0001 are identical But .001 is not 1E-3
Background image of page 6
7 Arrays Array (of numbers) are represented by a tail (,) or a hybrid (;) for 16-bit and 32-bit values, respectively Array elements are suffixed by the word SUB, followed by the subscripts In summary: .123 :123 ,123 ;123 and #123 are all distinct
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
8 Operators INTERCAL recognized 5 operators: 2 binary, 3 unary “Please be kind to our operators:
Background image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 22

16-intercal - INTERCAL Aaron Bloomfield CS 216 Spring 2009...

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online