indexing
	description: "[
		Objects representing delayed calls to a function,
		with some arguments possibly still open.
	]"
	note: "[
		Features are the same as those of ROUTINE,
		with `apply' made effective, and the addition
		of `last_result' and `item'.
	]"
	status: "See notice at end of class"
	date: "$Date$"
	revision: "$Revision$"
class interface
	FUNCTION [BASE_TYPE, OPEN_ARGS -> TUPLE, RESULT_TYPE]
feature 
	adapt (other: ROUTINE [ANY, OPEN_ARGS])
			other
			
			 ROUTINE
		require  ROUTINE
			other_exists: other /= void
			conforming: conforms_to (other)
		ensure  ROUTINE
			same_call_status: other.callable implies callable
	
feature 
	hash_code: INTEGER
			
			 ROUTINE
		ensure  HASHABLE
			good_hash_value: Result >= 0
	item (args: OPEN_ARGS): RESULT_TYPE
			args
		require
			valid_operands: valid_operands (args)
			callable: callable
	last_result: RESULT_TYPE
			
	open_operand_type (i: INTEGER): INTEGER
			i
			 ROUTINE
		require  ROUTINE
			positive: i >= 1
			within_bounds: i <= open_count
	operands: OPEN_ARGS
			
			 ROUTINE
	postcondition (args: like operands): BOOLEAN
			
			args
			 ROUTINE
	precondition (args: like operands): BOOLEAN
			args
			
			 ROUTINE
	target: ANY
			
			 ROUTINE
	
feature 
	open_count: INTEGER
			
			 ROUTINE
	
feature 
	is_equal (other: like Current): BOOLEAN
			
			other
		require  ANY
			other_not_void: other /= void
		ensure  ANY
			symmetric: Result implies other.is_equal (Current)
			consistent: standard_is_equal (other) implies Result
	
feature 
	callable: BOOLEAN
			
			 ROUTINE
	is_hashable: BOOLEAN
			
			
			 HASHABLE
		ensure  HASHABLE
			ok_if_not_default: Result implies (Current /= default)
	valid_operands (args: OPEN_ARGS): BOOLEAN
			args
			 ROUTINE
	
feature 
	set_operands (args: OPEN_ARGS)
			args
			 ROUTINE
		require  ROUTINE
			valid_operands: valid_operands (args)
	
feature 
	copy (other: like Current)
			other
		require  ANY
			other_not_void: other /= void
			type_identity: same_type (other)
		ensure  ANY
			is_equal: is_equal (other)
		ensure then  ROUTINE
			same_call_status: other.callable implies callable
	
feature 
	apply
			operands
		require  ROUTINE
			valid_operands: valid_operands (operands)
			callable: callable
	call (args: OPEN_ARGS)
			args
			 ROUTINE
		require  ROUTINE
			valid_operands: valid_operands (args)
			callable: callable
	
invariant
		 ANY
	reflexive_equality: standard_is_equal (Current)
	reflexive_conformance: conforms_to (Current)
indexing
	library: "[
			EiffelBase: Library of reusable components for Eiffel.
	]"
	status: "[
			Copyright 1986-2001 Interactive Software Engineering (ISE).
			For ISE customers the original versions are an ISE product
			covered by the ISE Eiffel license and support agreements.
	]"
	license: "[
			EiffelBase may now be used by anyone as FREE SOFTWARE to
			develop any product, public-domain or commercial, without
			payment to ISE, under the terms of the ISE Free Eiffel Library
			License (IFELL) at http://eiffel.com/products/base/license.html.
	]"
	source: "[
			Interactive Software Engineering Inc.
			ISE Building
			360 Storke Road, Goleta, CA 93117 USA
			Telephone 805-685-1006, Fax 805-685-6869
			Electronic mail <info@eiffel.com>
			Customer support http://support.eiffel.com
	]"
	info: "[
			For latest info see award-winning pages: http://eiffel.com
	]"
end -- FUNCTION