Disagree Side-effects are not the crux of the matter; flow of control is 

Forum: U Chicago, Com Sci 221, autumn 2000
Re: News Final exam Monday 4 December (Mike O'Donnell)
Re: None ML Pattern Matching Review (Oliver Rothschild)
Re: Question Possible solution (Oliver Rothschild)
Date: 2000, Dec 03
From: Mike O'Donnell <odonnell@cs.uchicago.edu>

No, functions with side-effects, such as ++ in C, are not the key here. Side-effects might behave differently between the built-in conditional and the user-defined conditional, but that's not the crux of the problem. There is a big difference even in purely functional programs.

I'd like people to figure this one out, so I'm not going to post a complete solution. Think about the special purpose for which conditional forms were included in programming languages. They are used to select values, but they are also used to determine flow of control, and that use is at least as important as the first. My user-defined conditional has the same impact on choosing values as the built-in, but a different impact on flow of control. If you see that difference clearly, you can demonstrate it with extremely simple, purely functional program components for the x and y to make cond x y z behave differently from cond (x z) (y z).

This is a good problem to continue to study.



Mike O'D.


Messages

1. More Try it out with the ML interpreter by Mike O'Donnell, 2000, Dec 03

to: "Side-effects are not the crux of the matter; flow of control is"