Re: 3.20.2 Function application

2 views
Skip to first unread message

Jay McCarthy

unread,
Dec 2, 2010, 10:17:42 AM12/2/10
to Karen Downs, BYU CS 330 Fall 2010
On Thu, Dec 2, 2010 at 7:58 AM, Karen Downs <karen...@gmail.com> wrote:
> Jay,
> I didn't know if this was too specific for the mailing list.  I have labeled
> the sub-expressions with An.
> A4{fun {f : B1}  : B2
>    A5{fun {x : B3}  : B4
>      A6{fun {y : B5}  : B6
>          A1{cons x  A2{f  A3{f y}}}}}}
> Would A4, A5, and A6 be unnecessary because they are the same as the return
> types of the functions they label: B2, B4, and B6 respectively?

No, A4 is the label of the actual function. Its type is B1->B2

> Wouldn't this work it's way up with the body expressions and B2 would have
> the same type as it's body expression which is B4 which in turn would have
> the type of it's body expression which is B6 etc.?
> B2 = B4 = B6 = A1

Not exactly. A1 = B6, A6 = B4, etc but there is no relation between B6 and B4.

> Am I correct in thinking that none of these are function applications, just
> a nested function?

None of those are applications.

> Am I correct in thinking that these will all evaluate to [x] and list([x])?

Some will eval to list([x])

>  I know we have to work it out with a long list of rules but I would like to
> understand what we're working towards a little better first.

np

Jay

> Karen
>

--
Jay McCarthy <j...@cs.byu.edu>
Assistant Professor / Brigham Young University
http://faculty.cs.byu.edu/~jay

"The glory of God is Intelligence" - D&C 93

Reply all
Reply to author
Forward
0 new messages