typedef t n | C, C++, Pike |
type n is t | Ada |
type n ... | Pliant |
type n = t | Haskell, OCaml, Pascal, SML |
TYPE n = t | Modula-3 |
using n = ... | C# |
data n = t | Haskell |
datatype n = t | SML |
newtype n = t | Haskell |
n = t | merd |
n : t | Beta |
(deftype n () 't) | Common Lisp |
: | Ada, E, Eiffel, Modula-3, OCaml, Pascal, SML |
:: | Dylan, Haskell, Mercury |
!! | merd |
t v | C, C#, C++, Java, Perl6, Pike, Pliant, YCP |
(declare (v t)) | Common Lisp |
v :@ t | Beta |
typeset | BourneShell |
upcast
(t) e | C, C#, C++, Java, PHP |
t(e) | Ada, Pascal |
[t] e | Pike |
static_cast<t>(e) | C++ |
e :> t | OCaml |
CAST(e as t) | SQL92 |
typecast(e,t) | Matlab |
downcast (need runtime checking)
(t) e | Java |
t(e) | Ada |
e : t | E |
[t] e | Pike |
dynamic_cast<t>(e) | C++ |
e as t | C# |
v ?= e | Eiffel |
NARROW(e, t) | Modula-3 |
typecast(e,t) | Matlab |
computed conversion (calls an internal or a user-defined function)
(t) e | C++, Pike |
[t] e | MSH |
t(e) | C++, Matlab |
e : t | E |
cast e t | Pliant |
expr cast t | Pliant |
make t e / to t e | Rebol |
type of a mutable value
it is the default | Ada, C, C#, C++, Java, Matlab |
val x: T | Pascal |
T ref | OCaml, SML |
STRef a T | Haskell |
type of a constant value
const T | C++, C99 |
constant T | Ada |
const x: T | Pascal |
it is the default | Haskell, OCaml, SML |
special cases
"readonly" fields | C# |
"final" fields, parameters, local variables | Java |