dark_light has quit [Remote closed the connection]
hikozae__ has joined #ocaml
hikozaemon has quit [Network is unreachable]
hikozaem_ has quit [Network is unreachable]
hikozaemon has joined #ocaml
hikozaem_ has joined #ocaml
hikoza___ has joined #ocaml
hikozae__ has quit [Connection timed out]
hikozaemon has quit [Connection timed out]
hikozaem_ has quit [Success]
Smerdyakov has quit ["Leaving"]
tristram has joined #ocaml
shawn has quit ["This computer has gone to sleep"]
ramkrsna has quit [calvino.freenode.net irc.freenode.net]
ramkrsna has joined #ocaml
sponge45 has quit ["zzzzzzzz"]
love-pingoo has joined #ocaml
mnemonic has joined #ocaml
revision17_ has joined #ocaml
Revision17 has quit [Read error: 110 (Connection timed out)]
smimou has joined #ocaml
dash has quit [Read error: 110 (Connection timed out)]
hikoza___ has quit ["Leaving..."]
magnus- has joined #ocaml
slipstream-- has joined #ocaml
ramkrsna has left #ocaml []
slipstream has quit [Read error: 110 (Connection timed out)]
asbeta has joined #ocaml
_laki_ has joined #ocaml
_laki_ has left #ocaml []
smimou has quit [Read error: 110 (Connection timed out)]
hcarty has joined #ocaml
smimou has joined #ocaml
descender is now known as _descender_
mnemonic has quit ["leaving"]
Smerdyakov has joined #ocaml
finelemo1 has joined #ocaml
magnus- has quit [Read error: 110 (Connection timed out)]
finelemon has quit [Read error: 113 (No route to host)]
finelemo1 has quit [Read error: 110 (Connection timed out)]
finelemon has joined #ocaml
slipstream has joined #ocaml
slipstream-- has quit [Connection timed out]
Aradorn has joined #ocaml
Aradorn has quit [Client Quit]
Aradorn has joined #ocaml
Aradorn has left #ocaml []
shekmalhen has joined #ocaml
<shekmalhen>
Just a quick question... is it possible to do like in python, to pass parameters to a function through a data structure (either a list or list of (string * ...) pair)?
<asbeta>
yes, if function expects that
<shekmalhen>
but there is no way to map the list to the arguments expected by the function
<asbeta>
you want to pass arguments to generic function (like ( + )) through a list?
<shekmalhen>
say, a function that takes three arguments
<shekmalhen>
and a list that contain three items
<shekmalhen>
I want to call the function with those arguments
<asbeta>
i don't see how can that be type-safe
<shekmalhen>
hmm
<shekmalhen>
yeah. I see
<dylan>
it could be with tuples.
<shekmalhen>
Well... I was just thinking about this while cooking spaggetti :)
<shekmalhen>
For function that take a fixed number of arguments, it is kindof useless
<dylan>
a function only takes one argument
<shekmalhen>
but, where I see that it can become interesting is when the function have named, optionnal parameters.
<shekmalhen>
hmm
<shekmalhen>
then I don't understand the trick
<shekmalhen>
:)
* shekmalhen
goes back to the books
<asbeta>
you can write function that takes list, parses it and calls underlying multi-argument function
<asbeta>
actually, this can be automated
<asbeta>
with camlp4 :)
<shekmalhen>
I was actually thinking about it :)
<asbeta>
and i seem to remember that someone made something like this
<shekmalhen>
dylan, can you elaborate on that? or maybe direct me to the right place about "function take only one argument"?
<shekmalhen>
'k
<asbeta>
however, in case of lists, you will have to declare some ADT to wrap different types
<asbeta>
because you can't make list like this: [("a", 3); ("b", "5")]
<shekmalhen>
'k
<shekmalhen>
yeah
<dylan>
let f a b c = ... is like let f = fun a -> fun b -> fun c -> ...
<dylan>
applying it, f a b c == (((f a) b) c)
<shekmalhen>
that's what I though, dylan
<shekmalhen>
well, thank you :) I'll think about this
smimou has quit [Read error: 110 (Connection timed out)]
smimou has joined #ocaml
shekmalhen has quit ["bêêêêêh"]
rillig has joined #ocaml
tristram has quit [Read error: 110 (Connection timed out)]
shawn has joined #ocaml
magnus- has joined #ocaml
hcarty has left #ocaml []
mwc has joined #ocaml
mwc has quit [Remote closed the connection]
shawn has left #ocaml []
smimou has quit [Read error: 60 (Operation timed out)]