[Oberon] AosTCP.Mod

Douglas G. Danforth danforth at greenwoodfarm.com
Sun Apr 16 20:11:19 CEST 2006


Thomas,
In my opinion that is not good programming for it relies upon
a 'side effect' which is heavily frowned upon.  A pointer replaces
itself invisibly.  It would be better if (for example) there were a
function ConnectionListFinalize such that

FOR i:= 0 TO HashTableSize-1 DO ConnectionListFinalize(table[i]) END;

-Doug Danforth

Thomas Frey wrote:
> The table ARRAY contains the heads of linked lists of Connection.
> Inside the WHILE loop, the first Connection of the hash table at
> position i is finalized. The finalization automatically (via Finalize
> --> Discard --> Drop / CloseConnection) removes the Connection form
> the linked list, and the next Connection in the list moves to the
> list-head ( table[i]).
> So the WHILE table[i] # NIL "destructively" traverses the list.
>
> --Thomas
>
> On 4/16/06, Stefan Salewski <mail at ssalewski.de> wrote:
>   
>> MODULE AosTCP; (** AUTHOR "pjm, mvt"; PURPOSE "TCP protocol"; *)
>>
>> (* Finalize all connections in this pool *)
>> PROCEDURE Finalize();
>> VAR i: LONGINT;
>> BEGIN
>>         FOR i:= 0 TO HashTableSize-1 DO
>>                 WHILE table[i] # NIL DO
>>                         table[i].Finalize();
>>                 END;
>>         END;
>> END Finalize;
>>
>> Can someone give me a hint about the purpose
>> of this WHILE-loop?
>> For me this construct looks strange.
>>
>> Best regards
>>
>> Stefan Salewski
>> --
>> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
>> https://lists.inf.ethz.ch/mailman/listinfo/oberon
>>
>>     
>> ------------------------------------------------------------------------
>>
>> --
>> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
>> https://lists.inf.ethz.ch/mailman/listinfo/oberon
>>     


More information about the Oberon mailing list