flux changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 4.00.1 http://bit.ly/UHeZyT | http://www.ocaml.org | Public logs at http://tunes.org/~nef/logs/ocaml/
contempt has quit [Quit: leaving]
skchrko has quit [Read error: Connection reset by peer]
anemator has joined #ocaml
shinnya has quit [Quit: ZNC - http://znc.in]
<anemator> is there a best practice for using begin...end over parens (and vice versa)?
contempt has joined #ocaml
csakatoku has joined #ocaml
ollehar has quit [Ping timeout: 264 seconds]
dsheets has quit [Ping timeout: 264 seconds]
ygrek has joined #ocaml
madroach has quit [Ping timeout: 264 seconds]
madroach has joined #ocaml
Drup has quit [Quit: Leaving.]
Drup has joined #ocaml
cdidd has quit [Remote host closed the connection]
cdidd has joined #ocaml
osa1 has quit [Ping timeout: 245 seconds]
ygrek has quit [Ping timeout: 261 seconds]
ollehar has joined #ocaml
introom has joined #ocaml
q66 has quit [Quit: Leaving]
csakatoku has quit [Remote host closed the connection]
anemator has quit [Quit: Page closed]
csakatoku has joined #ocaml
ygrek has joined #ocaml
ben_zen has joined #ocaml
Neros has quit [Read error: Operation timed out]
<davekong> Is there some way to make the compiler complain / give an error when a variable is shadowed?
<Drup> that's a very strange request in a functional language, you can find all warning here : http://caml.inria.fr/pub/docs/manual-ocaml/manual022.html#toc87, maybe the 13 is the one you want
<Drup> hum, I don't think so in fact.
ollehar has quit [Ping timeout: 264 seconds]
<davekong> I think shadowing is strange as it basically allows imperative style programming and means some variable can change value in a program
<davekong> an accidental naming conflict can turn into a bug
ggole has joined #ocaml
Drup has quit [Quit: Leaving.]
ggole has quit [Ping timeout: 245 seconds]
csakatoku has quit [Remote host closed the connection]
ben_zen has quit [Ping timeout: 256 seconds]
<whitequark> davekong: shadowing allows you to freely compose code though.
csakatoku has joined #ocaml
<davekong> whitequark: what do you mean?
ggole has joined #ocaml
<whitequark> if a block of code contains no free variables, you can lexically "paste" it into any context and its meaning won't change.
csakatoku has quit [Remote host closed the connection]
<ggole> That's not terribly common though: even + and - are 'variables' in OCaml
csakatoku has joined #ocaml
<whitequark> bad wording. "if a block of code contains a set of free variables S, and they always have the same type in the surrounding environment", etc, etc
<whitequark> same meaning :)
<ggole> Mmm.
introom has quit [Remote host closed the connection]
yacks has quit [Quit: Leaving]
<davekong> If you don't have shadowing, you can compose and re-order code without worry.
<davekong> The code won't compile if doing so would have caused an error
introom has joined #ocaml
vpm has quit [Ping timeout: 264 seconds]
troydm has quit [Ping timeout: 264 seconds]
manud has quit [Quit: manud]
<gasche> davekong: but you have dangerous friends
<gasche> the Coffeescript designers didn't like shadowing, so they forbid it and removed the "fresh variable" marker (let, var,...)
<gasche> which means that in they system you can never compose and re-order code without worry
<gasche> while in shadowing systems you can always safely compose closed code
<gasche> (as you only have to worry about variable capture)
<gasche> besides, warning on shadowing makes code maintenance more painful without automated tools
<gasche> so if you require automated tools
<gasche> you may as well allow shadowing and use those tools to detect shadowing situations when copy-pasting code
<adrien> morning
ulfdoz has joined #ocaml
vpm has joined #ocaml
ygrek has quit [Remote host closed the connection]
ygrek has joined #ocaml
<levi> That's what annoys me about all the silly minimalist syntax pseudo-functional languages.
<levi> They don't bother learning about the subtleties involved in variable scope and just make stupid arbitrary decisions.
ygrek has quit [Ping timeout: 268 seconds]
<ggole> Coffeescript has a construct for establishing a lexical variable binding, iirc
<ggole> do or something like that
madroach has quit [Quit: leaving]
walter has quit [Read error: Connection reset by peer]
csakatok_ has joined #ocaml
csakatoku has quit [Ping timeout: 264 seconds]
ulfdoz has quit [Read error: Operation timed out]
thomasga has joined #ocaml
madroach has joined #ocaml
zpe has joined #ocaml
<orbitz> CoffeeScript seems like it's full of fail
<levi> Well, it's not the fullest-of-fail thing I've every seen, but it's sad to see something close to nice be so flawed.
<levi> Coming up with a nice language syntax is not as easy as it might seem, though. :P
zpe has quit [Ping timeout: 256 seconds]
<orbitz> Yes it is, SML's syntax was already handed to us by God
<orbitz> The problem I see with CoffeeScript is this complete irrational fear of grouping symbols. If you don't support partial application I see no reason you should drop parens on a function call
thomasga has quit [Read error: Connection reset by peer]
thomasga1 has joined #ocaml
ttamttam has joined #ocaml
ygrek has joined #ocaml
tane has joined #ocaml
ivan\ has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
ivan\ has joined #ocaml
tane has quit [Remote host closed the connection]
tane has joined #ocaml
zpe has joined #ocaml
tane has quit [Remote host closed the connection]
tane has joined #ocaml
mika1 has joined #ocaml
cago has joined #ocaml
zpe has quit [Ping timeout: 245 seconds]
vpm has quit [Ping timeout: 264 seconds]
beckerb_ has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 261 seconds]
ohama has quit [Ping timeout: 264 seconds]
ohama has joined #ocaml
walter has joined #ocaml
vpm has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 268 seconds]
mcclurmc has quit [Quit: Leaving.]
jonludlam has quit [Remote host closed the connection]
zpe has joined #ocaml
rwmjones has joined #ocaml
zpe has quit [Ping timeout: 264 seconds]
mcclurmc has joined #ocaml
dsheets has joined #ocaml
zpe has joined #ocaml
ggole has quit [Ping timeout: 246 seconds]
q66 has joined #ocaml
ggole has joined #ocaml
ggole has quit [Ping timeout: 246 seconds]
mort___ has joined #ocaml
tane has quit [Quit: Verlassend]
beckerb_ has quit [Ping timeout: 245 seconds]
ggole has joined #ocaml
Xom has quit [Quit: ChatZilla 0.9.90.1 [Firefox 22.0/20130618035212]]
gautamc has quit [Read error: Connection reset by peer]
gautamc has joined #ocaml
skchrko has joined #ocaml
Drup has joined #ocaml
wwilly has joined #ocaml
<wwilly> bonjour
Neros has joined #ocaml
_andre has joined #ocaml
_andre has quit [Remote host closed the connection]
_andre has joined #ocaml
yezariaely has joined #ocaml
<yezariaely> is it possible to have types of higher kind in ocaml? (I know that I can use modules/functors to simulate that).
ygrek has quit [Ping timeout: 264 seconds]
<rixed> yezariaely: what are types of higher kind, exactly?
<yezariaely> a function from a type to a type.
<yezariaely> e.g. type test 'a = 'a int
<yezariaely> here, 'a is a function, because it is applied to an int.
<rixed> what about a function from set of types to a set of types?
<ggole> No, modules are the solution for that
<rixed> a module is a set of types, so functors were actualy what I had in mind :)
<mrvn> yezariaely: type 'a test = F : 'a -> 'a test?
mort___ has quit [Quit: Leaving.]
<mrvn> type ('a, 'b) higher = ('a -> 'b)?
<yezariaely> mrvn: here, 'a is still a ground type, i.e. int,string, or something user defined, but not a function from types to types.
<mrvn> You can simulate type types with GADTs and some campl4 magic to build them automatically.
<mrvn> Otherwise a functor is the only thing to do I think.
vpm has quit [Ping timeout: 260 seconds]
csakatoku has joined #ocaml
csakatok_ has quit [Ping timeout: 268 seconds]
ttamttam has quit [Quit: ttamttam]
ttamttam has joined #ocaml
mort___ has joined #ocaml
ocp has joined #ocaml
vpm has joined #ocaml
csakatoku has quit [Remote host closed the connection]
introom has quit [Remote host closed the connection]
djcoin has joined #ocaml
osa1 has joined #ocaml
palomer has joined #ocaml
dsamarin has joined #ocaml
<dsamarin> "match (try Some (Queue.top bottomQ) with Queue.Empty -> None) with [...]"
<dsamarin> Can someone help me understand this? I'm not an OCaml programmer but I need to read some OCaml code. I'd really appreciate it. :)
<ggole> Queue.top returns the top element of a queue, returning an exception if there is no such element because the queue is empty.
<ggole> That code maps the found-element/exception cases onto an option.
avsm has joined #ocaml
<dsamarin> ggole: Okay. Top meaning first?
<ggole> Yep
<dsamarin> Awesome, so the options appear to be: None , Some FlushEnded, and Some (Bottom (node,key))
<dsamarin> None is matched when bottomQ has a top? (no exception)
<ggole> None indicates "nothing here"
<ggole> A bit like null in other languages, but more explicit
<ggole> Some indicates a value, in this case the top element of the queue
<dsamarin> Oh I misinterpreted the item that was being matched as a language exception
<ggole> The point of doing this is to have the OCaml type system help out with case analysis
<dsamarin> Last question, what's the difference between the last two options?
<ggole> The stuff inside the option? That's program specific stuff.
<dsamarin> I don't understand the meaning behind Some FlushEnded and Some (Bottom (node,key))
<dsamarin> Oh these are elements you would find in the queue I bet
<ggole> Yeah
<dsamarin> Awesome thanks for your help
<ggole> The match construct lets you look inside the option (Some _ or None) and the custom type at the same time
<ggole> The point of doing it that way is that the type system can help you with the case analysis
<ggole> Er, I said that already.
csakatoku has joined #ocaml
<dsamarin> Right, very convenient. So OCaml is dynamically typed
<adrien_oww> no but it has more advanced type than many languages
<ggole> Constructors like that are a little bit like the tagging in dynamic languages
<ggole> But the type system keeps them separate
<ggole> (And you get exhaustiveness and redundancy checking, which is very nice.)
smondet has joined #ocaml
<mrvn> adrien_oww: It is a bit like 'enum type {FlushEnded, Bottom}; struct data { type d_type; node d_node; }' but the d_node part is only accessible in ocaml when type is Bottom.
<mrvn> And the Some/None would repsond to passing a &data or NULL in C.
ygrek has joined #ocaml
demonimin has quit [Remote host closed the connection]
ollehar has joined #ocaml
palomer has quit [Ping timeout: 256 seconds]
yezariaely has quit [Read error: Operation timed out]
yezariaely has joined #ocaml
yezariaely has quit [Client Quit]
demonimin has joined #ocaml
cago has left #ocaml []
mika1 has quit [Quit: Leaving.]
darkf has quit [Quit: Leaving]
skchrko has quit [Quit: Leaving]
shinnya has joined #ocaml
dtg has quit [Read error: Connection reset by peer]
morolin has joined #ocaml
zpe has quit [Remote host closed the connection]
ttamttam has quit [Read error: Connection reset by peer]
tianon has quit [Quit: "I'm a very important man. I've got a tower!"]
tianon has joined #ocaml
palomer has joined #ocaml
csakatoku has quit [Remote host closed the connection]
troydm has joined #ocaml
ulfdoz has joined #ocaml
ggole has quit []
avsm has quit [Quit: Leaving.]
travisbrady has joined #ocaml
csakatoku has joined #ocaml
mort___ has quit [Quit: Leaving.]
Xom has joined #ocaml
dsheets has quit [Ping timeout: 264 seconds]
Neros has quit [Ping timeout: 264 seconds]
mcclurmc has quit [Quit: Leaving.]
ygrek has quit [Ping timeout: 268 seconds]
palomer has quit [Ping timeout: 264 seconds]
csakatoku has quit [Ping timeout: 246 seconds]
osa1 has quit [Ping timeout: 264 seconds]
avsm has joined #ocaml
wwilly has quit [Remote host closed the connection]
Neros has joined #ocaml
avsm has quit [Ping timeout: 264 seconds]
<hcarty> Is there a prctl binding/wrapper for OCaml?
<hcarty> Specifically to have the subprocesses of an OCaml process killed when the parent OCaml process is killed.
<adrien> btw, which argument would you use to do that?
ocp has quit [Ping timeout: 264 seconds]
<adrien> thanks
<hcarty> adrien: Assuming that works as described :-)
<adrien> well, I'm going to test it on tomorrow
<adrien> we have a pygtk process which spawns a critical process; however there's a segfault in pygtk which takes the UI with it but not the critical process
<adrien> (and I'm sure I'll have uses for other cases :-) )
<hcarty> I think that there is a Python binding
<adrien> looked in extunix?
<hcarty> It was one of the results I found when looking for something in OCaml
<hcarty> adrien: Yep, didn't see it tehre
<hcarty> there
<adrien> was likely your best bet unfortunately; that, or Core
<adrien> and maybe ocmalnet
<adrien> ocamlnet*
<rks`> (if it's in core, it's probably in Linux_ext)
<mrvn> if you have bindings then I can merge them to extunix.
<rks`> (there are some stubs using prctl in linux_ext in core)
<hcarty> mrvn: If I write something I'll pass it along
<hcarty> rks`: Thanks for the tip about where to look in Core. I'm not using it but I may be able to pinch the relevant bit of code if it's already there.
mcclurmc has joined #ocaml
<smondet> hcarty: (not sure) but Unix.setsid should create a process group, then
<smondet> when you should be able to kill the whole group (process + children)
<smondet> s/when//
<hcarty> smondet: Thanks, I'll take a look at that
<hcarty> I misread the documentatio... it looks like prctl needs to be called from the child process rather than the parent to have this work.
<adrien> I read it that way
<hcarty> I have at least a few cases where that's not a (simple) option. On to testing process groups!
avsm has joined #ocaml
<hcarty> adrien: Wishful reading on my part
palomer has joined #ocaml
<adrien> that's why I had to ask you about it but I think something else in prctl might do it
<levi> I was so happy to find fieldslib last night.
<adrien> hcarty: maybe through CHILD_SUBREAPER
<adrien> PR_SET_CHILD_SUBREAPER (since Linux 3.4)
<adrien> ouch
<adrien> might be too recent
<levi> I had a record type that stored a bunch of configuration parameters, and I wanted to merge the defaults instance with the instances from reading the command line and reading the config file, but there seemed no clean way of doing it without typing the field names about 4 times each.
<hcarty> adrien: Yep, too recent unfortunately. Needs to be able to run on RHEL 6/CentOS 6.
zpe has joined #ocaml
palomer has quit [Remote host closed the connection]
ocp has joined #ocaml
bkpt has joined #ocaml
djcoin has quit [Quit: WeeChat 0.4.0]
<hcarty> It looks like Unix.setsid ... (set sigX handler) ... Unix.kill 0 Sys.sigX ... (reset sigX handler) ... (continue on) ... may work
zpe has quit [Remote host closed the connection]
csakatoku has joined #ocaml
csakatoku has quit [Ping timeout: 264 seconds]
<hcarty> For anyone interested, that set of steps does seem to work at least one level deep.
<hcarty> One level of child processes that is. I haven't tested processed nested more deeply than that.
bkpt has quit [Ping timeout: 245 seconds]
mort___ has joined #ocaml
dsheets has joined #ocaml
osa1 has joined #ocaml
metasyntax has quit [Read error: Connection reset by peer]
metasyntax has joined #ocaml
happy4crazy has joined #ocaml
happy4crazy has quit [Remote host closed the connection]
happy4crazy has joined #ocaml
gautamc has quit [Ping timeout: 264 seconds]
gautamc has joined #ocaml
zpe has joined #ocaml
gautamc has quit [Ping timeout: 245 seconds]
zpe has quit [Ping timeout: 264 seconds]
_andre has quit [Quit: leaving]
osa1_ has joined #ocaml
osa1 has quit [Ping timeout: 264 seconds]
osa1_ has quit [Quit: Konversation terminated!]
ollehar has quit [Ping timeout: 246 seconds]
Yoric has joined #ocaml
gautamc has joined #ocaml
osa1 has joined #ocaml
happy4crazy has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Remote host closed the connection]
<Drup> Does anyone know a simple http/rest client library ?
<orbitz> ocamlnet or lwt might have one
<sgnb> ocamlnet definitely has one, but not lwt
<Drup> sgnb: the front page is saying GET only for the client, so no :/
<sgnb> oh, I misread server library
<sgnb> for a client library, there are also bindings to curl: http://sourceforge.net/projects/ocurl/
<Drup> Isn't curl doing only GET/POST ?
<orbitz> No
<sgnb> I'm just giving pointers, I've never done REST myself
<Drup> I was trying to find something that would work for both normal ocaml and js_of_ocaml, but this seems a bit hard
bkpt has joined #ocaml
<sgnb> then I would suggest looking at ocsigen
<sgnb> but it's not exactly what I would call "simple"
<Drup> no, The http client of ocsigen will not compile to js_of_ocaml
<Drup> I'm already using ocsigen ;)
<sgnb> aren't there bindings to XmlHttpRequest or such?
<Drup> sure, but I have to duplicate part of the code
<Drup> (I'm looking at ocurl right now, I'm not going to use something that only documentation is a .mli without any comments ...)
<sgnb> ocurl is a fairly trivial binding to the curl library... all the documentation is there
Yoric has quit [Ping timeout: 264 seconds]
<Drup> I was just trying to find something better than that
thomasga1 has quit [Quit: Leaving.]
<rks`> I was going to say : "anil did something looking like that"
<rks`> but thomasga just gave the link
<rks`> (ping Drup)
beginner42 has joined #ocaml
<rks`> (I don't know why he specificaly linked the "lwt_unix" file but well)
<Drup> yes, the interface looks a lot like ocsigen's one
<Drup> since I already use ocsigen, I will just go with this one, not perfectly convince though :/
Associat0r has joined #ocaml
yacks has joined #ocaml
beginner42 has quit [Ping timeout: 264 seconds]
smondet has quit [Quit: gotta go home]
zpe has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
csakatoku has joined #ocaml
csakatoku has quit [Ping timeout: 264 seconds]
gautamc has quit [Read error: Connection reset by peer]
gautamc has joined #ocaml
oriba has joined #ocaml
mort___ has quit [Quit: Leaving.]
manud has joined #ocaml
csakatoku has joined #ocaml
travisbrady has quit [Quit: travisbrady]
csakatoku has quit [Ping timeout: 264 seconds]
ocp has quit [Ping timeout: 256 seconds]
oriba has quit [Quit: oriba]