Re: P3 Questions


[ Follow Ups ] [ Post Followup ] [ Discussion Board ] [ FAQ ]

Posted by N V Krishna on February 13, 2004 at 23:01:19:

In Reply to: P3 Questions posted by Steve on February 12, 2004 at 18:59:16:

: The grammar for P3 allows more then one argument to lambda expressions.
: How is that type represented? (t1, t2, t3) -> t4 ?

Just omit the comma's:

(t1 t2 t3) -> t4


: The homework description says: "types are generated from the grammar: t
: ::= t -> t | int | boolean | a where a ranges over a set of type
: variables" Does this mean that if we end up with a completely generic
: type, we should call it a, b, c, ... ?

There is no preferred symbol. Use any identifier of your choice.

: What about ()'s in the result? I presume you want the minimum that will make the expression correct ?

Any number of extra paranthesis is not a problem.

: What is the type of (if x #t 5) ?

Program does not type check.

: What is the type of (set! x 5) ? (my scheme interrpreter returns undefined)

int

Warm regards,
Krishna.


Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ Discussion Board ] [ FAQ ]