Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Eiffel > Re: basic eiffe...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 3 Topic 834 of 913
Post > Topic >>

Re: basic eiffel question

by Georg Bauhaus <bauhaus@[EMAIL PROTECTED] > Nov 26, 2006 at 01:41 PM

On Sat, 2006-11-25 at 16:45 -0800, llothar wrote:
> nateastle@[EMAIL PROTECTED]
 schrieb:
> 
> > For school I am writting a paper on Eiffel. One of the sections of the
> > papers is about function support and parameter passing. The question
> > that I have is: in a feature is it possible to have another feature as
> > a parameter (like ml)?
> 
> Thats possible since ~2001 and called agent. Google for this keyword.
> They are not closures. They are function pointers, together with a
> pointer to the object and some saved parameters that are passed when
> called.

In other words, a closure, mostly. In particular, it is possible
to write curried functions that can be attached to global variables.
I think that saying "They are not closures" is not entirely adequate.

class
	TEST

feature

	adder(a: INTEGER): FUNCTION[TEST,TUPLE[INTEGER], INTEGER] is
			-- a function that adds `a' to its argument
		do
			Result := agent add2(a, ?)
		end
			
feature {TEST}

	add2(x, y: INTEGER): INTEGER is
			-- 
		do
			Result := x + y
		end
		
end




 3 Posts in Topic:
basic eiffel question
"nateastle@[EMAIL PR  2006-11-25 11:49:46 
Re: basic eiffel question
"llothar" <l  2006-11-25 16:45:40 
Re: basic eiffel question
Georg Bauhaus <bauhaus  2006-11-26 13:41:35 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat May 17 3:08:50 CDT 2008.