"use strict";
"use asm";
#include <stdio.h>
#define height 10
#ifdef
#endif
#if
#else
#ifndef
#undef
#pragma
from __future__ import feature
# coding=<encoding name>
# In Perl, the keyword "use", which imports modules, can also be used to specify directives, such as use strict; or use utf8;
use utf8;
coding: UTF-8
#define MAX_CLIENTS 200
int array[MAX_CLIENTS];
#if PRODUCTION
//code
#elif DEVELOPMENT
//code
#else
//code
#endif
// A conditionally-compiled module
#[cfg(target_os = "linux")]
mod bar {
/* ... */
}
// General metadata applied to the enclosing module or crate.
#![crate_type = "lib"]
// A function marked as a unit test
#[test]
fn test_foo() {
/* ... */
}
// A lint attribute used to suppress a warning/error
#[allow(non_camel_case_types)]
type int8_t = i8;
// Inner attribute applies to the entire function.
fn some_unused_variables() {
#![allow(unused_variables)]
let x = ();
let y = ();
let z = ();
}
{-# INLINE foo #-}
-define(TIMEOUT, 200).
...
call(Request) ->
server:call(refserver, Request, ?TIMEOUT).
-undef(Macro).
Option Explicit On|Off
Option Compare Binary
#if VERSION1
let function1 x y =
printfn "x: %d y: %d" x y
x + 2 * y
#else
let function1 x y =
printfn "x: %d y: %d" x y
x - 2*y
#endif
// Line directives as source maps can be used when compiling to F#:
#line 25 "C:\\Projects\\MyProject\\MyProject\\Script1"
#title: filename
#zoom: 1
#acyclicer: greedy
#[test(test1)]
embed (inline) sv{{{
module test1;
initial begin
assert (0) else $error("error");
end
endmodule
}}}
.PR POINT .PR
.PR UPPER .PR
.PR RES .PR
'pr' quote 'pr'
// 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"}
# Directives are special lines that have syntax and semantics of their own. Directives all start with a name of the form .foo; new directives may be added by future versions of the language.
.import math.constants
area = x * math.constants.Pi, ^ 2
.from math.constants import Pi, E
area = x sq, * Pi
polar = a * [E ^ [b * 0+j1]]
Languages with Directives include JavaScript, C, Python, Perl, Ruby, C#, Rust, Haskell, Erlang, Visual Basic, Ada, F#, Common Lisp, C2, nomnoml, Veryl, ALGOL 68, Jule, Turbo Pascal, FML, ScriptEase
Languages without Directives include C3, Lil, progsbase
View all concepts with or missing a hasDirectives measurement
Read more about Directives on the web: 1.