exercise 1 and 2

0 views
Skip to first unread message

Justin Olsen

unread,
Jun 13, 2011, 7:18:52 PM6/13/11
to byu-cs-jm-14...@googlegroups.com
what is the difference between exercise 1 and 2?

Jay McCarthy

unread,
Jun 13, 2011, 7:21:30 PM6/13/11
to byu-cs-jm-14...@googlegroups.com, byu-cs-jm-14...@googlegroups.com
Whether you get a new array

iPhoneから送信

Diego (TA)

unread,
Jun 13, 2011, 7:22:13 PM6/13/11
to byu-cs-jm-14...@googlegroups.com, byu-cs-jm-14...@googlegroups.com
The second one uses mutation, the first one doesn't.

Justin Olsen

unread,
Jun 13, 2011, 7:25:09 PM6/13/11
to byu-cs-jm-14...@googlegroups.com
think you could give me an example of what each function should do?

Justin Olsen

unread,
Jun 13, 2011, 7:30:13 PM6/13/11
to byu-cs-jm-14...@googlegroups.com
im just trying to understand what the question wants as far as what is the difference between modifying the array and modifying just the Posn's in the array

Jay McCarthy

unread,
Jun 13, 2011, 7:30:24 PM6/13/11
to byu-cs-jm-14...@googlegroups.com, byu-cs-jm-14...@googlegroups.com
Actually whether you get new posns

iPhoneから送信

On 2011/06/13, at 18:18, Justin Olsen <jolse...@gmail.com> wrote:

Jay McCarthy

unread,
Jun 13, 2011, 7:30:40 PM6/13/11
to byu-cs-jm-14...@googlegroups.com, byu-cs-jm-14...@googlegroups.com
Not true

iPhoneから送信

Jay McCarthy

unread,
Jun 13, 2011, 7:31:17 PM6/13/11
to byu-cs-jm-14...@googlegroups.com, byu-cs-jm-14...@googlegroups.com
You can observe changes to the posns from outside

iPhoneから送信

Melissa W

unread,
Jun 14, 2011, 2:00:45 PM6/14/11
to BYU CS 142 (Spring 2011) [McCarthy]
I'm sorry, but these explanations make no sense. Does number 1 want
you to just modify the array without bothering to make new Posns? And
does number 2 want you to actually put "new Posn" in for each
position? It would really help to have the purpose of each outlined in
contrast with each other.

On Jun 13, 5:31 pm, Jay McCarthy <jay.mccar...@gmail.com> wrote:
> You can observe changes to the posns from outside
>
> iPhoneから送信
>
> On 2011/06/13, at 18:30, Justin Olsen <jolsen1...@gmail.com> wrote:
>
> > im just trying to understand what the question wants as far as what is the difference between modifying the array and modifying just the Posn's in the array
>
> > On Mon, Jun 13, 2011 at 5:25 PM, Justin Olsen <jolsen1...@gmail.com> wrote:
> > think you could give me an example of what each function should do?
>

Jay McCarthy

unread,
Jun 14, 2011, 2:41:47 PM6/14/11
to byu-cs-jm-14...@googlegroups.com, BYU CS 142 (Spring 2011) [McCarthy]
1 has new posns in the same array

2 has the same posns, modified, in the same array

iPhoneから送信

Isaac Ellsworth

unread,
Jun 14, 2011, 10:09:54 PM6/14/11
to BYU CS 142 (Spring 2011) [McCarthy]
what are the contracts?

On Jun 14, 12:41 pm, Jay McCarthy <jay.mccar...@gmail.com> wrote:
> 1 has new posns in the same array
>
> 2 has the same posns, modified, in the same array
>
> iPhoneから送信
>

Jay McCarthy

unread,
Jun 14, 2011, 10:11:28 PM6/14/11
to byu-cs-jm-14...@googlegroups.com
translateAll : Posn[] double double -> void

translateAllNoNew : Posn[] double double -> void

Jay

2011年6月15日2:09 Isaac Ellsworth <aust.l...@gmail.com>:

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