|
|
> Ah, right, so it's overloaded but that's not shown in the article?
Yup, it is in the source code however.
> (BTW, I thought printf() was only for C, not C++?)
Well it is for C, but anything you can do in C you can do in C++. Not that
it's a good idea though...
> Did the Haskell version look "readable"?
Not really, I tried to add some to your code to show what I meant with the
other evaluate function, but I couldn't work out what was going on!
> One of the nice things about Haskell is that you can't make that mistake.
> Since you never update anything in-place, you can't accidentally destroy a
> result you need to use again later, and by left wondering where this
> "wrong" data is coming from.
Seems logical, but without thinking about it too much, how would you keep
track of the state of the system while it's running? Are you basically
saying that variables are write-once in Haskell? SO I couldn't do something
like:
currentState = Integrate(currentState);
I would need to instead do:
frame++
state[frame] = Integrate( state[frame-1] )
Post a reply to this message
|
|