Talk:Function composition: Difference between revisions

Please keep C.
m (lf)
(Please keep C.)
Line 14:
 
:::Hm, I was thinking about other (not portable...) methods; I will try... ;) --[[User:ShinTakezou|ShinTakezou]] 22:15, 4 March 2009 (UTC)
 
::: Spoon! I think you beated me:D At the beginning I was following a method similar to yours (except that I called ''function capsule'' something similar to what you called functor). But I was dissatisfied since this works only for function with double arg and returning double; I was thinking about a way of composing functions not dependently by the type of the value passed/returned, I thought to ''encapsulate'' the function in a function (!) which wants void * as input and ret value, and then it can be "dereferenced" and casted properly by the programmer (and a macro facility)... I was experimenting different methods (also using inline assembly:D) ... at the moment, failing:(... so I calm down unless your solution is marked as not ok for the task :D. Interesting. --[[User:ShinTakezou|ShinTakezou]] 23:26, 4 March 2009 (UTC)
 
Spoon, Shintakezou; I think the C solution should stay, as it does show the kind of hoops you would have to go through to implement this task in C. It also helps to explain the second paragraph in [[wp:/First-class_function#Availability|]], on why they don't normally include C in the list of FP languages and mention the limitations of function pointers. --[[User:Paddy3118|Paddy3118]] 23:53, 4 March 2009 (UTC)
Anonymous user