by =?ISO-8859-15?Q?Roman_T=F6ngi?= <roman.toengi@[EMAIL PROTECTED]
>
Oct 18, 2007 at 01:34 PM
Friedrich Dominicus wrote:
> Roman Töngi <roman.toengi@[EMAIL PROTECTED]
> writes:
>
>> I want to traverse a binary search tree and output
>> each node-item.
>> The following does not compile but I have no idea why not.
>> The actual argument "v" has type INTEGER_32.
>> See error message below.
>>
>> class
>> APPLICATION
>> create
>> make
>> feature -- Initialization
>> make is
>> -- Run application.
>> local
>> tree: MY_TREE [INTEGER]
>> do
>> create tree.make (500)
>> tree.put (200)
>> tree.put (100)
>> tree.put (150)
>> tree.put (125)
>> tree.put (600)
>> tree.put (550)
>> tree.put (800)
>> tree.put (700)
>> tree.put (650)
>> tree.put (750)
>> tree.put (725)
>> tree.i_infix
>> end
>> end -- class APPLICATION
>>
>>
>> class
>> MY_TREE [G -> COMPARABLE]
>> inherit
>> BINARY_SEARCH_TREE [G]
>> redefine
>> node_action
>> end
>> create
>> make
>> feature -- Cursor movement
>> node_action (v: like item) is
> this means like G
>> -- Perfom action on item.
>> do
>> io.put_integer (v)
> a G may or may not conform to an integer
>> io.put_character (' ')
>> end
>> invariant
>> invariant_clause: True -- Your invariant here
>> end -- class MY_TREE
> The error message is correct
>
> Regards
> Friedrich
>
Do you have a solution to my problem?
I am a beginner and thankful to any help.
Thx