In Other High-level Languages
In Ada, compiler directives are called pragmas (short for "pragmatic information").
In Turbo Pascal, directives are called significant comments, because in the language grammar they follow the same syntax as comments. In Turbo Pascal, a significant comment is a comment whose first character is a dollar sign and whose second character is a letter; for example, the equivalent of C's #include "file"
directive is the significant comment {$I "file"}
.
In Perl, the keyword "use
" can introduce a "pragma", such as use strict;
or use utf8;
. ECMAScript also uses this keyword to introduce "pragmas".
In Visual Basic, the statement "Option Explicit On
" instructs the VB compiler to require all variable declarations before use. There are also a few other variations to the Option
keyword, such as:
Option Strict On
- Requires that implicit type casts are only to wider types.Option Compare Binary
- Tells the compiler to compare text using a binary algorithm.Option Compare Text
- Tells the compiler to compare text using a textual algorithm.
Read more about this topic: Directive (programming)
Famous quotes containing the word languages:
“The less sophisticated of my forbears avoided foreigners at all costs, for the very good reason that, in their circles, speaking in tongues was commonly a prelude to snake handling. The more tolerant among us regarded foreign languages as a kind of speech impediment that could be overcome by willpower.”
—Barbara Ehrenreich (b. 1941)