Ada for Data Structures and Algorithms クラスでプログラムを作成しています。
私の現在の問題は、 「「これ」の実際は変数でなければならない」というエラーです。 周りを見回して、アウトモードが原因であると読みましたが、なぜそれが私に起こっているのか完全には把握していません。
私が見た例は理にかなっていますが、それは私のコーディングなので、私はそれを見ていないと思いますか?
Procedure AddUnmarked(g:Grid; this:Linked_List_Coord.List_Type; c:Cell) is
cNorth : Cell := getCell(g, North(c));
cEast : Cell := getCell(g, East(c));
cSouth : Cell := getCell(g, South(c));
cWest : Cell := getCell(g, West(c));
Begin
if CellExists(g, cNorth) and not cNorth.IsMarked then
Linked_List_Coord.Append(this, cNorth.Coords);
elsif CellExists(g, cEast) and not cEast.IsMarked then
Linked_List_Coord.Append(this, cEast.Coords);
elsif CellExists(g, cSouth) and not cSouth.IsMarked then
Linked_List_Coord.Append(this, cSouth.Coords);
elsif CellExists(g, cWest) and not cWest.IsMarked then
Linked_List_Coord.Append(this, cWest.Coords);
end if;
End AddUnmarked;
「this」が関数に渡される前は、自己定義型 Coord (2 つの整数) の Linked_List です。それは初期化され、リストがコード内の上記の関数に渡される前に座標ペアが追加されています。