Talk:Partial function application: Difference between revisions

variations of explicit curry
(→‎Explicit curry vs Partial application: More on distinguishing partial plain curry.)
(variations of explicit curry)
Line 34:
:: Is it the case that there is no real distinction in Lisp, but a significant distinction in other languages?
::What about the other feature I seem to see in partial application: that of not needing to refer explicitely to the other arguments of the function being partially applied? E.g. with function f(a,b,c,d); you can partial(f, a=value1) to produce f'(b,c,d) without mention of b, c, and d when ''calling'' partial. --[[User:Paddy3118|Paddy3118]] 06:29, 1 April 2011 (UTC)
 
::: First considering the feature of not referring to other arguments, I would expect this to be possible in most languages with dynamic types, but not possible in languages with static type checking. Kernigh's <tt>partial</tt> handles this just fine using apply, for example. [http://www.engr.uconn.edu/~jeffm/Papers/curry.html This document] I found calls it generalized explicit currying and gives example code in Scheme. In Go, with it's static type checking, I can write a <tt>partial</tt> that does explicit currying for functions with specific type signatures, but I can't write a <tt>partial</tt> that does ''generalized'' explicit currying for functions with arbitrary type signatures.
 
:::Which leads back to the first question of the distinction between <tt>(partial #'mapcar #'f1)</tt> and <tt>(lambda (s) (mapcar #'f1 s))</tt>. There are two distinctions! Function/lambda expression and generalized/specific. (And they are orthogonal: You could write a specific function or a generalized lambda expression.) Anyway, there seems little point in either a function or generality in the case of this task as currently written. You could just write <tt>fsf1 = lambda s: fs(f1, s)</tt> in Python, for example.
 
:::As far as changes to the task, I think it's fine the way it is. &mdash;[[User:Sonia|Sonia]] 06:28, 13 April 2011 (UTC)
1,707

edits