[plt-scheme] Some fine distinctions

From: Eric Tanter (etanter at dcc.uchile.cl)
Date: Tue May 12 19:00:39 EDT 2009

Right, even though that is not so nice to have to write that at each  
use site. Or alternatively to export any possible order for users to  
use.

In a more general case, one could imagine something like:

(f ? 3 ? ? 5) to say " here are the 2nd and 5th parameters".

with partial evaluation, you can in principle annotate any parameter  
as known and have the function body partially evaluated accordingly.

-- Éric


On May 12, 2009, at 17:17 , Jos Koot wrote:

> Yes you can:
> ((lambda (y) (lambda (x) ((f x) y)))) actual-argument-for-y)
> Jos
>
> ----- Original Message ----- From: "Eric Tanter" <etanter at dcc.uchile.cl 
> >
> To: "wooks" <wookiz at hotmail.com>
> Cc: "PLT Scheme" <plt-scheme at list.cs.brown.edu>
> Sent: Tuesday, May 12, 2009 10:36 PM
> Subject: Re: [plt-scheme] Some fine distinctions
>
>
> plus, currying typically only works in a particular predefined order
> of the parameters.
>
> ie. if f has two formal arguments x and y, you can't give it y first.
>
> -- Éric
>
>
> On May 12, 2009, at 16:29 , Eric Tanter wrote:
>
>>> Individually I think I know what they are but I would have a tough
>>> time if asked to distinguish.
>>>
>>> Currying vs Partial evaluation.
>>
>> let me try my hands on this one:
>>
>> currying is just about the possibility to pass arguments to a   
>> function in separate steps. Ie. passing a parameter returns a  
>> function that waits for the other parameters.
>>
>> partial evaluation further implies that when you have a parameter   
>> that becomes known, you evaluate what you can of the resulting  
>> function.
>>
>> -- Éric_________________________________________________
>> For list-related administrative tasks:
>> http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
> _________________________________________________
> For list-related administrative tasks:
> http://list.cs.brown.edu/mailman/listinfo/plt-scheme



Posted on the users mailing list.