ときどきの雑記帖 RE* (新南口)
The Best of Both Worlds
TNG (新スタートレック - Wikipedia) に The Best of Both Worlds というエピソードがあります。 以前、このサブタイトルは訳すとどうなるんだろうか、 なにかことわざ的なものなのかと思い調べたのですが見つからず。 まさか直訳していいのかと放置してたのですが
- The Best of Both Worldsの意味・使い方・読み方 | Weblio英和辞書
- 両方のいいとこ取り。 – You get the best of both worlds. | ニック式英会話
- “best of both wor…の意味・使い方|英辞郎 on the WEB
数日前ふと検索したらこの辺が引っかかり。
なるほどなあと納得したのですが、なぜ以前はかすりもしなかったのだろう…
Qiita
https://qiita.com/tag-feed で眺めることがほとんどなんですが ここ数日 502 になってばかりでネタ探しができん(笑)
https://qiita.com/ や https://qiita.com/timeline だと問題ないみたいなんですけどねえ。
現在Qiita , Qiita Team , Qiita Jobsに障害が発生しており、アクセスがしづらい状態となっております。
— Qiita (キータ) 公式 (@Qiita) February 19, 2021
記事ページについては問題なく閲覧ができます。
現在原因の調査中です。
ご利用の皆様にはご迷惑をおかけして申し訳ございません。
復旧し次第、再度こちらのアカウントにてお伝えします。
なんかこういうツイートもあるけど リツイート数も少ないし ふつーの人の使い方ではそれほど問題ないといいうことなのか あるいは…
シかサか
きちんと調べたわけではないけど、報道関係は「パーシビアランス」、 学術関係(というくくりでいいか?)は「パーサヴィアランス(パーサビアランス)」 と表記しているみたいだけど、なんでだろう?
- 【解説】NASAの探査車「パーシビアランス」が火星着陸に成功 | ナショナルジオグラフィック日本版サイト
- NASA探査車「パーシビアランス」が火星に着陸-生命の痕跡探る - Bloomberg
- パーサヴィアランス - Wikipedia
- パーサビアランス | 天文学辞典
上記のリストの一番下、天文学辞典には
NASAのマーズ2020ミッションの火星表面探査車の名称。パーサビアランス(perseverance: パーシビアランスとも表記)は「忍耐」という意味で、愛称はパーシィ。
という記述もあるんだけど、 perseveranceの意味・使い方・読み方 | Weblio英和辞書 の発音記号を見る限りでは「パーシビアランス」とは読まないような気がするのだけど (結論はありません)。
for
前回 のつづき。
For loop - Wikipedia によれば、
The name for-loop comes from the word for, which is used as the keyword in many programming languages to introduce a for-loop. The term in English dates to ALGOL 58 and was popularized in the influential later ALGOL 60; it is the direct translation of the earlier German für, used in Superplan (1949–1951) by Heinz Rutishauser, who also was involved in defining ALGOL 58 and ALGOL 60. The loop body is executed “for” the given values of the loop variable, though this is more explicit in the ALGOL version of the statement, in which a list of possible values and/or increments can be specified.
ということだそうで、英語のfor
という語がつかわれるようになったのは
ALGOL-58からで、さらにさかのぼるとドイツ語のfür
を使っていた Superplan - Wikipedia
に至ると。
Superplan introduced the keyword "for" resp. the German für with its for loop, which had the following form (ai being an array):
Für i=base(increment)limit: ai + addend = ai
で、
The for-statement has the form for i:=base(increment)limit, directly resembling the loop of Rutishauser’s programming language Superplan, replacing =with :=, and replacing its German keyword Für with the direct English translation for;
となり、 ALGOL 60 - Wikipedia で
ALGOL 60 replaced the parentheses with the word delimiters step and until, such that the previous statement instead would be i:=base step increment until limit.
となって
procedure Absmax(a) Size:(n, m) Result:(y) Subscripts:(i, k);
value n, m; array a; integer n, m, i, k; real y;
comment The absolute greatest element of the matrix a, of size n by m,
is transferred to y, and the subscripts of this element to i and k;
begin
integer p, q;
y := 0; i := k := 1;
for p := 1 step 1 until n do
for q := 1 step 1 until m do
if abs(a[p, q]) > y then
begin y := abs(a[p, q]);
i := p; k := q
end
end Absmax
よく見る形に近いものになったんだけど、 ALGOL 68 - Wikipedia で
Algol68 allowed the switch to be of either type int or (uniquely) union. The latter allows the enforcing strong typing onto union variables. c.f. union below for example.
do loop clause: [ for index ] [ from first ] [ by increment ] [ to last ] [ while condition ] do statements od
というものに。
This was considered the “universal” loop, the full syntax is:
for i from 1 by -22 to -333 while i×i≠4444 do ~ od
順番や構文要素の違いはありますが、Cのforっぽさがありますな。
The construct have several unusual aspects:
- only the do ~ od portion was compulsory, in which case the loop will iterate indefinitely.
- thus the clause to 100 do ~ od, will iterate only 100 times.
- the while “syntactic element” allowed a programmer to break from a for loop early. e.g.
int sum sq:=0; for i while print(("So far:",i,newline)); sum sq≠70↑2 do sum sq+:=i↑2 od
Subsequent “extensions” to the standard Algol68 allowed the to syntactic element to be replaced with upto and downto to achieve a small optimisation. The same compilers also incorporated:
- until(C) – for late loop termination.
- foreach(S) – for working on arrays in parallel.
断り書き
上で書いた(引用した)ことはWikipediaのみ調べたことなので、 過度に信用することは慎んでいただくようお願いします。
Wikipediaとは言え英語版なので日本語版の記述よりは信用が置けるとは思うけど、 可能ならWikipediaの記事にある外部リンクを足がかりに 調べる範囲を広げてさらにそれを記事にしてもらえると嬉しいです。
おまけ?
For文の"For"って何だろう?という疑問。ある3つの言語を巡る小旅行。 - Unityでインディゲーム道!