PL/1, Origin of struct (構造体のメンバの記憶域の順)
新城@筑波大学情報です。こんにちは。
In article <bif0l6$u7v$1@bluegill.lbm.go.jp>
toda@lbm.go.jp writes:
> ところで、Subject:には「PL/M」とあるのですが、
> 本文の方が書き誤りと考えて良いでしょうか?
すみません。間違えました。Multics だから M かなあと、
Subject: を書く時に思っていたのですが、本文書く時には、PL/1
でいいかと思って。
http://www.multicians.org/pl1-raf.html
------------------------------------------------------------
The language
The Multics PL/1 language is the language defined by the IBM
"PL/1 Language Specifications" dated March 1968. At the time
this paper was written most language features were
implemented by the compiler but the run time library did not
include support for input and output, as well as several
lesser features. Since the multi-tasking primitives provided
by the Multics operating system were not well suited to PL/1
tasking, PL/1 tasking was not implemented. Inter-process
communication (Multics tasking) may be performed through
calls to operating system facilities.
------------------------------------------------------------
> >Cを先に勉強してから PL/1 を見た時には、PL/1 は、かっこ悪い
> >感じがしました。構造体の定義で、ネストのレベルを現すのに数字
> >を書かないといけなかったと思います。
> この仕様は、COBOLそのまんまです。
そうでしたか。Cobol は、書いたことがないので。
http://www.users.bigpond.com/robin_v/c2pli.htm より構造体の
宣言の仕方の対比があったので抜き出しておきます。
C言語:
struct S {
int p;
float q;
};
PL/1:
DECLARE 1 S,
3 p FIXED BINARY,
3 q FLOAT DECIMAL;
C言語(ビットフィールド)
struct T {
unsigned int u : 1;
unsigned int v : 2;
unsigned int w : 0;
};
Note that a zero field is filled out to a byte boundary as shown.
PL/1:
DECLARE 1 T,
3 u BIT (1) UNALIGNED,
3 v BIT (2) UNALIGNED,
3 w BIT (5) UNALIGNED;
過去の話もいいんですが、未来の話ももっとしたいですね。
現在のCの規格が、未来永劫変るわけでもないし。
\\ 新城 靖 (しんじょう やすし) \\
\\ 筑波大学 電子・情報 \\
Fnews-brouse 1.9(20180406) -- by Mizuno, MWE <mwe@ccsf.jp>
GnuPG Key ID = ECC8A735
GnuPG Key fingerprint = 9BE6 B9E9 55A5 A499 CD51 946E 9BDC 7870 ECC8 A735