Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Assignment 1 Marking

2 views
Skip to first unread message

Anthony Cox

unread,
Feb 11, 1998, 3:00:00 AM2/11/98
to

If anyone was wondering, the marks for assignment one were assigned
as follows:

Question 1. 18 Marks
4 definition of reduce
2 each for parts a-d
3 each for parts e-f (forall and append)

Question 2. 32 Marks
10 Testing
The amount of testing you did indicated the completeness of your
assignment.
8 Style, clarity, conciseness and brevity, language usage etc.
14 Functionality
Broken down into:
4 Determination of free variables
4 alpha-substitution and related issues
6 beta-reduction and evaluation


Some general comments:

Question 1.
The function + is the same as (lambda (x y) (+ x y)). There is no need to
wrap it with a lambda abstraction, it already is a function!
There is no need for an expression (if (< x y) x y). All scheme implementations
have the function (min x y) which returns the minimum of x and y.

Question 2.
You had to demonstrate that your interpreter handled the Y combinator to get
32/32.

Also, this is an upper year course which is supposed to expand your minds, not
a lower level course on the fundamentals of programming. I really don't care
if you test the user interface, check for mis-formed input etc. Your test cases
should be selected to "show-off" your program. I would rather see a small set
of well thought out tests which fully exercise your program, than dozens of
tests, with each one testing one specific feature. Also, you don't have to
go to the extreme on documentation. If you write a function such as
(define (sum x y) (+ x y)) I don't expect you to document the fact that it
takes two input parameters called x and y and adds them! Stick with commenting
about algorithmic issues, explaining complicated sections of code etc. This
doesn't mean you don't have to document, just keep it reasonable.

Anthony Cox


Christoph

unread,
Feb 13, 1998, 3:00:00 AM2/13/98
to


I still don't really understand #1:

After class on Thursday we have been told, that every operation on the set
(newset, union,...) should yield an internal mknext function which yields
an internal next function.

i.e. this internal mknext function should have type unit -> unit ->'a.

if so, then how is it possible that (in the given Example) "seq1();"
yields 10? Shouldn't it be of type unit -> 'a ?

Christoph

-----------------
Christoph Mangold cmma...@picard.math.waterloo.edu


Caroline Kierstead

unread,
Feb 14, 1998, 3:00:00 AM2/14/98
to

On Fri, 13 Feb 1998 22:29:28 GMT, Christoph
<cmma...@markov.math.uwaterloo.ca> wrote:

>I still don't really understand #1:
>
>After class on Thursday we have been told, that every operation on the set
>(newset, union,...) should yield an internal mknext function which yields
>an internal next function.
>
>i.e. this internal mknext function should have type unit -> unit ->'a.
>
>if so, then how is it possible that (in the given Example) "seq1();"
>yields 10? Shouldn't it be of type unit -> 'a ?
>

This part I think I've finally gotten straight. It's actually your set
that is of type unit->unit->'a. So mknext on it actually yields
unit->'a, so when you apply your sequence, it yields 'a.

Gordon V. Cormack

unread,
Feb 14, 1998, 3:00:00 AM2/14/98
to

In article <Pine.SOL.3.95q.98021...@markov.math.uwaterloo.ca>,

Christoph <cmma...@markov.math.uwaterloo.ca> wrote:
>
>
>I still don't really understand #1:
>
>After class on Thursday we have been told, that every operation on the set
>(newset, union,...) should yield an internal mknext function which yields
>an internal next function.
>
>i.e. this internal mknext function should have type unit -> unit ->'a.
>
>if so, then how is it possible that (in the given Example) "seq1();"
>yields 10? Shouldn't it be of type unit -> 'a ?
>
>Christoph
>
>-----------------
>Christoph Mangold cmma...@picard.math.waterloo.edu
>
>
>

No. mkset returns seq1, which is of type unit->int, so seq1() is of
type int.
--
Gordon V. Cormack CS Dept, University of Waterloo, Canada N2L 3G1
gvco...@uwaterloo.ca http://cormack.uwaterloo.ca/cormack

Chris Palmer

unread,
Feb 15, 1998, 3:00:00 AM2/15/98
to

Gordon V. Cormack <gvco...@plg.uwaterloo.ca> wrote:
>Christoph <cmma...@markov.math.uwaterloo.ca> wrote:
>>I still don't really understand #1:
>>
>>After class on Thursday we have been told, that every operation on the set
>>(newset, union,...) should yield an internal mknext function which yields
>>an internal next function.
>>
>>i.e. this internal mknext function should have type unit -> unit ->'a.
>>
>>if so, then how is it possible that (in the given Example) "seq1();"
>>yields 10? Shouldn't it be of type unit -> 'a ?
>
>No. mkset returns seq1, which is of type unit->int, so seq1() is of
^^^^^
>type int.

Presumably, that should be mknext.

Cheers,
Chris.

--
Mail: crpa...@undergrad.uwaterloo.ca
Homepage: http://www.undergrad.math.uwaterloo.ca/~crpalmer/

0 new messages