id tests for typei

10 views
Skip to first unread message

Nathan Wonnacott

unread,
Dec 8, 2011, 7:49:48 PM12/8/11
to byu-cs-330...@googlegroups.com
Jay

In parse, generate constraints, and infer type, we have to show a test
case with a valid id expression.
For parse that's simple (parse 'x) should be (id 'x). But for generate
constraints and infer type it seems to me that they should crash
unless there is a with involved as well but I just wanted to make sure
that that was correct.
I could imagine that if you did (generate constraints 'start (parse
'x)) it could give you something like (list (eqc (t-var 'x1) (t-var
'x1))) but mine doesn't because it calls alpha-vary first and
alpha-vary throws an error when there is an unbound identifier.
infer-type will have the same problem.
So my question is, should generate-contsraints and infer-type throw
errors when they are just given (parse 'x)?

Nathan

Jay McCarthy

unread,
Dec 8, 2011, 8:31:10 PM12/8/11
to byu-cs-330...@googlegroups.com
On Thu, Dec 8, 2011 at 5:49 PM, Nathan Wonnacott <nathanw...@gmail.com> wrote:
Jay

In parse, generate constraints, and infer type, we have to show a test
case with a valid id expression.
For parse that's simple (parse 'x) should be (id 'x). But for generate
constraints and infer type it seems to me that they should crash
unless there is a with involved as well but I just wanted to make sure
that that was correct.
I could imagine that if you did (generate constraints 'start (parse
'x)) it could give you something like (list (eqc (t-var 'x1) (t-var
'x1)))

Something like that, but it would involve (t-var 'start)
 
but mine doesn't because it calls alpha-vary first and
alpha-vary throws an error when there is an unbound identifier.
infer-type will have the same problem.
So my question is, should generate-contsraints and infer-type throw
errors when they are just given (parse 'x)?

Infer-type should. Generate-constraints should not call alpha-vary.

You should have a successful id infer-type test that involves with, though

Jay
 

Nathan



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