Special variables: Difference between revisions

added ocaml
(added ocaml)
Line 814:
<ask>answer</ask>
</pre>
 
=={{header|OCaml}}==
 
Some predefined variables from the <code>[http://caml.inria.fr/pub/docs/manual-ocaml/libref/Sys.html Sys]</code> module:
 
<lang ocaml>val argv : string array
(** The command line arguments given to the process.
The first element is the command name used to invoke the program.
The following elements are the command-line arguments
given to the program. *)
 
val executable_name : string
(** The name of the file containing the executable currently running. *)
 
val interactive : bool ref
(** This reference is initially set to [false] in standalone
programs and to [true] if the code is being executed under
the interactive toplevel system [ocaml]. *)
 
val os_type : string
(** Operating system currently executing the Caml program. One of
- ["Unix"] (for all Unix versions, including Linux and Mac OS X),
- ["Win32"] (for MS-Windows, OCaml compiled with MSVC++ or Mingw),
- ["Cygwin"] (for MS-Windows, OCaml compiled with Cygwin). *)
 
val word_size : int
(** Size of one word on the machine currently executing the Caml
program, in bits: 32 or 64. *)
 
val max_string_length : int
(** Maximum length of a string. *)
 
val max_array_length : int
(** Maximum length of a normal array. The maximum length of a float
array is [max_array_length/2] on 32-bit machines and
[max_array_length] on 64-bit machines. *)
 
val ocaml_version : string
(** [ocaml_version] is the version of Objective Caml.
It is a string of the form ["major.minor[.patchlevel][+additional-info]"],
where [major], [minor], and [patchlevel] are integers, and
[additional-info] is an arbitrary string. The [[.patchlevel]] and
[[+additional-info]] parts may be absent. *)</lang>
 
Some predefined variables from the <code>[http://caml.inria.fr/pub/docs/manual-ocaml/libref/Pervasives.html Pervasives]</code> module:
 
<lang ocaml>val max_int : int
(** The greatest representable integer. *)
 
val min_int : int
(** The smallest representable integer. *)
 
val max_float : float
(** The largest positive finite value of type [float]. *)
 
val min_float : float
(** The smallest positive, non-zero, non-denormalized value of type [float]. *)
 
val epsilon_float : float
(** The difference between [1.0] and the smallest exactly representable
floating-point number greater than [1.0]. *)</lang>
 
=={{header|PARI/GP}}==