That statement of mine was confusing because if you type each you'll get different things. The equivalence of (define (foo) bar) === (define foo (lambda() bar)) won't hold there: you'd be defining procedure A in the second case.
If the first argument is in parens, (define) will be a function definition, and the first symbol in the parens will be the prodecure name. Thus with (define ((A)) body) you're really are defining a procedure named "(A)". In Chicken: #;3> A #<procedure (A)> to my surprise, actually. I was expecting A to be not defined, and (A) to be procedure (A) but: #;4> (A) #<procedure (?)> go figure. My best guess is that the procedure's name is "(A)" and up to this point we're just typing its name, not applying proc A, whereas with ((A)) we're then calling function (A), but I don't really have more insight into the implementation, I'm just following the usage of (define). On Thursday, August 30, 2012 4:35:22 PM UTC-7, Andy C wrote: > > Let's focus on that for a sec: > > (define ((A)) 1) is the same as (define (A) (lambda () 1));; > defines procedure "(A)" > > I wonder if you meant >>defines procedure "((A))"<< instead. > > Assuming that, if "((A))" is just a name of the procedure, then > > "A" and "(A)". Should not evaluate at all. Apparently above line > defines procedure "A" actually. > > > I know this is not that useful although very interesting in terms of > how it was implemented and how that (define ...) form interprets the > first argument. > > A. > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en