Re: Currying

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Currying

Attila Szegedi
On Mon, 07 Aug 2006 09:37:57 +0200, Daniel Dekany <[hidden email]>  
wrote:

> Also, it think this is cleaner:
>
>   <#set myModifiedMacro = myMacro?param_defaults(color=black)>
>
> than
>
>   <#set myModifiedMacro = myMacro(color=black)?delay>
>
> However, I'm not sure the above is possible with the current
> implementation.

Well, I'm certainly more comfortalbe with having it defined as

macroExp?operator(args)

instead of

macroExp(args)?operator

especially since by now I could implement the former, but don't think I  
could implement the latter easily. Also, the former also allows intuitive  
things like:

<#assign curriedMacroInGeneral=macro?curry/>
<#assign oneParticularCurrying=curriedMacroInGeneral(someArgs)/>
<#assign anotherParticularCurrying=curriedMacroInGeneral(someOtherArgs)/>

also, I was thinking about this in the past days, and I think that we  
could indeed use a name other than "curry", and I tend to side with Daniel  
in having a name explicitly saying these are additional defaults, i.e.  
"with_defaults" or "using_defaults". It probably won't be as often used as  
to cause problems with a bit more verbose name.

Attila.

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
FreeMarker-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-devel
Reply | Threaded
Open this post in threaded view
|

Re: Currying

Stephan Müller-2
Attila Szegedi wrote:
> [..]
> also, I was thinking about this in the past days, and I think that we  
> could indeed use a name other than "curry", and I tend to side with Daniel  
> in having a name explicitly saying these are additional defaults, i.e.  
> "with_defaults" or "using_defaults". It probably won't be as often used as  
> to cause problems with a bit more verbose name.

I have to agree. At the beginning I preferred the term "curry", because
this technique is inspired by the functional "currying" mechanism. But
since it seems that only a very small minority of developers (and
designers of HTML or the like) is aware of this term I think that we
should drop it in favor of something more descriptive. Personally I like
the name "with_defaults", but "using_defaults" is okay as well.


Stephan.


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
FreeMarker-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-devel
Reply | Threaded
Open this post in threaded view
|

Re: Currying

Randall R Schulz
Stephan,

On Thursday 17 August 2006 06:09, Stephan Müller wrote:

> Attila Szegedi wrote:
> > [..]
> > also, I was thinking about this in the past days, and I think that
> > we could indeed use a name other than "curry", and I tend to side
> > with Daniel in having a name explicitly saying these are additional
> > defaults, i.e. "with_defaults" or "using_defaults". It probably
> > won't be as often used as to cause problems with a bit more verbose
> > name.
>
> I have to agree. At the beginning I preferred the term "curry",
> because this technique is inspired by the functional "currying"
> mechanism. But since it seems that only a very small minority of
> developers (and designers of HTML or the like) is aware of this term
> I think that we should drop it in favor of something more
> descriptive. Personally I like the name "with_defaults", but
> "using_defaults" is okay as well.

That may be a necessary practical step, but I'd suggest including
a "principles of operation" section in the documentation (an appendix,
perhaps) that describes the theoretical underpinnings of the mechanism.
It might bring some of the more formal-minded, curious developers into
contact with something new. You never know who might be inspired to
write a language that would bridge us from today's error-prone
procedural languages to more well-founded functional or logical ones.


> Stephan.


Randall Schulz

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
FreeMarker-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-devel
Reply | Threaded
Open this post in threaded view
|

Re: Currying

Attila Szegedi
In reply to this post by Stephan Müller-2
I've renamed "curry" to "use_defaults".

Attila.

On Thu, 17 Aug 2006 15:09:54 +0200, Stephan Müller <[hidden email]>  
wrote:

>
> I have to agree. At the beginning I preferred the term "curry", because
> this technique is inspired by the functional "currying" mechanism. But
> since it seems that only a very small minority of developers (and
> designers of HTML or the like) is aware of this term I think that we
> should drop it in favor of something more descriptive. Personally I like
> the name "with_defaults", but "using_defaults" is okay as well.
>
>
> Stephan.
>

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
FreeMarker-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-devel