Re: What kind of Cons are we talking?

2 views
Skip to first unread message

Jay McCarthy

unread,
Nov 29, 2010, 9:43:59 PM11/29/10
to Samuel Stephens, BYU CS 330 Fall 2010
It is polymorphic. You'll have to decide what you think the constraint is.

Jay

On Mon, Nov 29, 2010 at 7:10 PM, Samuel Stephens <almo...@gmail.com> wrote:
> Jay:
>
> Is the cons in 3.20.2 polymorphic cons? Does this mean that its only
> constraint is that the type of the rest is List(type of first)?
>
> Samuel Stephens
> --"Your reputation is what others know about you.  Your honor is what
> you know about yourself."
> --Aral Vorkosigan
> from "Memory" by Lois McMaster Bujold
>

--
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

Joseph Heydorn

unread,
Nov 30, 2010, 6:38:00 PM11/30/10
to byu-cs-330-Fall-2010
Is this the cons from Racket? If not, I'm thinking that would mean we
must assume it is a function whose behavior is entirely unknown.

On Nov 29, 7:43 pm, Jay McCarthy <j...@cs.byu.edu> wrote:
> It is polymorphic. You'll have to decide what you think the constraint is.
>
> Jay
>
> On Mon, Nov 29, 2010 at 7:10 PM, Samuel Stephens <almoni...@gmail.com> wrote:
> > Jay:
>
> > Is the cons in 3.20.2 polymorphic cons? Does this mean that its only
> > constraint is that the type of the rest is List(type of first)?
>
> > Samuel Stephens
> > --"Your reputation is what others know about you.  Your honor is what
> > you know about yourself."
> > --Aral Vorkosigan
> > from "Memory" by Lois McMaster Bujold
>
> --
> Jay McCarthy <j...@cs.byu.edu>
> Assistant Professor / Brigham Young Universityhttp://faculty.cs.byu.edu/~jay

Jay McCarthy

unread,
Nov 30, 2010, 6:46:42 PM11/30/10
to byu-cs-330...@googlegroups.com, byu-cs-330-Fall-2010
Yes

Sent from my iPhone

Joseph Heydorn

unread,
Nov 30, 2010, 6:53:13 PM11/30/10
to byu-cs-330-Fall-2010
In Racket, a cons can accept as it's second argument a list of
multiple types. Is this true of this cons as well?

On Nov 30, 4:46 pm, Jay McCarthy <jay.mccar...@gmail.com> wrote:
> Yes
>
> Sent from my iPhone
>

Jay McCarthy

unread,
Nov 30, 2010, 6:55:04 PM11/30/10
to byu-cs-330...@googlegroups.com, byu-cs-330-Fall-2010
No, a particular list is always homogenous

Jay

Sent from my iPhone

Jonathan Wilson

unread,
Nov 30, 2010, 6:58:15 PM11/30/10
to byu-cs-330...@googlegroups.com
So this is homogenous? (racket doesn't throw any errors with it).

(cons true (cons (cons 'x empty) (cons 1 empty)))

Jay McCarthy

unread,
Nov 30, 2010, 7:06:56 PM11/30/10
to byu-cs-330...@googlegroups.com, byu-cs-330...@googlegroups.com
Your languages in the assignments are homogenous, Rackets are not

Sent from my iPhone
Reply all
Reply to author
Forward
0 new messages