Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.functional > #443
| Path | csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!news.szaf.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail |
|---|---|
| From | "Pascal J. Bourguignon" <pjb@informatimago.com> |
| Newsgroups | comp.lang.functional, comp.lang.lisp, comp.lang.scheme, comp.programming, comp.emacs |
| Subject | Re: Associativity paradox in functional expressions |
| Date | Sat, 03 Nov 2012 04:14:04 +0100 |
| Organization | Informatimago |
| Lines | 55 |
| Message-ID | <87liejml8j.fsf@informatimago.com> (permalink) |
| References | <8120f97b-15c2-4ce8-827a-158e955fb73f@z2g2000yqj.googlegroups.com> <9972e570-2504-4401-8de8-49eb1929fdfd@c17g2000yqe.googlegroups.com> <87pq3wqftc.fsf@voyager.informatimago.com> <3dd68e98-9889-4287-a352-3c7c25a3284e@d17g2000vbv.googlegroups.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=utf-8 |
| Content-Transfer-Encoding | 8bit |
| X-Trace | individual.net 1xEhI1US22ncfrIj+6Y0iQZ0Qa90WTCM6gnmR9D19XSuQZBVJlTqtRDCcVS/NGIi/n |
| Cancel-Lock | sha1:MTYxMTA0ZDUwMDg3YjUwNzdlNzE1YWE3M2IxNDFmNDhlN2NkY2FlNQ== sha1:TUIjbUBn7/cExzJb4WNxPMjSZwE= |
| Face | iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9 033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR mV+hO/VvFAAAAABJRU5ErkJggg== |
| X-Accept-Language | fr, es, en |
| User-Agent | Gnus/5.13 (Gnus v5.13) Emacs/23.4 (darwin) |
| Xref | csiph.com comp.lang.functional:443 comp.lang.lisp:11896 comp.lang.scheme:1121 comp.programming:2443 comp.emacs:1611 |
Cross-posted to 5 groups.
Show key headers only | View raw
Rivka Miller <rivkaumiller@gmail.com> writes: > On Nov 2, 6:45 am, "Pascal J. Bourguignon" <p...@informatimago.com> > wrote: >> Totaram Sanadhya <swami.totaram.sanad...@gmail.com> writes: >> > Hi, >> >> > My main functional language is emacs based lisp. >> >> > I am not exactly clear about the associativity. >> >> > On the one hand the elements of a list such as (a b c d) are right >> > associative >> >> > (cons 'a (cons 'b (cons 'c (cons 'd nil)))) C-x C-e >> >> > ==> (a b c d) >> >> > On the other hand a curried function such as (f x y z) is left >> > associative by definition >> >> > (...(f x) y) z) >> >> > How do you resolve this paradox? >> >> By defining a left-associative function. >> >> (defun lons (prefix item) >> (append prefix (list item))) >> >> (lons (lons (lons (lons nil 'a) 'b) 'c) 'd) >> --> (a b c d) >> >> (lons (lons (lons '(f) 'x) 'y) 'z) >> --> (f x y z) > > @Pascal > > I did not get what you achieved by defining a left-associative > function. Your sentence did not clarify your thought. I dont see where > is currying achieved. Currying is not achieved, there's no currying in lisp, lisp has multi-adic and variadic functions. Currying is a notion that is only needed when you have function taking only one argument. Now, you may write a macro that implements some currying. In such a macro, you would use lons instead of cons… -- __Pascal Bourguignon__ http://www.informatimago.com
Back to comp.lang.functional | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Associativity paradox in functional expressions Totaram Sanadhya <swami.totaram.sanadhya@gmail.com> - 2012-10-30 16:40 -0700
Re: Associativity paradox in functional expressions Totaram Sanadhya <swami.totaram.sanadhya@gmail.com> - 2012-10-31 00:24 -0700
Re: Associativity paradox in functional expressions Barb Knox <see@sig.below> - 2012-10-31 21:14 +1300
Re: Associativity paradox in functional expressions Totaram Sanadhya <swami.totaram.sanadhya@gmail.com> - 2012-10-31 10:34 -0700
Re: Associativity paradox in functional expressions Dirk Thierbach <dthierbach@usenet.arcornews.de> - 2012-10-31 23:36 +0100
Re: Associativity paradox in functional expressions "WJ" <w_a_x_man@yahoo.com> - 2012-10-31 23:27 +0000
Re: Associativity paradox in functional expressions Barb Knox <see@sig.below> - 2012-11-01 16:51 +1300
Re: Associativity paradox in functional expressions Nils M Holm <news2009@t3x.org> - 2012-10-31 09:21 +0000
Re: Associativity paradox in functional expressions "Pascal J. Bourguignon" <pjb@informatimago.com> - 2012-11-02 14:45 +0100
Re: Associativity paradox in functional expressions Rivka Miller <rivkaumiller@gmail.com> - 2012-11-02 18:59 -0700
Re: Associativity paradox in functional expressions "Pascal J. Bourguignon" <pjb@informatimago.com> - 2012-11-03 04:14 +0100
Re: Associativity paradox in functional expressions Rivka Miller <rivkaumiller@gmail.com> - 2012-11-05 16:53 -0800
Re: Associativity paradox in functional expressions "Pascal J. Bourguignon" <pjb@informatimago.com> - 2012-11-06 07:28 +0100
Re: Associativity paradox in functional expressions Barb Knox <see@sig.below> - 2012-11-08 17:35 +1300
Re: Associativity paradox in functional expressions Aatu Koskensilta <aatu.koskensilta@uta.fi> - 2012-11-08 07:42 +0200
Re: Associativity paradox in functional expressions "Pascal J. Bourguignon" <pjb@informatimago.com> - 2012-11-08 21:47 +0100
Re: Associativity paradox in functional expressions Barb Knox <see@sig.below> - 2012-11-10 15:13 +1300
csiph-web