Directive (programming): Difference between revisions

Content deleted Content added
Monkbot (talk | contribs)
m Task 18 (cosmetic): eval 5 templates: hyphenate params (3×);
Line 33:
* In [[Turbo Pascal]], directives are called '''significant comments''', because in the language [[grammar]] they follow the same syntax as [[comment (computer programming)|comment]]s. 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 <code>#include "file"</code> directive is the significant comment <code>{$I "file"}</code>.
* In [[Perl]], the [[keyword (computer programming)|keyword]] "<code>[http://perldoc.perl.org/functions/use.html use]</code>", which imports modules, can also be used to specify directives, such as <code>use strict;</code> or <code>use utf8;</code>.
* [[Haskell (programming language)|Haskell]] pragmas are specified using a specialized comment syntax, e.g. <code>{-# INLINE foo #-}</code>.<ref>{{cite web|title=7.20. Pragmas|url=http://www.haskell.org/ghc/docs/7.8.3/html/users_guide/pragmas.html|website=GHC 7.8.3 Documentation|accessdateaccess-date=18 July 2014}}</ref>
* [[Python (programming language)|Python]] has two directives – <code>from __future__ import feature</code> (defined in [https://www.python.org/dev/peps/pep-0236/ PEP 236 -- Back to the __future__]), which changes language features (and uses the existing module import syntax, as in Perl), and the <code>coding</code> directive (in a comment) to specify the encoding of a source code file (defined in [https://www.python.org/dev/peps/pep-0263/ PEP 263 -- Defining Python Source Code Encodings]). A more general directive statement was proposed and rejected in [https://www.python.org/dev/peps/pep-0244/ PEP 244 -- The `directive' statement]; these all date to 2001.
* [[ECMAScript]] also adopts the <code>use</code> syntax for directives, with the difference that pragmas are declared as string literals (e.g. <code>"use strict";</code>, or <code>"use asm";</code>), rather than a function call.
Line 65:
| publication-date = 2014
| isbn = 9781449324414
| accessdateaccess-date = 2016-06-16
| quote = PL/SQL has a PRAGMA keyword with the following syntax: PRAGMA ''instruction_to_compiler''; [...] PL/SQL offers several pragmas [...]
}}
Line 77:
{{reflist}}
{{refbegin}}
* {{cite book | isbn = 1-55558-041-6 | title = [[Common Lisp the Language]] | last = Steele | first = Guy L. | authorlinkauthor-link = Guy L. Steele | year = 1990 | publisher = Digital Press | pages = 215–237 }}
{{refend}}