Sign in Join
Wiki copytemporary

Basic Pascal Tutorial/Chapter 4/Forward Referencing/ja: what changed

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
114F - 前方参照 (著者: Tao Yue, 状態: 原文のまま変更なし)
22
33難しいトピックが続いたが、ここでは簡単なことを話そう。
44
55手続きや関数はすでに定義済みの変数やサブプログラムだけを見ることができたことを思いだそう。だが、ひとつ例外がある。
66
77お互いが他方を呼び出している2つのサブプログラムがあるとすると、どちらを最初に置くべきかというジレンマが生じる。もう一方は最初のものからまだ呼び出せないからである。
88
99この「卵が先か鶏が先か」問題をとくためには _前方参照_ を使う。
1010```
1111procedure Later (parameter list); forward;
1212
1313 procedure Sooner (parameter list);
1414 begin
1515 ...
1616 Later (parameter list);
1717 end;
1818 ...
1919 procedure Later;
2020 begin
2121 ...
2222 Sooner (parameter list);
2323 end;
2424```
2525
2626関数も同様である。単にヘッディングの終わりに forward をつければ良い。
2727
2828[[Basic Pascal Tutorial/Chapter 4/Recursion/ja|previous]] | [[Basic Pascal Tutorial/Contents/ja|contents]] | [[Basic Pascal Tutorial/Chapter 4/Programming Assignment/ja|next]]
2929---|---|---
3030
3131---
32-*From the Free Pascal wiki, page "Forward Referencing/ja", as the Internet Archive kept it on 2023-03-30. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
32+*From the Free Pascal wiki, page "Forward Referencing/ja", as the Internet Archive kept it on 2023-03-30, last changed on 2022-08-20. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*

Back to history