[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] nested definitions
From: |
Mario Domenech Goulart |
Subject: |
Re: [Chicken-users] nested definitions |
Date: |
Wed, 05 Sep 2012 17:07:27 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1.91 (gnu/linux) |
Hi Andy,
On Wed, 5 Sep 2012 14:12:31 -0700 Andy Coolware <address@hidden> wrote:
> This is my first post here. I am interested in FP in general, Clojure
> and Scala in specific. But reaching to roots as Scheme as well from
> time.
Welcome!
> So I git stuck with a question inspired by "Structure and
> Interpretation" http://www.youtube.com/watch?v=2Op3QLzMgSY at almost
> end of the video @ 1:11:11 .
>
> So in Scheme we apparently can do such a definition:
>
>> (define ((A)) 1)
> #<void>
>> A
> #<procedure:A>
>> (A)
> #<procedure>
>> ((A))
> 1
>
> For my taste, a lot of happen here besides defining A. Scheme somehow
> is able to "figure out" and destruct A from ((A)) in order to make it
> possible. Interestingly enough:
>
> http://schemers.org/Documents/Standards/R5RS/HTML/r5rs-Z-H-8.html#%_sec_5.2
> does not seem to cover that case.
>
> So my question is, what really happens here?
That's a syntactic sugar for curried definitions:
http://wiki.call-cc.org/man/4/Extensions%20to%20the%20standard#curried-definitions
Best wishes.
Mario
--
http://parenteses.org/mario