Talk:First-class function: Difference between revisions

Content deleted Content added
Line 19:
I agree here. Maybe a mention of the eval() statement (or equivalents) would help to make the difference more obvious? --[[User:80.135.123.126|80.135.123.126]] 16:22, 26 January 2007 (UTC)
 
I think that the definition as given here isn't really accurate. As far as I understand the term, the point is just that there is no difference between a function and a data type in the things you can do. This implies that you can assign local variables to functions, and then call those local variables in exactly the same way as you'd call a function. It implies that you can pass functions as arguments to other functions. Creating a function at runtime seems to me to be a completely different thing. In particular, you can achieve similar effects in every language I know of - even if you have to compile the code yourself into memory. I don't think that passing a function pointer around as in c, or wrapping the code in an inner class (java) or a Proc (ruby) qualifies as first-class functions. The point is that they are 'first-class' - that they don't need special treatment. [[User:88.96.214.6|88.96.214.6]] 10:25, 22 March 2007 (UTC)
 
== Does Ruby really have first class functions? ==