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

Assignment 2, problem 2...

1 view
Skip to first unread message

Carl Laurence Gonsalves

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

I'm not really sure what is meant in problem 2 by "This will involve
modifying any functions that maintain state information so that they yield
a structure containing that state."

First, does this refer to the structures that we learned about in class
today, or does it just mean "some sort of data structure".

Second, we're also supposed to change the said functions so that they
actually take the (returned) state as a parameter, right? I guess we also
have to define what "initial" state information the user should provide?

Oh, and just a general question about the assignment: should we bother with
protecting our functions from forgery?

--
Carl Laurence Gonsalves | "Any sufficiently advanced text editor is
clgo...@kami.com | indistinguishable from VIM."
|
http://www.undergrad.math.uwaterloo.ca/~clgonsal/

Gordon V. Cormack

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

In article <Eo6ru...@undergrad.math.uwaterloo.ca>,

Carl Laurence Gonsalves <clgo...@undergrad.math.uwaterloo.ca> wrote:
>I'm not really sure what is meant in problem 2 by "This will involve
>modifying any functions that maintain state information so that they yield
>a structure containing that state."

All I'm trying to say is that in Q1, the function has to have side-effects
to be any use. For Q2, side-effects are forbidden, so you'll have to
modify the specification for the function so use parameters/results
instead of side-effects.

>First, does this refer to the structures that we learned about in class
>today, or does it just mean "some sort of data structure".

Any sort of data structure is OK so long as it is "pure" That is, there
should be no use of ref.

>Second, we're also supposed to change the said functions so that they
>actually take the (returned) state as a parameter, right? I guess we also
>have to define what "initial" state information the user should provide?

Yup.

>Oh, and just a general question about the assignment: should we bother with
>protecting our functions from forgery?

This was not a requirement in the assignment (should have been, I suppose).
So I think it would be good for your soul to use information hiding, but
I will not require it.

> Carl Laurence Gonsalves | "Any sufficiently advanced text editor is
> clgo...@kami.com | indistinguishable from VIM."
> |
> http://www.undergrad.math.uwaterloo.ca/~clgonsal/


--
Gordon V. Cormack CS Dept, University of Waterloo, Canada N2L 3G1
gvco...@uwaterloo.ca http://cormack.uwaterloo.ca/cormack

0 new messages