<pattern>
is there a clearer way to write that in ocaml?
<pattern>
or is that as clear as it gets?
<pattern>
because it's not clear... and there are no comments
<steele>
=) IMHO the only important thing is the deriv function and that is pretty clear to me
<pattern>
and the 'f' and 'x' variables don't seem to have been chosen for clarity
<pattern>
variable names, i mean
<pattern>
i guess it's just me, then
<steele>
you get used to it
lament has joined #ocaml
<pattern>
i have another question, then
<pattern>
he follows this example up with the note: "Remember, the arrow associates to the right, so another way to write the type is (float -> float) -> (float -> float). That is, the derivative is a function that takes a function as an argument, and returns a function.
<pattern>
he's referring to this line: val deriv : (float -> float) -> float -> float = <fun>
<pattern>
now, what in that says that it's a function?
<pattern>
is it the parenthesis?
<pattern>
i mean, what it's a function that takes a function as an argument and returns a function
<steele>
the first parenthesis is needed
TachYon has quit ["Client Exiting"]
<phubuh>
the arrow operator makes it a function definition
<steele>
eg it takes a function
<pattern>
i see
<steele>
the second is implicit because of right associativity
<pattern>
it's the arrow operator that says it's a function... and the fact that it takes a function as an argument is inferred from what?
<phubuh>
(t1 -> t2) is a function
<phubuh>
or rather, is the type of a function
<pattern>
yes, i see that the right associativity makes you put parenthesis around the float -> float
<pattern>
oh, ok
<pattern>
i was somehow missing the -> inside the parenthsis :)
<pattern>
selective blindness :)
<pattern>
now it makes utterly clear sense
<pattern>
clearer than clear... thank you!
<pattern>
i guess those are the kinds of things that need to be spelled out and repeated for an utter novice: "remember the arrows mean 'function'... see, there are three of them? the first means the argument is a function, and the second means the whole statement is a function, and the third means the result is a function"
<pattern>
:)
<pattern>
i'm still havning a problem wrapping my mind around the deep recursion, though
<pattern>
i'm too used to plain iteration
<pattern>
i can understand how recursion works if i sit down and work out what happens in the function, step by step, for certain given values... but how i would ever think of writing such a function is beyond me, at this point
<pattern>
do any of you know of a text that explores the why's and wherefores of recursion in a clear manner?
<mellum>
"Structure and Interpretation of Computer Programs" by Abelson, Sussman and Sussman
<pattern>
cool, thank you, mellum
<phubuh>
it's available for free, search for sicp on google
<Zadeh>
There's a free online version if you don't mind reading on the computer
<steele>
there is something about recursive vs iterative in the ocaml book:
<lament>
note that when reading SICP you will also learn Scheme as a side-effect
<pattern>
i've heard good things about scheme
<lament>
For a reason.
<lament>
SICP is not a scheme book, but it uses scheme for the examples
<cm>
SICP gonna ship tomorrow :)
<cm>
i read parts of the online version, but i prefer the book version for reading
<lament>
heh
<cm>
plus it looks cool in the shelf :P
<pattern>
me too.. but i can't splurge $70 on yet another computer book
<lament>
SICP is one of the few books i'd like to have in dead-tree
<pattern>
maybe i can get it used, though... i'll put it on my half.com wish list for $10 :)
<pattern>
hey, a 1985 edition is available on half.com for $8.95
<pattern>
great :)
<cm>
:)
<pattern>
is there a big difference between the '85 and '96 editions?
<pattern>
heh... i just found the "Skeptical Software Engineering Bibliography"
mattam has joined #ocaml
__mattam__ has quit [Read error: 54 (Connection reset by peer)]
<pattern>
"Software engineering (SE) has probably largest concentration of snake oil salesmen. Even object-oriented design cannot compete with SE ;-). Such "dynamic" figures as Yourdon, Ben Shneiderman and partially Gerard Weinberg (at least the latter authored one interesting book and a couple of decent tutorials on PL/1), could probably compete with any woman fashion designer :-). These guys are really can change their own position twice a week, as t
<pattern>
sense that something new becomes fashionable."