[comp.lang.eiffel] Generic types.

jonasn@ttds.UUCP (Jonas Nygren) (08/22/89)

Suppose one declares a class tree[T] like in the eiffel book. Is is then 
possible to write a member function tree.preorder_print where:

preorder_print is
	Current.print;
	mark;
	gofirst;
	loop until offright
		sibling(T); T.preorder; next
	end loop

The method 'print' is defined in T. (I know it's not formally correct
eiffel but I hope you understand what I mean anyway)

Would it be possible to pass the method as an arg to preorder, e g:

preorder_print(M: ...) is
	Current.M;
	...

My belief is that none of these constructs are possible but I would appreciate
if somebody could confirm my beliefs (or put me right). Are there any 
prefered solutions for the constructs above?

Thanks in advance - Jonas Nygren