プログラミング言語の比較(基本命令)
この記事では、多数のプログラミング言語のデータ型、式、ステートメント、宣言の 構文、および一般的なオペレーティング システム インターフェイスを表にして比較します。
この記事の慣例
一般的に、var、var、またはvarは、変数名やその他の非リテラル値(読者が解釈する値)を表します。残りはリテラルコードです。ギユメ(«と»)は省略可能なセクションを囲みます。Tab ↹は必要な(空白)インデントを示します。
デフォルトでは、テーブルはプログラミング言語名で辞書式昇順にソートされておらず、一部の言語は一部のテーブルにエントリがあり、他のテーブルにはエントリがありません。
型識別子
| 8ビット(バイト) | 16ビット(短整数) | 32ビット | 64ビット(長整数) | 単語サイズ | 任意の精度(bignum) | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| 署名 | 署名なし | 署名 | 署名なし | 署名 | 署名なし | 署名 | 署名なし | 署名 | 署名なし | ||
| エイダ[1] | range -2**7 .. 2**7 - 1[j] | range 0 .. 2**8 - 1[j]または[k]mod 2**8 | range -2**15 .. 2**15 - 1[j] | range 0 .. 2**16 - 1[j]または[k]mod 2**16 | range -2**31 .. 2**31 - 1[j] | range 0 .. 2**32 - 1[j]または[k]mod 2**32 | range -2**63 .. 2**63 - 1[j] | mod 2**64[k] | Integer[j] | range 0 .. 2**Integer'Size - 1[j]または[k]mod Integer'Size | — |
| ALGOL 68(可変幅) | short short int[c] | — | short int[c] | — | int[c] | — | long int[c] | — | int[c] | — | long long int[あ] [ぐ] |
bytesそしてbits | |||||||||||
| C ( C99固定幅) | int8_t | uint8_t | int16_t | uint16_t | int32_t | uint32_t | int64_t | uint64_t | intptr_t[c] | size_t[c] | — |
| C++ ( C++11固定幅) | |||||||||||
| C ( C99可変幅) | signed char | unsigned char | short[c] | unsigned short[c] | long[c] | unsigned long[c] | long long[c] | unsigned long long[c] | int[c] | unsigned int[c] | |
| C++ ( C++11可変幅) | |||||||||||
| Objective-C (ココア) | signed charまたはint8_t | unsigned charまたはuint8_t | shortまたはint16_t | unsigned shortまたはuint16_t | intまたはint32_t | unsigned intまたはuint32_t | long longまたはint64_t | unsigned long longまたはuint64_t | NSIntegerまたはlong | NSUIntegerまたはunsigned long | |
| C# | sbyte | byte | short | ushort | int | uint | long | ulong | IntPtr | UIntPtr | System.Numerics.(.NET 4.0) |
| ジャワ | byte | — | char[b] | — | — | — | — | java.math. | |||
| 行く | int8 | uint8またはbyte | int16 | uint16 | int32 | uint32 | int64 | uint64 | int | uint | big.Int |
| さび | i8 | u8 | i16 | u16 | i32 | u32 | i64 | u64 | isize | usize | — |
| 迅速 | Int8 | UInt8 | Int16 | UInt16 | Int32 | UInt32 | Int64 | UInt64 | Int | UInt | |
| D | byte | ubyte | short | ushort | int | uint | long | ulong | — | — | BigInt |
| コモンリスプ[2] | (signed-byte 8) | (unsigned-byte 8) | (signed-byte 16) | (unsigned-byte 16) | (signed-byte 32) | (unsigned-byte 32) | (signed-byte 64) | (unsigned-byte 64) | bignum | ||
| スキーム | |||||||||||
| ISLISP [3] | bignum | ||||||||||
| パスカル(FPC) | shortint | byte | smallint | word | longint | longword | int64 | qword | integer | cardinal | — |
| ビジュアルベーシック | — | Byte | Integer | — | Long | — | — | — | — | ||
| ビジュアルベーシック.NET | SByte | Short | UShort | Integer | UInteger | Long | ULong | System.Numerics(.NET 4.0) | |||
| フリーベーシック | ByteまたはInteger<8> | UByteまたはUInteger<8> | ShortまたはInteger<16> | UShortまたはUInteger<16> | LongまたはInteger<32> | ULongまたはUInteger<32> | LongIntまたはInteger<64> | ULongIntまたはUInteger<64> | Integer | UInteger | — |
| Python 2.x | — | — | — | — | int | — | long | ||||
| Python 3.x | — | — | — | — | — | int | |||||
| S-ラング | — | — | — | — | — | — | |||||
| フォートラン | INTEGER(KIND = n)[女性] | — | INTEGER(KIND = n)[女性] | — | INTEGER(KIND = n)[女性] | — | INTEGER(KIND = n)[女性] | — | |||
| PHP | — | — | int[メートル] | — | int[メートル] | — | — | [e] | |||
| パール5 | — [d] | — [d] | — [d] | — [d] | — [d] | Math::BigInt | |||||
| 楽 | int8 | uint8 | int16 | uint16 | int32 | uint32 | int64 | uint64 | Int | — | |
| ルビー | — | — | — | — | Fixnum | — | Bignum | ||||
| アーラン[n] | — | — | — | — | integer() | — | integer()[お] | ||||
| スカラ | Byte | — | Short | Char[l] | Int | — | Long | — | — | — | scala.math.BigInt |
| シード7 | — | — | — | — | — | — | integer | — | — | — | bigInteger |
| 雑談 | — | — | — | — | SmallInteger[私] | — | LargeInteger[私] | ||||
| Windows PowerShell | — | — | — | — | — | — | |||||
| OCaml | — | — | int32 | — | int64 | — | intまたはnativeint | open Big_int;;またはbig_int | |||
| F# | sbyte | byte | int16 | uint16 | int32またはint | uint32 | uint64 | nativeint | unativeint | bigint | |
| 標準ML | — | Word8.word | — | Int32.int | Word32.word | Int64.int | Word64.word | int | word | LargeInt.intまたはIntInf.int | |
| ハスケル(GHC) | «import Int»またはInt8 | «import Word»またはWord8 | «import Int»またはInt16 | «import Word»またはWord16 | «import Int»またはInt32 | «import Word»またはWord32 | «import Int»またはInt64 | «import Word»またはWord64 | Int | «import Word»またはWord | Integer |
| エッフェル | INTEGER_8 | NATURAL_8 | INTEGER_16 | NATURAL_16 | INTEGER_32 | NATURAL_32 | INTEGER_64 | NATURAL_64 | INTEGER | NATURAL | — |
| COBOL [h] | BINARY-CHAR «SIGNED» | BINARY-CHAR UNSIGNED | BINARY-SHORT «SIGNED» | BINARY-SHORT UNSIGNED | BINARY-LONG «SIGNED» | BINARY-LONG UNSIGNED | BINARY-DOUBLE «SIGNED» | BINARY-DOUBLE UNSIGNED | — | — | — |
| マセマティカ | — | — | — | — | — | Integer | |||||
| ウルフラム言語 | — | — | — | — | — | Integer | |||||
- ^a 標準定数と は、とと を接頭辞として付加できるかを決定するために使用できます、、 の実際のサイズは定数、、などとして使用できます。
int shortsint lengthsshortlongshort intlong intshort intintlong intshort max intmax intlong max int - ^b 文字によく使用されます。
- ^c ALGOL 68、C、C++ 言語では、整数型
short、int、long、 ( C99、 C++11 )long longため、これらは実装に依存します。C および C++ ではshort、long、 、long long型はそれぞれ少なくとも 16、32、64 ビット幅である必要がありますが、それ以上にすることもできます。 型はint少なくとも と同じ幅でshort最大でも と同じ幅でlong、 は通常、マシンのプロセッサのワード サイズの幅です (つまり、32 ビット マシンでは 32 ビット幅であることが多く、64 ビット マシンでは 64 ビット幅であることがあります)。C99およびC++11 [引用が必要]では、 stdint.hヘッダーで正確な幅の型も定義されています。詳細については、「C 構文#整数型」を参照してください。さらに、型は、配列インデックスやポインタ間の差を処理するのに十分な大きさの符号なし整数と符号付き整数を保持するために、アドレス サイズとの関係で定義されます。[u]intN_tsize_tptrdiff_t - ^d Perl 5には明確な型がありません。整数、浮動小数点数、文字列などはすべて「スカラー」とみなされます。
- PHPに は任意精度のライブラリが2つあります。BCMathライブラリはデータ型として文字列のみを使用します。GMPライブラリは内部的に「リソース」型を使用します。
- ^f の値は[4]の
n組み込み関数によって提供される。SELECTED_INT_KIND - ^g ALGOL 68 G のランタイムオプションは
--precision "number"の精度をlong long int必要な「数値」桁に設定できます。実際の精度は標準定数long long int widthとlong long max intを使用して決定できます。 - COBOL では、必要な精度を指定でき、指定された精度を表現できる利用可能な型が自動的に選択されます。
PIC S9999例えば、「 」は、4桁の10進数精度の符号付き変数を必要とします。バイナリフィールドとして指定した場合、ほとんどのプラットフォームでは16ビットの符号付き型が選択されます。 - ^i Smalltalkは整数に対して適切な表現を自動的に選択します。通常、2つの表現が存在します。1つはネイティブワードサイズからタグビットを除いた整数( SmallInteger)用、もう1つは任意サイズの整数( LargeInteger)用です。算術演算は多態的な引数をサポートし、結果を最も適切なコンパクトな表現で返します。
- ^j Adaの範囲型は、実行時(静的式の場合はコンパイル時も同様)に境界違反がないかチェックされます。実行時に境界違反が発生した場合、「制約エラー」例外が発生します。範囲は2の累乗に制限されません。一般的に定義済みの整数サブタイプは、正数()と自然数()です。(8ビット)、(16ビット)、(64ビット)も一般的に定義されていますが、Ada標準では必須ではありません。整合性チェックよりもパフォーマンスが重要な場合は、実行時チェックを無効にできます。
range 1 .. Integer'Lastrange 0 .. Integer'LastShort_Short_IntegerShort_IntegerLong_Integer - ^k Adaのモジュロ型は、すべての演算においてモジュロ演算を実装します。つまり、範囲違反は発生しません。モジュロは2の累乗に限定されません。
- ^l Java の char のような文字によく使用されます。
- PHP の^m は、そのシステム上の C の type
intと同じ幅です。 [c]long - ^n Erlangは動的型付けです。型識別子は通常、レコードフィールドの型や関数の引数と戻り値の型を指定するために使用されます。 [5]
- ^o 1単語を超える場合。 [6]
| 単精度 | 倍精度 | その他の精度 | プロセッサ依存 | |
|---|---|---|---|---|
| エイダ[1] | Float | Long_Float | — | |
| アルゴル68 | real[あ] | long real[あ] | short real、、long long realなど[d] | |
| C | float[b] | double | long double[女性] | |
| C++ (STL) | ||||
| Objective-C (ココア) | CGFloat | |||
| C# | float | — | ||
| ジャワ | ||||
| 行く | float32 | float64 | ||
| さび | f32 | f64 | f16, f128 | |
| 迅速 | FloatまたはFloat32 | DoubleまたはFloat64 | Float80[グラム] | CGFloat |
| D | float | double | real | |
| コモンリスプ | single-float | double-float | float, short-float, long-float | |
| スキーム | ||||
| ISLISP | ||||
| パスカル(FPC) | single | double | real | |
| ビジュアルベーシック | Single | Double | — | |
| ビジュアルベーシック.NET | ||||
| ゾジョ | ||||
| パイソン | — | float | ||
| JavaScript | Number[7] | — | ||
| S-ラング | ||||
| フォートラン | REAL(KIND = n)[c] | |||
| PHP | float | |||
| パール | ||||
| 楽 | num32 | num64 | Num | |
| ルビー | — | Float | — | |
| スカラ | Float | Double | ||
| シード7 | — | float | ||
| 雑談 | Float | Double | ||
| Windows PowerShell | ||||
| OCaml | — | float | — | |
| F# | float32 | |||
| 標準ML | — | real | ||
| ハスケル(GHC) | Float | Double | ||
| エッフェル | REAL_32 | REAL_64 | ||
| コボル | FLOAT-BINARY-7[e] | FLOAT-BINARY-34[e] | FLOAT-SHORT、、FLOAT-LONGFLOAT-EXTENDED | |
| マセマティカ | — | — | Real | |
- ^a 標準定数
real shortsおよび は、およびに付加できるおよび のreal lengths決定するために使用できます、、の実際のサイズは定数、など。定数、 、は、各タイプのマシンイプシロンに対して使用できます。shortlongshort reallong realshort realreallong realshort max realmax reallong max realshort small realsmall reallong small real - ^b 単精度の宣言は無視されることが多い
- ^c の値は[8]の
n組み込み関数によって提供される。SELECTED_REAL_KIND - ^d ALGOL 68 G のランタイムオプションはs の精度を必要な「number」桁に
--precision "number"設定できます。実際の精度は標準定数とを使用して決定できます。long long reallong long real widthlong long max real - ^e これらのIEEE浮動小数点型は、次の COBOL 標準で導入される予定です。
- ^f
double多くの実装 と同じサイズです - ^g Swift は、 C 言語と同等の 80 ビット拡張精度浮動小数点型をサポートしています。
long double
| 整数 | 単精度 | 倍精度 | 半精度、4倍精度など | |
|---|---|---|---|---|
| エイダ[1] | — | Complex[b] | Complex[b] | Complex[b] |
| アルゴル68 | — | compl | long compl等 | short complなどlong long complなど。 |
| C(C99)[9] | — | float complex | double complex | — |
| C++ (STL) | — | std::complex<float> | std::complex<double> | |
| C# | — | — | System.Numerics.Complex(.NET 4.0) | |
| ジャワ | — | — | — | |
| 行く | — | complex64 | complex128 | |
| D | — | cfloat | cdouble | |
| オブジェクティブC | — | — | — | |
| コモンリスプ | (複素整数) | (複素数単精度浮動小数点数) | (複素数倍精度浮動小数点数) | 複雑な |
| スキーム | — | |||
| パスカル | — | — | ||
| ビジュアルベーシック | — | — | ||
| ビジュアルベーシック.NET | — | — | System.Numerics.Complex(.NET 4.0) | |
| パール | Math::Complex | |||
| 楽 | complex64 | complex128 | Complex | |
| パイソン | complex | — | ||
| JavaScript | — | — | ||
| S-ラング | — | — | ||
| フォートラン | COMPLEX(KIND = n)[あ] | |||
| ルビー | Complex | — | Complex | |
| スカラ | — | — | — | |
| シード7 | — | — | complex | |
| 雑談 | Complex | Complex | Complex | |
| Windows PowerShell | — | — | ||
| OCaml | — | — | Complex.t | |
| F# | System.Numerics.Complex(.NET 4.0) | |||
| 標準ML | — | — | — | |
| ハスケル(GHC) | — | Complex.Complex Float | Complex.Complex Double | |
| エッフェル | — | — | — | |
| コボル | — | — | — | |
| マセマティカ | Complex | — | — | Complex |
- ^a の値は[8]の
n組み込み関数によって提供される。SELECTED_REAL_KIND - ^b 任意の基本浮動小数点型でインスタンス化できる汎用型。
その他の変数タイプ
| 文章 | ブール値 | 列挙 | オブジェクト/ユニバーサル | ||
|---|---|---|---|---|---|
| キャラクター | 文字列[a] | ||||
| エイダ[1] | Character | String、、Bounded_StringUnbounded_String | Boolean | (item1, item2, ...) | tagged null record |
| アルゴル68 | char | string、bytes | bool、bits | N/A - ユーザー定義 | 該当なし |
| C ( C99 ) | char、wchar_t | 該当なし | bool[b] | enum «name» { item1, item2, ... }; | void * |
| C++ (STL) | «std::»string | ||||
| オブジェクティブC | unichar | NSString * | BOOL | id | |
| C# | char | string | bool | enum name { item1« = value», item2« = value», ... } | 物体 |
| ジャワ | String | boolean | enum name { item1, item2, ... } | Object | |
| 行く | byte、rune | string | bool | const ( | interface{} |
| さび | char | String | bool | enum name { item1« = value», item2« = value», ... } | std::any::Any |
| 迅速 | Character | String | Bool | enum name { case item1, item2, ... } | Any |
| D | char | string | bool | enum name { item1, item2, ... } | std.variant.Variant |
| コモンリスプ | character | string | boolean | (member item1 item2 ...) | t |
| スキーム | |||||
| ISLISP | |||||
| パスカル(ISO) | char | 該当なし | boolean | ( item1, item2, ... ) | 該当なし |
| オブジェクトパスカル(デルファイ) | string | variant | |||
| ビジュアルベーシック | 該当なし | String | Boolean | Enum name | Variant |
| ビジュアルベーシック.NET | Char | Object | |||
| ゾジョ | 該当なし | ObjectまたはVariant | |||
| パイソン | 該当なし[d] | str | bool |
| object |
| JavaScript | 該当なし[d] | String | Boolean | Object | |
| S-ラング | |||||
| フォートラン | CHARACTER(LEN = *) | CHARACTER(LEN = :), allocatable | LOGICAL(KIND = n)[女性] | CLASS(*) | |
| PHP | 該当なし[d] | string | bool | (型宣言は省略) | |
| パール | 該当なし[d] | UNIVERSAL | |||
| 楽 | Char | Str | Bool | enum name<item1 item2 ...>enum name «:item1(value) :item2(value) ..» | Mu |
| ルビー | 該当なし[d] | String | Object[c] | Object | |
| スカラ | Char | String | Boolean | object name extends Enumeration { | Any |
| シード7 | char | string | boolean | const type: name is new enum | |
| Windows PowerShell | |||||
| OCaml | char | string | bool | 該当なし[e] | 該当なし |
| F# | type name = item1 = value |item2 = value | ... | obj | |||
| 標準ML | 該当なし[e] | 該当なし | |||
| ハスケル(GHC) | Char | String | Bool | 該当なし[e] | 該当なし |
| エッフェル | CHARACTER | STRING | BOOLEAN | 該当なし | ANY |
| コボル | PIC X | PIC X(string length)またはPIC X«X...» | PIC 1«(number of digits)»またはPIC 1«1...» | 該当なし | OBJECT REFERENCE |
| マセマティカ | 該当なし[d] | String | 該当なし | ||
- ^a 具体的には、任意の長さの文字列が自動的に管理されます。
- ^b この言語ではブール値を整数として表します。false はゼロの値として表され、true はゼロ以外の値として表されます。
- ^c すべての値は真または偽のいずれかに評価されます。 内のすべての値
TrueClassは真に評価され、 内のすべての値FalseClassは偽に評価されます。 - ^dこの言語には独立した文字型はありません。文字は長さ1の文字列として表現されます。
- ^e この言語の列挙型は、null引数コンストラクタのみを持つ代数型である。
- ^f の値は[4]の
n組み込み関数によって提供される。SELECTED_INT_KIND
派生型
| 固定サイズの配列 | 動的サイズ配列 | |||
|---|---|---|---|---|
| 1次元配列 | 多次元配列 | 1次元配列 | 多次元配列 | |
| エイダ[1] | array (<first> .. <last>) of <type>または array (<discrete_type>) of <type> | array (<first1> .. <last1>, <first2> .. <last2>, ...) of <type>または array (<discrete_type1>, <discrete_type2>, ...) of <type> | array (<discrete_type> range <>) of <type> | array (<discrete_type1> range <>, <discrete_type2> range <>, ...) of <type> |
| アルゴル68 | [first:last]または単に: [size] | [first1:last1, first2:last2]など [first1:last1][first2:last2] | flex[first:last]または単に: flex[size] | flex[first1:last1, first2:last2]または flex[first1:last1] |
| C ( C99 ) | type name[size][あ] | type name[size1][size2][あ] | type *nameまたはブロック内では: int n = ...; type name[n] | |
| C++ (STL) | «std::»array<type, size>(C++11) | «std::»vector<type> | ||
| C# | type[] | type[,,...] | Systemまたは System | |
| ジャワ | type[][b] | type[][]...[b] | ArrayList or ArrayList<type> | |
| D | type[size] | type[size1][size2] | type[] | |
| 行く | [size]type | [size1][size2]...type | []type | [][]type |
| さび | [type; size] | [[type; size1]; size2] | Vec<type> | Vec<Vec<type>> |
| 迅速 | [type]またはArray<type> | [[type]]またはArray<Array<type>> | ||
| オブジェクティブC | NSArray | NSMutableArray | ||
| JavaScript | — | — | Array[d] | |
| コモンリスプ | (simple-array type (dimension)) | (simple-array type (dimension1 dimension2)) | (array type (dimension)) | (array type (dimension1 dimension2)) |
| スキーム | ||||
| ISLISP | ||||
| パスカル | array[first..last] of type[c] | array[first1..last1] of array[first2..last2] ... of type[c]または[c] array[first1..last1, first2..last2, ...] of type | — | — |
| オブジェクトパスカル(デルファイ) | array of type | array of array ... of type | ||
| ビジュアルベーシック | Dim x(last) As type | Dim x(last1, last2,...) As type | ||
| ビジュアルベーシック.NET | type() | type(,,...) | Systemまたは System | |
| パイソン | list | |||
| S-ラング | x = type[size]; | x = type[size1, size2, ...]; | ||
| フォートラン | type :: name(size) | type :: name(size1, size2,...) | type, ALLOCATABLE :: name(:) | type, ALLOCATABLE :: name(:,:,...) |
| PHP | array | |||
| パール | ||||
| 楽 | Array[type] or Array of type | |||
| ルビー | x = Array.new(size1){ Array.new(size2) } | Array | ||
| スカラ | Array[type] | Array[...[Array[type]]...] | ArrayBuffer[type] | |
| シード7 | array typeまたは array [idxType] type | array array typeまたは array [idxType] array [idxType] type | array typeまたは array [idxType] type | array array typeまたは array [idxType] array [idxType] type |
| 雑談 | Array | OrderedCollection | ||
| Windows PowerShell | type[] | type[,,...] | ||
| OCaml | type array | type array ... array | ||
| F# | type []または type array | type [,,...] | Systemまたは System | |
| 標準ML | type vector or type array | |||
| ハスケル(GHC) | | | ||
| コボル | level-number type OCCURS size «TIMES». | 1 次元配列の定義... | level-number type OCCURS min-size TO max-size [e] | — |
- ^a C言語のほとんどの式(
sizeofand&演算子を除く)では、配列型の値は自動的に最初の引数へのポインタに変換されます。構文とポインタ演算の詳細については、 C言語の構文#配列を参照してください。 - ^b C のような
type x[]形式は Java でも動作しますが、type[] x配列宣言の推奨形式です。 - ^c サブ範囲は配列の境界を定義するために使用されます。
- ^d JavaScript の配列は特別な種類のオブジェクトです。
- ^e COBOL の 句は真の
DEPENDING ON可変長配列を作成せず、常に配列の最大サイズを割り当てます。
その他のタイプ
| 単純な複合型 | 代数データ型 | 労働組合 | ||
|---|---|---|---|---|
| 記録 | タプル式 | |||
| エイダ[1] | type name is «abstract» «tagged» «limited» [record | 該当なし | レコード、ユニオン、列挙の任意の組み合わせ (およびそれらへの参照により再帰型が有効になります)。 | type name (variation : discrete_type) is record |
| アルゴル68 | struct (modename «fieldname», ...); | 必要な型と演算子はユーザー定義可能 | union (modename, ...); | |
| C ( C99 ) | struct «name» {type name;...}; | 該当なし | 該当なし | union {type name;...}; |
| オブジェクティブC | ||||
| C++ | struct «name» {type name;...};[b] | «std::»tuple<type1..typen> | ||
| C# | struct name {type name;...} | (val1, val2, ... ) | 該当なし | |
| ジャワ | 該当なし[a] | |||
| JavaScript | 該当なし | |||
| D | struct name {type name;...} | std.variant.Algebraic!(type,...) | union {type name;...} | |
| 行く | struct { | |||
| さび | struct name {name: type, ...} | (val1, val2, ... ) | enum name { Foo(types), ...} | union name {name: type, ...} |
| 迅速 | struct name { | («name1:» val1, «name2:» val2, «name3:» val3, ... ) | enum name { case Foo«(types)» case Bar «(types)» ... } | |
| コモンリスプ | (defstruct name slot-name (slot-name initial-value) (slot-name initial-value :type type) ...) | (cons val1 val2)[c] | ||
| スキーム | 該当なし | |||
| ISLISP | ||||
| パスカル | record | 該当なし | 該当なし | record |
| ビジュアルベーシック | ||||
| ビジュアルベーシック.NET | Structure name | (val1, val2, ... ) | ||
| パイソン | 該当なし[a] | «(»val1, val2, val3, ... «)» | 該当なし | |
| S-ラング | struct {name [=value], ...} | |||
| フォートラン | TYPE name | |||
| PHP | 該当なし[a] | |||
| パール | 該当なし[d] | 該当なし | ||
| 楽 | 該当なし[a] | |||
| ルビー | OpenStruct.new({:name => value}) | |||
| スカラ | case class name(«var» name: type, ...) | (val1, val2, val3, ... ) | abstract class nameまたはケースクラスとケースオブジェクトの組み合わせ abstract class name | |
| Windows PowerShell | ||||
| OCaml | type name = {«mutable» name : type;...} | «(»val1, val2, val3, ... «)» | type name = Foo «of type» | Bar «of type» | ... | 該当なし |
| F# | ||||
| 標準ML | type name = {name : type,...} | (val1, val2, val3, ... ) | datatype name = Foo «of type» | Bar «of type» | ... | |
| ハスケル | data Name = Constr {name :: type,...} | data Name = Foo «types» | Bar «types» | ... | ||
| コボル | | 該当なし | 該当なし | name REDEFINES variable type. |
- ^a クラスのみがサポートされます。
-
structC++ の^bは実際にはクラスですが、デフォルトで public な可視性を持ち、 PODオブジェクトでもあります。C++11 ではこれがさらに拡張され、クラスはより多くのケースで POD オブジェクトと同様に動作するようになりました。 - ^c ペアのみ
- ^d Perl にはレコードがありませんが、Perl の型システムでは配列内に異なるデータ型を格納できるため、変数インデックスを持たない「ハッシュ」(連想配列) は実質的にレコードと同じになります。
- ^e この言語の列挙型は、null引数コンストラクタのみを持つ代数型である。
変数と定数の宣言
| 変数 | 絶え間ない | 型同義語 | |
|---|---|---|---|
| エイダ[1] | identifier : type« := initial_value»[e] | identifier : constant type := final_value | subtype identifier is type |
| アルゴル68 | modename name« := initial_value»; | modename name = value; | mode synonym = modename; |
| C ( C99 ) | type name« = initial_value»; | enum{ name = value }; | typedef type synonym; |
| オブジェクティブC | |||
| C++ | const type name = value; | ||
| C# | type name1« = initial_value», name2« = initial_value», ...;または var name = initial_value; | const type name = value, name = value, ...;または readonly type name = value, name = value, ... ; | using synonym = type; |
| D | type name« = initial_value»;または auto name = value; | const type name = value;または immutable type name = value; | alias type synonym; |
| ジャワ | type name« = initial_value»; | final type name = value; | — |
| JavaScript | var name« = initial_value»;または( ECMAScript 2015以降)let name« = initial_value»; | const name = value;(ECMAScript 2015以降) | |
| 行く | var name type« = initial_value»または name := initial_value | const name «type» = value | type synonym type |
| ラケット | (define name expression) | ||
| 錆[f] | let mut name«: type»« = initial_value»;static mut NAME: type = value; | let name«: type»« = initial_value»;const NAME: type = value;static NAME: type = value; | type synonym = typename; |
| 迅速 | var name «: type»« = initial_value» | let name «: type» = value | typealias synonym = type |
| コモンリスプ | (defparameter name initial-value)または (defvar name initial-value) | (defconstant name value) | (deftype synonym () 'type) |
| スキーム | (define name initial_value) | ||
| ISLISP | (defglobal name initial_value)または (defdynamic name initial_value) | (defconstant name value) | — |
| パスカル[a] | name: type« = initial_value» | name = value | synonym = type |
| ビジュアルベーシック | Dim name «As type» | 左の注記を参照してください。 定数は同じ構文を使用します。
| |
| ビジュアルベーシック.NET [10] | VB.NET の変数宣言構文は、正確に記述するのが非常に困難です。 識別子の接尾辞(「修飾子」)が存在するとします。
そして
有効な宣言文は の形式です
。ここで、意味解析を目的として を単一の宣言子のみのリストに変換するには、次のようにします。
そして、各 に対して
がオフの場合 | Imports synonym = type | |
| ゾジョ | Dim name «As type»« = initial_value» | — | |
| パイソン | name«: type» = initial_value | — | synonym = type[b] |
| コーヒースクリプト | name = initial_value | ||
| S-ラング | name = initial_value; | typedef struct {...} typename | |
| フォートラン | type :: name | type, PARAMETER :: name = value | |
| PHP | $name = initial_value; | define("name", value); | — |
| パール | «my» $name« = initial_value»;[c] | use constant name => value; | |
| 楽 | «my «type»» $name« = initial_value»;[c] | «my «type»» constant name = value; | ::synonym ::= type |
| ルビー | name = initial_value | Name = value | synonym = type[b] |
| スカラ | var name«: type» = initial_value | val name«: type» = value | type synonym = type |
| Windows PowerShell | «[type]» $name = initial_value | — | — |
| Bashシェル | name=initial_value | — | — |
| OCaml | let name« : type ref» = ref value[d] | let name «: type» = value | type synonym = type |
| F# | let mutable name «: type» = value | ||
| 標準ML | val name «: type ref» = ref value[d] | val name «: type» = value | |
| ハスケル | «name::type;» name = value | type Synonym = type | |
| フォース | VARIABLE name(一部のシステムでは代わりに使用)value VARIABLE name | value CONSTANT name | |
| コボル | level-number name type clauses. | «0»1 name CONSTANT «AS» value. | level-number name type clauses «IS» TYPEDEF. |
| マセマティカ | name=initial_value | — | — |
- ^a Pascalには宣言ブロックがあります。関数を参照してください。
- ^b型は通常のオブジェクトなので、割り当てるだけで済みます。
- ^c Perl では、「my」キーワードは変数のスコープをブロック内に限定します。
- ^d技術的には、これはname を可変変数として 宣言しているわけではありません。MLでは、すべての名前は一度しか束縛できません。むしろ、これはname が
!「参照」データ構造、つまり単純な可変セルを指すように宣言しています。このデータ構造は、それぞれとを使用して読み書きできます:=。 - ^e 初期値が指定されていない場合、無効な値が自動的に割り当てられます(有効な値が割り当てられる前に無効な値を使用すると、実行時例外が発生します)。この動作は抑制できますが、予測可能性の観点から抑制することをお勧めします。型に無効な値が見つからない場合(例えば、制約のない整数型の場合)、代わりに有効かつ予測可能な値が選択されます。
- ^f Rustでは、変数
letまたはlet mut変数に初期値が与えられておらず、その後も代入されていない場合、「未使用変数」という警告が表示されます。変数constまたはstatic変数static mutはエラーが発生します。大文字以外の変数の場合は「大文字以外のグローバル変数」というエラーが発生しますconst。変数は定義後、static mut内でのみ代入できますunsafe。
条件付き声明
| もし | そうでなければ | ケースを選択 | 条件式 | |
|---|---|---|---|---|
| エイダ[1] | if condition then | if condition1 then | case expression is | (if condition1 thenまたは (case expression is |
| シード7 | if condition then | if condition1 then | case expression of | |
| モジュラ2 | if condition then | if condition1 then | case expression of | |
| アルゴル68 | if condition then statements «else statements» fi | if condition then statements elif condition then statements fi | case switch in statements, statements«,... out statements» esac | ( condition | valueIfTrue | valueIfFalse ) |
| ALGOL 68 (簡易版) | ( condition | statements «| statements» ) | ( condition | statements |: condition | statements ) | ( variable | statements,... «| statements» ) | |
| APL | :If condition | :If condition | :Select expression | {condition:valueIfTrue ⋄ valueIfFalse} |
| C ( C99 ) | if (condition) instructionsinstructions単一のステートメントまたは次の形式のブロックになります。{ statements } | if (condition) instructionsまたは if (condition) instructions | switch (variable) { | condition ? valueIfTrue : valueIfFalse |
| オブジェクティブC | ||||
| C++ (STL) | ||||
| D | ||||
| ジャワ | ||||
| JavaScript | ||||
| PHP | ||||
| C# | if (condition) instructions
| if (condition) instructions | switch (variable)空でないすべてのcaseは | condition ? valueIfTrue : valueIfFalse |
| Windows PowerShell | if (condition) instruction | if (condition) { instructions } | switch (variable) { case1{instructions «break;» } ... «default { instructions }»} | |
| 行く | if condition {instructions} | if condition {instructions}または switch { | switch variable { | |
| 迅速 | if condition {instructions} | if condition {instructions} | switch variable { | |
| パール | if (condition) {instructions}または unless (notcondition) {instructions} | if (condition) {instructions}または unless (notcondition) {instructions} | use feature "switch"; | condition ? valueIfTrue : valueIfFalse |
| ラケット | (when testexpression expressions)または (unless condition expressions) | (cond [testexpression expressions] [testexpression expressions] ... [else expressions]) | (case expression [(case1) expressions] [(case2) expressions] ... [else expressions]) | (if testexpression expressioniftrue expressioniffalse) |
| 楽 | if condition {instructions}または unless notcondition {instructions} | if condition {instructions} | given variable { | condition ?? valueIfTrue !! valueIfFalse |
| ルビー | if condition | if condition | case variable | condition ? valueIfTrue : valueIfFalse |
| スカラ | if (condition) {instructions} | if (condition) {instructions} | expression match { [b] | if (condition) valueIfTrue else valueIfFalse |
| 雑談 | condition ifTrue: | condition ifTrue: trueBlock ifFalse: falseBlock | ||
| コモンリスプ | (when conditionまたはまたは (unless condition(if condition | (cond (condition1 instructions) | (case expression | (if test then else)または (cond (test1 value1) (test2 value2) ...)) |
| スキーム | (when condition instructions)または (if condition (begin instructions) «(begin instructions)») | (cond (condition1 instructions) (condition2 instructions) ... «(else instructions)») | (case (variable) ((case1) instructions) ((case2) instructions) ... «(else instructions)») | (if condition valueIfTrue valueIfFalse) |
| ISLISP | (if condition | (cond (condition1 instructions) | (case expression | (if condition valueIfTrue valueIfFalse) |
| パスカル | if condition then begin[c] | if condition then begin[c] | case variable of[c] | |
| ビジュアルベーシック | If condition Then単一行の instructions場合:instruction1 : instruction2 : ...If condition Then instructions «Else instructions» | If condition Then単一行: C 系言語に関する注記を参照してください。 Else単一行Ifステートメントの句には、別の単一行Ifステートメントを含めることができます。 | Select« Case» variable | IIf(condition, valueIfTrue, valueIfFalse) |
| ビジュアルベーシック.NET | If(condition, valueIfTrue, valueIfFalse) | |||
| ゾジョ | ||||
| Python [a] | if condition : | if condition : | Python 3.10+:match variable: | Python 2.5+:valueIfTrue if condition else valueIfFalse |
| S-ラング | if (condition) { instructions } «else { instructions }» | if (condition) { instructions } else if (condition) { instructions } ... «else { instructions }» | switch (variable) { case case1: instructions } { case case2: instructions } ... | |
| フォートラン | IF (condition) THEN | IF (condition) THEN | SELECT CASE(variable) | |
| フォース | condition IF instructions « ELSE instructions» THEN | condition IF instructions ELSE condition IF instructions THEN THEN | value CASE | condition IF valueIfTrue ELSE valueIfFalse THEN |
| OCaml | if condition then begin instructions end «else begin instructions end» | if condition then begin instructions end else if condition then begin instructions end ... «else begin instructions end» | match value with [b] | if condition then valueIfTrue else valueIfFalse |
| F# | 軽量構文モード: 1 行で記述するか、次に示すようにインデントを付けて記述します。詳細構文モード:標準 ML と同じです。 | 軽量構文モード: 単一行または以下に示すようにインデント付きで記述します。詳細構文モード:標準 ML と同じです。 if condition then | ||
| 標準ML | if condition then «(»instructions «)» | if condition then «(»instructions «)» | case value of[b] | |
| ハスケル(GHC) | if condition then expression else expressionまたはまたは when condition (do instructions)unless notcondition (do instructions) | result | condition = expression | case value of { [b] | |
| Bashシェル | if condition-command; then | if condition-command; then | case "$variable" in | |
| コーヒースクリプト | if condition then expression «else expression»またはまたはまたはまたはまたは if conditionexpression if conditionunless conditionexpression unless condition | if condition then expression else if condition then expression «else expression»またはまたは if conditionunless condition | switch expressionまたは switch expression | すべての条件は式です。 |
| コボル | IF condition «THEN»[d] | EVALUATE expression «ALSO expression...» | ||
| さび | if condition { | if condition { | match variable { [なれ] | すべての条件は式である |
| もし | そうでなければ | ケースを選択 | 条件式 |
- ^aコロンの後の行に1つの命令を記述できます。複数の命令は、改行で始まるブロック にまとめられます(インデントが必要です)。条件式の構文はこの規則に従いません。
- ^b これはパターンマッチングであり、select caseに似ていますが、同じではありません。通常は代数的データ型を分解するために使用されます。
- ^c Pascal系の言語では、セミコロンは文の一部ではありません。文と文を区切るものであり、文の終端記号ではありません。
-
END-IF末尾のピリオドの代わりに^d を使用することもできます。 - ^e
,Rust では、最後のマッチ アームの後、または式がブロックである (空の一致する括弧で終わる可能性がある) マッチ アームの後の、マッチ アームの末尾の コンマ ({}。
| whileループ | do whileループ | (カウント制御)forループ | foreach | |
|---|---|---|---|---|
| エイダ[1] | while condition loop | loop | for index in «reverse» [first .. last | discrete_type] loop | for item of «reverse» iterator loopまたは[b] (for [all | some] [in | of] [first .. last | discrete_type | iterator] => predicate) |
| アルゴル68 | «for index» «from first» «by increment» «to last» «while condition» do statements od | for key «to upb list» do «typename val=list[key];» statements od | ||
«while condition» | «while statements; condition» | «for index» «from first» «by increment» «to last» do statements od | ||
| APL | :While condition | :Repeat | :For var«s» :In list | :For var«s» :InEach list |
| C ( C99 ) | instructions単一のステートメントまたは次の形式のブロックになります。{ statements }while (condition) instructions | do instructions while (condition); | for («type» i = first; i <= last; i++) instructions | — |
| オブジェクティブC | for (type item in set) instructions | |||
| C++ (STL) | «std::»for_each(start, end, function)C++11以降: for (type item : set) instructions | |||
| C# | foreach (type item in set) instructions | |||
| ジャワ | for (type item : set) instructions | |||
| JavaScript | for (var i = first; i <= last; i++) instructions | EcmaScript 2015以降: [11]
| ||
| PHP | foreach (range(first, last) as $i) instructionsまたは for ($i = first; $i <= last; $i++) instructions | foreach (set as item) instructionsまたは foreach (set as key => item) instructions | ||
| Windows PowerShell | for ($i = first; $i -le last; $i++) instructions | foreach (item in set) instructions | ||
| D | foreach (i; first ... last) instructions | foreach («type» item; set) instructions | ||
| 行く | for condition { instructions } | for i := first; i <= last; i++ { instructions } | for key, item := range set { instructions } | |
| 迅速 | while condition { instructions } | 2.x: 1.x:repeat { instructions } while conditiondo { instructions } while condition | for i = first ... last { instructions }またはまたは for i = first ..< last+1 { instructions }for var i = first; i <= last; i++ { instructions } | for item in set { instructions } |
| パール | while (condition) { instructions }または until (notcondition) { instructions } | do { instructions } while (condition)または do { instructions } until (notcondition) | for«each» «$i» (first .. last) { instructions }または for ($i = first; $i <= last; $i++) { instructions } | for«each» «$item» (set) { instructions } |
| 楽 | while condition { instructions }または until notcondition { instructions } | repeat { instructions } while conditionまたは repeat { instructions } until notcondition | for first..last -> $i { instructions }または loop ($i = first; $i <=last; $i++) { instructions } | for set« -> $item» { instructions } |
| ルビー | while conditionまたは until notcondition | beginまたは begin | for i in first..lastまたはまたは for i in first...last+1first.upto(last) { |i| instructions } | for item in setまたは set.each { |item| instructions } |
| Bashシェル | while condition ;doまたは until notcondition ;do | — | for ((i = first; i <= last; ++i)) ; do | for item in set ;do |
| スカラ | while (condition) { instructions } | do { instructions } while (condition) | for (i <- first to last «by 1») { instructions }または first to last «by 1» foreach (i => { instructions }) | for (item <- set) { instructions }または set foreach (item => { instructions }) |
| 雑談 | conditionBlock whileTrue: | loopBlock doWhile: | first to: last do: | collection do: |
| コモンリスプ | (loopまたは (do () (notcondition) | (loop | (loopまたはまたは (dotimes (i N)(do ((i first | (loopまたはまたはまたはまたはまたは (loop(dolist (item list)(mapc function list)(map type function sequence) |
| スキーム | (do () (notcondition) instructions)または | | (do ((i first または | |
| ISLISP | (while condition instructions) | | | |
| パスカル | while condition do begin | repeat | for i := first «step 1» to last do begin[あ] | for item in set do instructions |
| ビジュアルベーシック | Do While conditionまたはまたは(Visual Basic .NETでは代わりに を使用します) Do Until notconditionWhile conditionEnd While | Doまたは Do | i事前に申告する必要があります。
| For Each item In set |
| ビジュアルベーシック.NET | For i« As type» = first To last« Step 1»[あ] | For Each item« As type» In set | ||
| ゾジョ | While condition | Do Until notconditionまたは Do | ||
| パイソン | while condition : | — | Python 3.x: Python 2.x: | for item in set: |
| S-ラング | while (condition) { instructions } «then optional-block» | do { instructions } while (condition) «then optional-block» | for (i = first; i <= last; i++) { instructions } «then optional-block» | foreach item(set) «using (what)» { instructions } «then optional-block» |
| フォートラン | DO WHILE (condition) | DO | DO I = first,last | — |
| フォース | BEGIN «instructions» condition WHILE instructions REPEAT | BEGIN instructions condition UNTIL | limit start DO instructions LOOP | — |
| OCaml | while condition do instructions done | — | for i = first to last do instructions done | Array.iter (fun item -> instructions) arrayまたは List.iter (fun item -> instructions) list |
| F# | while condition do | — | for i = first to last do | for item in set doまたは Seq.iter (fun item -> instructions) set |
| 標準ML | while condition do ( instructions ) | — | Array.app (fn item => instructions) arrayまたは app (fn item => instructions) list | |
| ハスケル(GHC) | — | Control.Monad.forM_ [first..last] (\i -> do instructions) | Control.Monad.forM_list (\item -> do instructions) | |
| エッフェル | from | |||
| コーヒースクリプト | while conditionまたはまたはまたはまたはまたはまたは expression while conditionwhile condition then expressionuntil conditionexpression until conditionuntil expression then condition | — | for i in [first..last]またはまたは for i in [first..last] then expressionexpression for i in [first..last] | for item in setまたはまたは for item in set then expressionexpression for item in set |
| コボル | PERFORM procedure-1 «THROUGH procedure-2» [c]または | PERFORM procedure-1 «THROUGH procedure-2» [c]または | PERFORM procedure-1 «THROUGH procedure-2» VARYING i FROM first BY increment UNTIL i > last[d]または[d] PERFORM VARYING i FROM first BY increment UNTIL i > last | — |
| さび | while condition { | loop { | for i in first..last+1 { または for i in first..=last { | for item in set { [e]または[e] set.into_iter().for_each(|item| expression); |
- ^a "
stepn" はループ間隔を変更するために使用されます。"step" を省略した場合、ループ間隔は1になります。 - ^b これは、全称量指定子(「すべてに対して」または∀)と存在量指定子(「存在する」または∃)を実装します。
-
THRUの代わりに^c がTHROUGH使用されることもあります。 - の代わりに^d が使用されることもあります。
«IS» GREATER «THAN»> - ^e セット式の型は特性を実装する必要があります
std::iter::IntoIterator。
| 投げる | ハンドラ | 主張 | |
|---|---|---|---|
| エイダ[1] | raise exception_name «with string_expression» | begin[b] | |
| APL | «string_expression» ⎕SIGNAL number_expression | :Trap number«s»_expression | «string_expression» |
| C ( C99 ) | longjmp(state, exception); | switch (setjmp(state)) { case 0: instructions break; case exception: instructions ... } | assert(condition); |
| C++ | throw exception; | try { instructions } catch «(exception)» { instructions } ... | |
| C# | try { instructions } catch «(exception« name»)» { instructions } ... «finally { instructions }» | System.Diagnostics.Debug.Assert(condition);または System.Diagnostics.Trace.Assert(condition); | |
| ジャワ | try { instructions } catch (exception) { instructions } ... «finally { instructions }» | assert condition «: description»; | |
| JavaScript | try { instructions } catch (exception) { instructions} «finally { instructions }» | ? | |
| D | try { instructions } catch (exception) { instructions } ... «finally { instructions }» | assert(condition); | |
| PHP | try { instructions } catch (exception) { instructions } ... «finally { instructions }» | assert(condition); | |
| S-ラング | try { instructions } catch «exception» { instructions } ... «finally { instructions }» | ? | |
| Windows PowerShell | trap «[exception]» { instructions } ... instructionsまたは try { instructions } catch «[exception]» { instructions } ... «finally { instructions }» | | |
| オブジェクティブC | @throw exception; | @try { instructions } @catch (exception) { instructions } ... «@finally { instructions }» | NSAssert(condition, description); |
| 迅速 | throw exception(2.x) | do { try expression ... instructions } catch exception { instructions } ...(2.x) | assert(condition«, description») |
| パール | die exception; | eval { instructions | ? |
| 楽 | try { instructions CATCH { when exception { instructions } ...}} | ? | |
| ルビー | raise exception | begin | |
| 雑談 | exception raise | instructionBlock on: exception do: handlerBlock | assert: conditionBlock |
| コモンリスプ | (error "exception")またはまたは (error(error (make-condition | (handler-caseまたは[a] (handler-bind | (assert condition)またはまたは (assert condition(check-type var type) |
| スキーム(R 6 RS) | (raise exception) | (guard (con (condition instructions) ...) instructions) | ? |
| ISLISP | (error "error-string" objects)または (signal-condition condition continuable) | (with-handler | ? |
| パスカル | raise Exception.Create() | try Except on E: exception do begin instructions end; end; | ? |
| ビジュアルベーシック | Err.Raise ERRORNUMBER | '*** クラスを試す *** Private mstrDescription As String Private mlngNumber As Long Public Sub Catch ( ) mstrDescription = Err.Description mlngNumber = Err.Number End Sub パブリックプロパティGet Number () As Long Number = mlngNumber Endプロパティ パブリックプロパティGet Description () As String Description = mstrDescription End Property | Debug.Assert condition |
| ビジュアルベーシック.NET | Throw exceptionまたは Error errorcode | Try | System.Diagnostics.または System.Diagnostics. |
| ゾジョ | Raise exception | Try | — |
| パイソン | raise exception | try: | assert condition |
| フォートラン | — | ||
| フォース | code THROW | xt CATCH ( code or 0 ) | — |
| OCaml | raise exception | try expression with pattern -> expression ... | assert condition |
| F# | try expression with pattern -> expression ...または try expression finally expression | ||
| 標準ML | raise exception «arg» | expression handle pattern => expression ... | |
| ハスケル(GHC) | throw exceptionまたは throwError expression | catch tryExpression catchExpressionまたは catchError tryExpression catchExpression | assert condition expression |
| コボル | | またはまたはまたは | — |
| さび | いいえ[13] | assert!(condition) | |
- ^a Common Lispでは、、、を使用して
with-simple-restart、restart-caseでrestart-bind使用するための再起動を定義できますinvoke-restart。処理されない条件が発生すると、実装によってスタックを巻き戻す前にユーザーに再起動メニューが表示される場合があります。 - ^b キャッチされない例外は、最も内側の動的実行に伝播されます。例外はタスク間で伝播されません(ただし、これらのタスクが現在ランデブーで同期されている場合は除きます)。
その他の制御フロー文
| ブロックを終了(中断) | 続く | ラベル | ブランチ(goto) | ジェネレータからの戻り値 | |
|---|---|---|---|---|---|
| エイダ[1] | exit «loop_name» «when condition» | — | label: | goto label | — |
| アルゴル68 | value exit;... | do statements; skip exit; label: statements od | label:... | go to label; ... | yield(value)(コールバック)[14] |
| APL | :Leave | :Continue | label: | →labelまたは :GoTo label | — |
| C ( C99 ) | break; | continue; | label: | goto label; | — |
| オブジェクティブC | |||||
| C++ (STL) | |||||
| D | |||||
| C# | yield return value; | ||||
| ジャワ | break «label»; | continue «label»; | — | ||
| JavaScript | yield value«;» | ||||
| PHP | break «levels»; | continue «levels»; | goto label; | yield «key =>» value; | |
| パール | last «label»; | next «label»; | |||
| 楽 | |||||
| 行く | break «label» | continue «label» | goto label | ||
| 迅速 | break «label» | continue «label» | — | ||
| Bashシェル | break «levels» | continue «levels» | — | — | — |
| コモンリスプ | (return)またはまたは (return-from block)(loop-finish) | (tagbody tag | (go tag) | ||
| スキーム | |||||
| ISLISP | (return-from block) | (tagbody tag | (go tag) | ||
| パスカル(ISO) | — | label:[あ] | goto label; | — | |
| パスカル(FPC) | break; | continue; | |||
| ビジュアルベーシック | Exit blockあるいは、方法については、Return | — | label: | GoTo label | |
| ゾジョ | Continue block | ||||
| ビジュアルベーシック.NET | Yield value | ||||
| パイソン | break | continue | — | yield value | |
| RPG IV | LEAVE; | ITER; | |||
| S-ラング | break; | continue; | |||
| フォートラン | EXIT | CYCLE | label[b] | GOTO label | — |
| ルビー | break | next | |||
| Windows PowerShell | break «label» | continue | |||
| OCaml | — | ||||
| F# | |||||
| 標準ML | |||||
| ハスケル(GHC) | |||||
| コボル | EXIT PERFORMまたはEXIT PARAGRAPHまたはEXIT SECTIONまたはEXIT. | EXIT PERFORM CYCLE | label «SECTION». | GO TO label | — |
- ^a Pascalには宣言ブロックがあります。関数を参照してください。
- ^b ラベルは 1 ~ 99999 の数字である必要があります。
文字列による関数の呼び出しと宣言については、リフレクティブ プログラミングを参照してください。
| 関数を呼び出す | 基本/void関数 | 値を返す関数 | 必要なメイン関数 | |
|---|---|---|---|---|
| エイダ[1] | foo «(parameters)» | procedure foo «(parameters)» is begin statements end foo | function foo «(parameters)» return type is begin statements end foo | — |
| アルゴル68 | foo «(parameters)»; | proc foo = «(parameters)» void: ( instructions ); | proc foo = «(parameters)» rettype: ( instructions ...; retvalue ); | — |
| APL | «parameters» foo parameters | foo←{ statements } | foo←{ statements } | — |
| C ( C99 ) | foo(«parameters») | void foo(«parameters») { instructions } | type foo(«parameters») { instructions ... return value; } | «global declarations» |
| オブジェクティブC | ||||
| C++ (STL) | ||||
| ジャワ | または | |||
| D | またはまたはまたは | |||
| C# | 上記と同じです。あるいは、ステートメントが 1 つだけの場合:
| 上記と同じです。あるいは、式として十分単純な場合:
| static void Main(«string[] args») method_body代わりに を返す場合があります int。(C# 7.1 以降:) または を返す場合 Taskがあります。その場合、 になることがあります。Task<int>async | |
| JavaScript | function foo(«parameters») { instructions }またはまたは | function foo(«parameters») { instructions ... return value; } | — | |
| 行く | func foo(«parameters») { instructions } | func foo(«parameters») type { instructions ... return value } | func main() { instructions } | |
| 迅速 | func foo(«parameters») { instructions } | func foo(«parameters») -> type { instructions ... return value } | — | |
| コモンリスプ | (foo «parameters») | (defun foo («parameters»)または | (defun foo («parameters») | — |
| スキーム | (define (foo parameters) instructions)または (define foo (lambda (parameters) instructions)) | (define (foo parameters) instructions... return_value)または (define foo (lambda (parameters) instructions... return_value)) | ||
| ISLISP | (defun foo («parameters») | (defun foo («parameters») | ||
| パスカル | foo«(parameters)» | procedure foo«(parameters)»; «forward;»[a] | function foo«(parameters)»: type; «forward;»[a] | program name; |
| ビジュアルベーシック | Foo(«parameters») | Sub Foo«(parameters)» | Function Foo«(parameters)»« As type» | Sub Main() |
| ビジュアルベーシック.NET | 上記と同じ。または、
| または | ||
| ゾジョ | ||||
| パイソン | foo(«parameters») | def foo(«parameters»): | def foo(«parameters»): | — |
| S-ラング | foo(«parameters» «;qualifiers») | define foo («parameters») { instructions } | define foo («parameters») { instructions ... return value; } | public define slsh_main () { instructions } |
| フォートラン | foo («arguments»)[c] | SUBROUTINE sub_foo («arguments»)[c] | type FUNCTION foo («arguments»)[c] | PROGRAM main |
| フォース | «parameters» FOO | | | — |
| PHP | foo(«parameters») | function foo(«parameters») { instructions } | function foo(«parameters») { instructions ... return value; } | — |
| パール | foo(«parameters»)または &foo«(parameters)» | | | |
| 楽 | foo(«parameters»)または &foo«(parameters)» | | «our «type» » | |
| ルビー | foo«(parameters)» | def foo«(parameters)» | def foo«(parameters)» | |
| さび | foo(«parameters») | fn foo(«parameters») { instructions } | fn foo(«parameters») -> type { instructions } | fn main() { instructions } |
| スカラ | foo«(parameters)» | def foo«(parameters)»«: Unit =» { instructions } | def foo«(parameters)»«: type» = { instructions ... «return» value } | |
| Windows PowerShell | foo «parameters» | function foo { instructions };または function foo { «param(parameters)» instructions } | function foo «(parameters)» { instructions ... return value };または function foo { «param(parameters)» instructions ... return value } | — |
| Bashシェル | foo «parameters» | function foo {または foo () { | function foo {または foo () { | |
| ||||
| OCaml | foo parameters | let «rec» foo parameters = instructions | let «rec» foo parameters = instructions... return_value | |
| F# | | |||
| 標準ML | fun foo parameters = ( instructions ) | fun foo parameters = ( instructions... return_value ) | ||
| ハスケル | foo parameters = do | foo parameters = return_valueまたは foo parameters = do | «main :: IO ()» | |
| エッフェル | foo («parameters») | foo («parameters») | foo («parameters»): type | [b] |
| コーヒースクリプト | foo() | foo = -> | | — |
foo parameters | foo = () -> | foo = ( parameters ) -> value | ||
| コボル | CALL "foo" «USING parameters»[d] | «IDENTIFICATION DIVISION.» | «IDENTIFICATION DIVISION.» | — |
«FUNCTION» foo«(«parameters»)» | — | |||
- ^a Pascalでは前方宣言
forward;に " "。 - ^b Eiffel では、アプリケーションのルート クラスと機能を指定できます。
- ^c Fortran では、関数/サブルーチン パラメータは引数と呼ばれます (
PARAMETERは言語キーワードであるため)。CALLキーワードはサブルーチンに必須です。 - ^d を使用する代わりに
"foo"、同じ値を含む文字列変数を使用することもできます。
ここで、文字列は符号付き 10 進数です。
| 文字列を整数に変換 | 文字列を長整数に変換する | 文字列を浮動小数点数に変換する | 整数を文字列に変換 | 浮動小数点から文字列へ | |
|---|---|---|---|---|---|
| エイダ[1] | Integer'Value (string_expression) | Long_Integer'Value (string_expression) | Float'Value (string_expression) | Integer'Image (integer_expression) | Float'Image (float_expression) |
| ALGOL 68の一般形式と特定形式 | 事前の宣言および関連付け:string buf := "12345678.9012e34 "; file proxy; associate(proxy, buf); | ||||
get(proxy, ivar); | get(proxy, livar); | get(proxy, rvar); | put(proxy, ival); | put(proxy, rval); | |
getf(proxy, ($g$, ivar));または getf(proxy, ($dddd$, ivar)); | getf(proxy, ($g$, livar));または getf(proxy, ($8d$, livar)); | getf(proxy, ($g$, rvar));または getf(proxy, ($8d.4dE2d$, rvar)); | putf(proxy, ($g$, ival));または putf(proxy, ($4d$, ival)); | putf(proxy, ($g(width, places, exp)$, rval));または putf(proxy, ($8d.4dE2d$, rval)); | |
| APL | ⍎string_expression | ⍎string_expression | ⍎string_expression | ⍕integer_expression | ⍕float_expression |
| C ( C99 ) | integer = atoi(string); | long = atol(string); | float = atof(string); | sprintf(string, "%i", integer); | sprintf(string, "%f", float); |
| オブジェクティブC | integer = [string intValue]; | long = [string longLongValue]; | float = [string doubleValue]; | string = | string = |
| C++ (STL) | «std::»istringstream(string) >> number; | «std::»ostringstream o; o << number; string = o.str(); | |||
| C++11 | integer = «std::»stoi(string); | long = «std::»stol(string); | float = «std::»stof(string); double = «std::»stod(string); | string = «std::»to_string(number); | |
| C# | integer = int.Parse | long = long.Parse | float = float.Parsedouble = double.Parse | string = number | |
| D | integer = std.conv.to!int | long = std.conv.to!long | float = std.conv.to!floatdouble = std.conv.to!double | string = std.conv.to!string | |
| ジャワ | integer = Integer.parseInt | long = Long.parseLong | float = Float.parseFloatdouble = Double.parseDouble | string = Integer.toStringstring = String.valueOf | string = Float.toStringstring = Double.toString |
| JavaScript [a] | integer = parseInt(string); | float = parseFloat(string);float = new Number (string);float = Number (string);float = +string; | string = number.toString ();string = String (number);string = number+"";string = `${number}` | ||
| 行く | integer, error = strconv.Atoi(string) | long, error = strconv.ParseInt | float, error = strconv.ParseFloat | string = strconv.Itoa(integer)string = strconv.FormatIntstring = fmt.Sprint(integer) | string = strconv.FormatFloatstring = fmt.Sprint |
| 錆[d] | string.parse::<i32>()i32::from_str(string) | string.parse::<i64>()i64::from_str(string) | string.parse::<f64>()f64::from_str(string) | integer.to_string() | float.to_string() |
| コモンリスプ | (setf integer (parse-integer string)) | (setf float (read-from-string string)) | (setf string (princ-to-string number)) | ||
| スキーム | (define number (string->number string)) | (define string (number->string number)) | |||
| ISLISP | (setf integer (convert string <integer>)) | (setf float (convert string <float>)) | (setf string (convert number <string>)) | ||
| パスカル | integer := StrToInt(string); | float := StrToFloat(string); | string := IntToStr(integer); | string := FloatToStr(float); | |
| ビジュアルベーシック | integer = CInt(string) | long = CLng(string) | float = CSng(string) | string = CStr(number) | |
| Visual Basic .NET (上記の VB 構文と右に示す .NET メソッドの両方を使用できます) | integer = Integer.Parse | long = Long.Parse | float = Single.Parsedouble = Double.Parse | string = number | |
| ゾジョ | integer = Val(string) | long = Val(string) | double = Val(string)double = CDbl(string) | string = CStr(number)または string = Str(number) | |
| パイソン | integer = int(string) | long = long(string) | float = float(string) | string = str(number) | |
| S-ラング | integer = atoi(string); | long = atol(string); | float = atof(string); | string = string(number); | |
| フォートラン | READ(string,format) number | WRITE(string,format) number | |||
| PHP | integer = intval(string);または integer = (int)string; | float = floatval(string);float = (float)string; | string = "$number";またはまたは string = strval(number);string = (string)number; | ||
| パール[b] | number = 0 + string; | string = "number"; | |||
| 楽 | number = +string; | string = ~number; | |||
| ルビー | integer = string.to_iまたは integer = Integer(string) | float = string.to_ffloat = Float(string) | string = number.to_s | ||
| スカラ | integer = string.toInt | long = string.toLong | float = string.toFloatdouble = string.toDouble | string = number.toString | |
| 雑談 | integer := Integer readFrom: string | float := Float readFrom: string | string := number asString | ||
| Windows PowerShell | integer = [int]string | long = [long]string | float = [float]string | string = [string]number;またはまたは string = "number";string = (number).ToString() | |
| OCaml | let integer = int_ | let float = float_ | let string = string_ | let string = string_ | |
| F# | let integer = int string | let integer = int64 string | let float = float string | let string = string number | |
| 標準ML | val integer = Int | val float = Real | val string = Int | val string = Real | |
| ハスケル(GHC) | number = read string | string = show number | |||
| コボル | | MOVE number TO numeric-edited | |||
- ^a JavaScriptは浮動小数点数のみを使用するため、技術的な問題がいくつかあります。 [7]
- ^b Perlには別々の型はありません。文字列と数値は互換性があります。
- ^c
NUMVAL-CまたはNUMVAL-Fを の代わりに使用できますNUMVAL。 - ^ str::parse は、std::str::FromStr トレイトの実装を持つ任意の型を変換するために使用できます。 str::parse
str::parseと FromStr::from_str はResult、エラーがなければ指定された型を含む を返します。 turbofish(::<_>) は、str::parseコンテキストから型を推測できる場合は省略できます。
| から読む | 書く | ||
|---|---|---|---|
| 標準入力 | 標準出力 | 標準エラー出力 | |
| エイダ[1] | Get (x) | Put (x) | Put (Standard_Error, x) |
| アルゴル68 | readf(($format$, x));または getf(stand in, ($format$, x)); | printf(($format$, x));または putf(stand out, ($format$, x)); | putf(stand error, ($format$, x));[あ] |
| APL | x←⎕ | ⎕←x | ⍞←x |
| C ( C99 ) | scanf(format, &x);または[b] fscanf(stdin, format, &x); | printf(format, x);または[c] fprintf(stdout, format, x); | fprintf(stderr, format, x);[d] |
| オブジェクティブC | data = [[NSFileHandle fileHandleWithStandardInput] readDataToEndOfFile]; | [[NSFileHandle fileHandleWithStandardOutput] writeData:data]; | [[NSFileHandle fileHandleWithStandardError] writeData:data]; |
| C++ | «std::»cin >> x;または «std::»getline(«std::»cin, str); | «std::»cout << x; | «std::»cerr << x;または «std::»clog << x; |
| C# | x = Console.Read();または x = Console.ReadLine(); | Console.Write(«format, »x);または Console.WriteLine(«format, »x); | Console.Errorまたは Console.Error |
| D | x = std.stdio.readln() | std.stdio.write(x)またはまたはまたは std.stdio.writeln(x)std.stdio.writef(format, x)std.stdio.writefln(format, x) | stderr.write(x)またはまたはまたは stderr.writeln(x)std.stdiostd.stdio |
| ジャワ | x = System.in.read();またはまたは x = new Scanner(System.in).nextInt();x = new Scanner(System.in).nextLine(); | System.out.print(x);またはまたは System.out.printf(format, x);System.out.println(x); | System.err.print(x);またはまたは System.err.printf(format, x);System.err.println(x); |
| 行く | fmt.Scan(&x)またはまたは fmt.Scanf(format, &x)x = bufio.NewReader(os.Stdin).ReadString('\n') | fmt.Println(x)または fmt.Printf(format, x) | fmt.Fprintln(os.Stderr, x)または fmt.Fprintf(os.Stderr, format, x) |
| 迅速 | x = readLine()(2.x) | print(x)(2.x) (1.x)println(x) | |
| JavaScript Webブラウザ実装 | document.write(x) | ||
| JavaScript アクティブサーバーページ | Response.Write(x) | ||
| JavaScript Windows スクリプトホスト | x = WScript.StdIn.Read(chars)または x = WScript.StdIn.ReadLine() | WScript.Echo(x)またはまたは WScript.StdOut.Write(x)WScript.StdOut.WriteLine(x) | WScript.StdErr.Write(x)または WScript.StdErr.WriteLine(x) |
| コモンリスプ | (setf x (read-line)) | (princ x)または (format t format x) | (princ x *error-output*)または |
| スキーム(R 6 RS) | (define x (read-line)) | (display x)または | (display x (current-error-port))または |
| ISLISP | (setf x (read-line)) | | |
| パスカル | read(x);または readln(x); | write(x);または writeln(x); | write(stderr, x);または writeln(stderr, x); |
| ビジュアルベーシック | Input« prompt,» x | Print xまたは ? x | — |
| ビジュアルベーシック.NET | x = Console.Read()または x = Console.ReadLine() | Console.Write(«format,»x)または Console.WriteLine(«format, »x) | Console.Errorまたは Console.Error |
| ゾジョ | x = StandardInputStream.Read()または x = StandardInputStreame.ReadLine() | StandardOutputStream.Write(x)または StandardOutputStream.WriteLine(x) | StdErr.Write(x)または StdErr.WriteLine(x) |
| Python 2.x | x = raw_input(«prompt») | print xまたは sys.stdout.write(x) | または sys.stderr.write(x) |
| Python 3.x | x = input(«prompt») | print(x«, end=""») | print(x«, end=""», file=sys.stderr) |
| S-ラング | fgets (&x, stdin) | fputs (x, stdout) | fputs (x, stderr) |
| フォートラン | READ(*,format) variable names または[e] READ(INPUT_UNIT,format) variable names | WRITE(*,format) expressions または[e] WRITE(OUTPUT_UNIT,format) expressions | WRITE(ERROR_UNIT,format) expressions[e] |
| フォース | buffer length ACCEPT ( # chars read ) | buffer length TYPE | — |
| PHP | $x = fgets(STDIN);または $x = fscanf(STDIN, format); | print x;またはまたは echo x;printf(format, x); | fprintf(STDERR, format, x); |
| パール | $x = <>;または $x = <STDIN>; | print x;または printf format, x; | print STDERR x;または printf STDERR format, x; |
| 楽 | $x = $*IN.get; | x.printまたは x.say | x.noteまたはまたは $*ERR.print(x)$*ERR.say(x) |
| ルビー | x = gets | puts xまたは printf(format, x) | $stderr.puts(x)または $stderr.printf(format, x) |
| Windows PowerShell | $x = Read-Host«« -Prompt» text»;またはまたは $x = [Console]::Read();$x = [Console]::ReadLine() | x;またはまたは Write-Output x;echo x | Write-Error x |
| OCaml | let x = read_int ()またはまたは let str = read_line ()Scanf.scanf format (fun x ... -> ...) | print_int xまたはまたは print_endline strPrintf.printf format x ... | prerr_int xまたはまたは prerr_endline strPrintf.eprintf format x ... |
| F# | let x = System.Console.ReadLine() | printf format x ...または printfn format x ... | eprintf format x ...または eprintfn format x ... |
| 標準ML | val str = TextIO.inputLIne TextIO.stdIn | print str | |
| ハスケル(GHC) | x <- readLnまたは str <- getLine | print xまたは putStrLn str | hPrint stderr xまたは hPutStrLn stderr str |
| コボル | ACCEPT x | DISPLAY x | |
- ^a ALGOL 68 には、さらに「フォーマットされていない」トランスプットルーチン
read、、、、およびがwriteます。getput - ^b
gets(x)で標準入力からフォーマットされていないテキストを読み込みます。gets の使用は推奨されません。fgets(x, length, stdin) - ^c を
puts(x)実行して、fputs(x, stdout)フォーマットされていないテキストを stdout に書き込みます。 - ^dは
fputs(x, stderr)フォーマットされていないテキストをstderrに書き込みます - ^e INPUT_UNIT、OUTPUT_UNIT、ERROR_UNITはISO_FORTRAN_ENVモジュールで定義されています。 [15]
| 引数の値 | 議論の数 | プログラム名 / スクリプト名 | |
|---|---|---|---|
| エイダ[1] | Argument (n) | Argument_Count | Command_Name |
| C ( C99 ) | argv[n] | argc | 最初の議論 |
| オブジェクティブC | |||
| C++ | |||
| C# | args[n] | args.Length | Assembly.GetEntryAssembly() |
| ジャワ | args.length | ||
| D | 最初の議論 | ||
| JavaScript Windows Script Host実装 | WScript.Arguments(n) | WScript.Arguments.length | WScript.ScriptNameまたは WScript.ScriptFullName |
| 行く | os.Args[n] | len(os.Args) | 最初の議論 |
| 錆[a] | std::env::args().nth(n)std::env::args_os().nth(n) | std::env::args().count()std::env::args_os().count() | std::env::args().next()std::env::args_os().next() |
| 迅速 | Process.arguments[n]またはProcess.unsafeArgv[n] | Process.arguments.countまたはProcess.argc | 最初の議論 |
| コモンリスプ | ? | ? | ? |
| スキーム(R 6 RS) | (list-ref (command-line) n) | (length (command-line)) | 最初の議論 |
| ISLISP | — | — | — |
| パスカル | ParamStr(n) | ParamCount | 最初の議論 |
| ビジュアルベーシック | Command[b] | — | App.Path |
| ビジュアルベーシック.NET | CmdArgs(n) | CmdArgs.Length | [Assembly].GetEntryAssembly().Location |
| ゾジョ | System.CommandLine | (文字列解析) | Application.ExecutableFile.Name |
| パイソン | sys.argv[n] | len(sys.argv) | 最初の議論 |
| S-ラング | __argv[n] | __argc | 最初の議論 |
| フォートラン | DO i = 1,argc | argc = COMMAND_ARGUMENT_COUNT () | CALL GET_COMMAND_ARGUMENT (0,progname) |
| PHP | $argv[n] | $argc | 最初の議論 |
| Bashシェル | $n ($1, $2, $3, ...)$@(すべての引数) | $# | $0 |
| パール | $ARGV[n] | scalar(@ARGV) | $0 |
| 楽 | @*ARGS[n] | @*ARGS.elems | $PROGRAM_NAME |
| ルビー | ARGV[n] | ARGV.size | $0 |
| Windows PowerShell | $args[n] | $args.Length | $MyInvocation.MyCommand |
| OCaml | Sys.argv.(n) | Array.length Sys.argv | 最初の議論 |
| F# | args.[n] | args.Length | Assembly.GetEntryAssembly() |
| 標準ML | List.nth (CommandLine.arguments (), n) | length (CommandLine.arguments ()) | CommandLine.name () |
| ハスケル(GHC) | do { args <- System.getArgs; return length args !! n} | do { args <- System.getArgs; return length args} | System.getProgName |
| コボル | [c] | — | |
- ^a Rust では、
std::env::argsはそれぞれstd::env::args_os反復子、 を返します。は各引数を に変換し、 UTF-8に変換できない引数に達するとパニックになります。オペレーティング システム ( ) からの生の文字列の非損失表現を返しますが、これは無効な UTF-8 である可能性があります。std::env::Argsstd::env::ArgsOsArgsStringArgsOsstd::ffi::OsString - ^b Visual Basicでは、コマンドライン引数は分割されません。分割するにはsplit関数が必要です。
Split(string) - ^c COBOL 標準にはコマンドライン引数にアクセスする手段は含まれていませんが、それらにアクセスするための一般的なコンパイラ拡張機能には、メインプログラムのパラメータの定義や
ACCEPTステートメントの使用が含まれます。
コマンドの実行
| シェルコマンド | プログラムを実行する | 現在のプログラムを新しく実行されたプログラムに置き換える | |
|---|---|---|---|
| エイダ[1] | 言語標準の一部ではありません。コンパイラが提供するパッケージ、またはCやPOSIXとのインターフェースによって行われるのが一般的です。[16] | ||
| C | system("command"); | execl(path, args);または execv(path, arglist); | |
| C++ | |||
| オブジェクティブC | [NSTask launchedTaskWithLaunchPath:(NSString *)path arguments:(NSArray *)arguments]; | ||
| C# | System.Diagnostics | ||
| F# | |||
| 行く | exec.Run(path, argv, envv, dir, exec.DevNull, exec.DevNull, exec.DevNull) | os.Exec(path, argv, envv) | |
| ビジュアルベーシック | Interaction.Shell(command «, WindowStyle» «, isWaitOnReturn») | ||
| ビジュアルベーシック.NET | Microsoft.VisualBasic | System.Diagnostics | |
| ゾジョ | Shell.Execute(command «, Parameters») | FolderItem.Launch(parameters, activate) | — |
| D | std.process.system("command"); | std.process.execv(path, arglist); | |
| ジャワ | Runtime.exec(command);または new ProcessBuilder(command).start(); | ||
| JavaScript Windows Script Host実装 | | WshShell.Exec(command) | |
| コモンリスプ | (uiop:run-program command) | ||
| スキーム | (system command) | ||
| ISLISP | — | — | — |
| パスカル | system(command); | ||
| OCaml | Sys.command command, Unix.open_process_full command env (stdout, stdin, stderr),... | Unix.create_process prog args new_stdin new_stdout new_stderr, ... | Unix.execv prog argsまたは Unix.execve prog args env |
| 標準ML | OS.Process.system command | Unix.execute (path, args) | Posix.Process.exec (path, args) |
| ハスケル(GHC) | System.system command | System.Process | Posix.Process |
| パール | system(command)またはまたは $output = `command`$output = qx(command) | exec(path, args) | |
| ルビー | system(command)または output = `command` | exec(path, args) | |
| PHP | system(command)またはまたはまたは $output = `command`exec(command)passthru(command) | ||
| パイソン | os.system(command)または subprocess.Popen(command) | subprocess.call(["program", "arg1", "arg2", ...]) | os.execv(path, args) |
| S-ラング | system(command) | ||
| フォートラン | CALL EXECUTE_COMMAND_LINE (COMMAND «, WAIT» «, EXITSTAT» «, CMDSTAT» «, CMDMSG»)[あ] | ||
| Windows PowerShell | [Diagnostics.Process]::Start(command) | «Invoke-Item »program arg1 arg2 ... | |
| Bashシェル | output=`command`または output=$(command) | program arg1 arg2 ... | |
^a Fortran 2008以降。 [17]
参照
参考文献
- ^ abcdefghijklmnop Adaリファレンスマニュアル – 言語および標準ライブラリ; ISO/IEC 8652:201x (E)、「リファレンスマニュアル」(PDF) 。 2011年4月27日時点のオリジナル(PDF)からアーカイブ。 2013年7月19日閲覧。
- ^ "Common Lisp HyperSpec (TM)". lispworks.com . 2017年1月30日閲覧。
- ^ "www.islisp.info: 仕様". islisp.info . 2016年1月22日時点のオリジナルよりアーカイブ。2017年1月30日閲覧。
- ^ ab "Selected_int_kind in Fortran Wiki". fortranwiki.org . 2017年1月30日閲覧。
- ^ 「Erlang — 型と関数の仕様」erlang.org . 2017年1月30日閲覧。
- ^ 「Erlang — 上級編」erlang.org . 2017年1月30日閲覧。
- ^ ab 8.5 数値型
- ^ ab "Selected_real_kind in Fortran Wiki". fortranwiki.org . 2017年1月30日閲覧。
- ^ 「GNU Cライブラリ:複素数」gnu.org . 2017年1月30日閲覧。
- ^ “Grammar vb”. Visual Basic Language Specification . 2016年6月17日. 2019年8月29日時点のオリジナルよりアーカイブ。 2019年8月29日閲覧。
- ^ "for...of". mozilla.org . 2017年1月30日閲覧。
- ^ “Try-Catch for VB”. google.com . 2016年4月16日時点のオリジナルよりアーカイブ。2017年1月30日閲覧。
- ^ Klabnik, Steve; Nichols, Carol. 「エラー処理」. Rustプログラミング言語.
- ^ 「素数分解 – Rosetta Code」. rosettacode.org . 2017年1月30日閲覧。
- ^ 「Fortran Wikiのiso_fortran_env」. fortranwiki.org . 2017年1月30日閲覧。
- ^ 「システムコマンドの実行 – Rosetta Code」. rosettacode.org . 2017年1月30日閲覧。
- ^ 「EXECUTE_COMMAND_LINE – GNU Fortranコンパイラ」. gnu.org . 2017年1月30日閲覧。