gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.1 http://bit.ly/nNVIVH
Plazma has left #ocaml []
sepp2k1 has quit [Read error: Connection reset by peer]
ulfdoz_ has joined #ocaml
ulfdoz has quit [Ping timeout: 245 seconds]
ulfdoz_ is now known as ulfdoz
madroach has quit [Ping timeout: 265 seconds]
madroach has joined #ocaml
ankit9|zzz has quit [Ping timeout: 246 seconds]
ankit9|zzz has joined #ocaml
ankit9|zzz has quit [Ping timeout: 246 seconds]
Drakken has joined #ocaml
ankit9|zzz has joined #ocaml
cdidd has quit [Ping timeout: 264 seconds]
emmanuelux has quit [Quit: emmanuelux]
wtetzner has joined #ocaml
targetron has joined #ocaml
targetron has quit [Ping timeout: 248 seconds]
bzzbzz has quit [Quit: leaving]
cdidd has joined #ocaml
ankit9|zzz has quit [Ping timeout: 246 seconds]
ankit9|zzz has joined #ocaml
emmanuelux has joined #ocaml
ankit9|zzz has quit [Ping timeout: 245 seconds]
ankit9|zzz has joined #ocaml
emmanuelux has quit [Quit: emmanuelux]
emmanuelux has joined #ocaml
emmanuelux has quit [Quit: emmanuelux]
emmanuelux has joined #ocaml
emmanuelux has quit [Quit: emmanuelux]
Drakken has quit [Ping timeout: 246 seconds]
Drakken has joined #ocaml
ankit9|zzz has quit [Quit: Leaving]
emmanuelux has joined #ocaml
Ptival has joined #ocaml
targetron has joined #ocaml
pango has quit [Ping timeout: 260 seconds]
targetron has quit [Ping timeout: 248 seconds]
pango has joined #ocaml
err404 has joined #ocaml
err404 has quit [Remote host closed the connection]
osa1 has joined #ocaml
osa1 has quit [Quit: Konversation terminated!]
ocp has joined #ocaml
n00b6502 has quit [Ping timeout: 276 seconds]
ontologiae has joined #ocaml
testcocoon has quit [Quit: Coyote finally caught me]
Yoric has joined #ocaml
ontologiae has quit [Ping timeout: 245 seconds]
hto has quit [Read error: Connection reset by peer]
Yoric has quit [Remote host closed the connection]
Yoric has joined #ocaml
osa1 has joined #ocaml
testcocoon has joined #ocaml
n00b6502 has joined #ocaml
targetron has joined #ocaml
hto has joined #ocaml
sepp2k has joined #ocaml
targetron has quit [Ping timeout: 255 seconds]
iratsu has quit [Ping timeout: 245 seconds]
zolk3ri has joined #ocaml
<zolk3ri> is there a reason why you don't change OCaml 3.12.1 to OCaml 4.00.0 in the topic?
zolk3ri has quit [Changing host]
zolk3ri has joined #ocaml
<adrien> yes; is it a good reason? no
<adrien> :P
Fnar has quit [Ping timeout: 246 seconds]
emmanuelux has quit [Quit: emmanuelux]
Yoric has quit [Ping timeout: 246 seconds]
targetron has joined #ocaml
Yoric has joined #ocaml
targetron has quit [Ping timeout: 252 seconds]
Snark_ has joined #ocaml
Yoric has quit [Ping timeout: 246 seconds]
fraggle_ has quit [Remote host closed the connection]
fraggle_ has joined #ocaml
osa1 has quit [Quit: Konversation terminated!]
Yoric has joined #ocaml
ousado has quit [Ping timeout: 265 seconds]
osa1 has joined #ocaml
Yoric has quit [Ping timeout: 246 seconds]
emmanuelux has joined #ocaml
Ptival has quit [Read error: Connection reset by peer]
Ptival has joined #ocaml
cacho has quit [Ping timeout: 244 seconds]
cacho has joined #ocaml
<wmeyer> thelema:
<wmeyer> utop[9]> type t = F : (unit -> 'a) -> t;;
<wmeyer> type t = F : (unit -> 'a) -> t
<wmeyer> utop[10]> F (fun x -> 3.14);;
<wmeyer> - : t = F <fun>
<wmeyer> utop[11]> [F (fun x -> 3.14); F (fun x -> 256)];;
<wmeyer> - : t list = [F <fun>; F <fun>]
<wmeyer>
<wmeyer> not sure what you want to do with the function, you still want to know the type wrapped, if so, then what mfp proposing will fit better
<wmeyer> well, of course this allows you to wrap the function into the list, but it's pretty useseless since you can't do anything with it ;) sorry
<wmeyer> this encoding works:
<wmeyer> type 'a t = F : (unit -> 'a) -> (unit -> 'b) t;;
<wmeyer> utop[25]> List.iter (fun (F f) -> ignore(f())) [F (fun x -> 3.14); F (fun x -> 256)];;
<wmeyer> - : unit = ()
<wmeyer>
<wmeyer> and you still can unwrap return function type via:
<wmeyer> no, it's then not possible of course to wrap it into the list, but using first class modules, you can put any operation inside. However you can still use the type variable in function, just it will not produce heterogenous lists anymore
<wmeyer> still you could do similar things with records I think
osa1 has quit [Quit: Konversation terminated!]
targetron has joined #ocaml
gpolitis has quit [Quit: leaving]
julm has quit [Ping timeout: 245 seconds]
julm has joined #ocaml
Yoric has joined #ocaml
pango has quit [Ping timeout: 245 seconds]
ocp has quit [Ping timeout: 240 seconds]
pango has joined #ocaml
osa1 has joined #ocaml
ocp has joined #ocaml
osa1 has quit [Remote host closed the connection]
<flux> gah, bitten by 'enum can be enumerated only once'
<_habnabit> Enum.dup!
<flux> sure, now that I've realized what's the problem
osa1 has joined #ocaml
osa1 has quit [Remote host closed the connection]
<wmeyer> it'd be pretty cool if we had ocsigen odb package
sepp2k1 has joined #ocaml
sepp2k has quit [Ping timeout: 276 seconds]
Ptival has quit [Quit: Lost terminal]
pango has quit [Remote host closed the connection]
pango has joined #ocaml
eni has joined #ocaml
osa1 has joined #ocaml
Anarchos has joined #ocaml
eni has quit [Ping timeout: 248 seconds]
<zolk3ri> wats up
cacho has quit [Remote host closed the connection]
ftrvxmtrx has quit [Quit: Leaving]
<adrien> amps
<zolk3ri> hey adrien
<zolk3ri> mate
<Anarchos> hi adrien
<zolk3ri> :(
ocp has quit [Ping timeout: 244 seconds]
ocp has joined #ocaml
ocp has quit [Ping timeout: 244 seconds]
ocp has joined #ocaml
BiDOrD has joined #ocaml
BiDOrD_ has quit [Ping timeout: 240 seconds]
osa1 has quit [Quit: Konversation terminated!]
err404 has joined #ocaml
ontologiae has joined #ocaml
zolk3ri has quit []
cacho has joined #ocaml
targetron has quit [Changing host]
targetron has joined #ocaml
zolk3ri has joined #ocaml
<zolk3ri> hi
<zolk3ri> 3.12.1
<zolk3ri> still
<Anarchos> hi zolk3ri
<Anarchos> 4.01.0+dev7_2012-08-06 here
<zolk3ri> :)
<Anarchos> zolk3ri i am porting ocaml to MMIX :)
<Anarchos> so i want code up to date
<zolk3ri> nice
<zolk3ri> "You can rejoice that you do not have to learn Hungarian notation."
<zolk3ri> haha
Snark_ has quit [Quit: Quitte]
Yoric has quit [Ping timeout: 268 seconds]
n00b6502 has quit [Ping timeout: 246 seconds]
<zolk3ri> ok
<zolk3ri> # (4./.3.)*.3.14*.5.**3.;;
<zolk3ri> - : float = 523.333333333333371
<zolk3ri> #
<zolk3ri> (%i8) (4/3)*3.14*5^3;
<zolk3ri> (%o8) 523.3333333333334
<zolk3ri> (%i9)
<zolk3ri> ocaml vs maxima
<zolk3ri> say what?
<thizanne> I don't understand your point
<thizanne> but they seem to calculate the same result, which is truncated by maxima
<thizanne> this result being different from what we could expect because we're using a computer and not a sheet of paper
err404 has quit [Remote host closed the connection]
<zolk3ri> good job sir, anyway I'll just use 1570/3
<zolk3ri> at least someone is paying attention
<hiredman> does ocaml have a progn?
osa1 has joined #ocaml
<hiredman> nevermind
Fare has joined #ocaml
<Fare> hi
<Fare> what would you use as an example to introduce users to parametric polymorphism?
<Fare> lists ?
zolk3ri has quit [Remote host closed the connection]
<wmeyer> Fare: think about parametric polymorphism as templates or generics if it's easier
<wmeyer> Fare: yes, lists are one example
<wmeyer> "option" type would be another
<wmeyer> and functors would be more advances
<Fare> I know what it is. I find myself trying to explain how it works in my lisp library -- and find I haven't had to explain it in a decade.
<wmeyer> Fare: OK, so what is the exact question?
<Fare> I suppose lists will be fine.
<wmeyer> but in OCaml you can also parametrize module by another
<Fare> btw, does ocaml have both pure and stateful datastructures in its stdlib these days?
<Fare> and can objects of either be accessed through a common readonly interface?
<Fare> (I haven't used ocaml in over 10 years, too)
<wmeyer> Fare: mix of
<wmeyer> Fare: you have Hashtbl but also maps
<wmeyer> but you don't have Okasaki's queue
<wmeyer> (the one in stdlib is not persistent)
<Fare> e.g. in my lisp library, the same readonly functions can work on both stateful and pure AVL-trees.
<Fare> though obviously, update works differently for pure and stateful trees.
<Fare> yeah, okasaki datastructures are a big todo for my library.
<wmeyer> we don't have split in between. But easily you could it yourself
<wmeyer> have a functor that makes a module that contains read only members
<Fare> is there interface inheritance / subtyping for modules / functors?
<wmeyer> and then if the full implementation contains needed interface then you can apply it
<wmeyer> yes, there is, via include
<Fare> such that both my pure and stateful could extend the same readonly signature fragment?
<wmeyer> full subtyping is not needed in practice as the subtype of module is an implementation of the sub signature
<Fare> and be passed to functors taking said fragment as input
<wmeyer> functor will expect an interface
<wmeyer> it will check only if needed fields are in the passed module
<Fare> ok, so that should work. Nice.
<wmeyer> so you can pass anything that satisfies the expected interface
<Fare> is camlp4 still maintained, btw, or something that replaces it?
<wmeyer> oh, i knew you will ask about it :-)
<wmeyer> i appreciate lisp for macros
<wmeyer> camlp4 is part of ocaml as for today
<Fare> some things I do would require it, like, automatically wrapping methods of a pure interface to build a stateful interface, and back.
<Fare> nice.
<wmeyer> there is camlp5 which is fork, or maybe camlp4 is a fork of camlp5 but camlp5 existed before camlp4 become camlp4 (after heavy refactor) it has some story about it
<Fare> is xleroy still the god of ocaml?
<wmeyer> Xavier is of course the lead developer
<Fare> I remember he had qualms about camlp4.
<wmeyer> Camlp4 is damn useful for code generation
<wmeyer> and quite useful for introspection
<wmeyer> still writing recursive macros is not possible as in Lisp
<wmeyer> but in practice it does not matter to much for me
<wmeyer> Camlp4 has also a lalr parser, which i still don't understand how it works
<wmeyer> but apparently it parses OCaml syntax so it's powerful enough
<Fare> what do you mean "recursive macros" ?
<Fare> I wonder if my pure<->stateful macros would be possible / easy in camlp4
<wmeyer> means that you can apply one pass of macro expansion after another
<wmeyer> usually it's not easy to compose extend the syntax extension, or generate the code that's new syntax
<wmeyer> it's I think possible but Camlp4 was not designed
<wmeyer> for this
<wmeyer> let's say I want to generate code that is Camlp4 parsers
<wmeyer> generate the code that is in the parser syntax
<wmeyer> generate for instance the parsing rules
<wmeyer> currently it's not possible
<wmeyer> but it's useful isn't ?
<wmeyer> I could then write a high level DSL that takes some AST and then generate parser, using the Camlp4 parser syntax
<wmeyer> and instead I have a choice, of generating adhoc Yacc definitions or composing at runtime parsing combinators
<wmeyer> the Camlp4 syntax is already lousy, means that it's far from the AST of OCaml, it can describe it, but carries less ocaml specific information
ulfdoz has quit [Read error: Operation timed out]
ulfdoz has joined #ocaml
dmhouse has joined #ocaml
n00b6502 has joined #ocaml
osa1 has quit [Quit: Konversation terminated!]
ftrvxmtrx has joined #ocaml
n00b6502 has quit [Ping timeout: 276 seconds]
cdidd has quit [Ping timeout: 246 seconds]
Fare has quit [Ping timeout: 246 seconds]
_habnabit has quit [Excess Flood]
ontologiae has quit [Ping timeout: 260 seconds]
_habnabit has joined #ocaml
_habnabit has quit [Excess Flood]
_habnabit has joined #ocaml
emmanuelux has quit [Ping timeout: 246 seconds]
ftrvxmtrx has quit [Quit: Leaving]
cabbagebot has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]