lapinou changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | http://www.ocaml.org | OCaml 4.01.0 announce at http://bit.ly/1851A3R | Public logs at http://tunes.org/~nef/logs/ocaml/
tlockney_away is now known as tlockney
njcomsec has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
zpe has joined #ocaml
ygrek has joined #ocaml
malo has quit [Quit: Leaving]
zpe has quit [Ping timeout: 260 seconds]
csakatoku has quit [Remote host closed the connection]
ulfdoz_ has joined #ocaml
watermind has joined #ocaml
ulfdoz has quit [Ping timeout: 272 seconds]
ulfdoz_ is now known as ulfdoz
csakatoku has joined #ocaml
csakatoku has quit [Remote host closed the connection]
teiresias has quit [Ping timeout: 264 seconds]
robink has quit [Remote host closed the connection]
robink has joined #ocaml
watermind has quit [Ping timeout: 246 seconds]
sheijk has quit [Quit: .]
watermind has joined #ocaml
q66 has quit [Quit: Leaving]
teiresias has joined #ocaml
q66 has joined #ocaml
robink has quit [Quit: No Ping reply in 180 seconds.]
robink has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 260 seconds]
jao` has quit [Ping timeout: 252 seconds]
talzeus has joined #ocaml
talzeus has quit [Remote host closed the connection]
talzeus has joined #ocaml
philtor has quit [Ping timeout: 260 seconds]
seliopou has quit [Ping timeout: 260 seconds]
seliopou has joined #ocaml
jzelinskie has quit [Ping timeout: 264 seconds]
robink has quit [Quit: No Ping reply in 180 seconds.]
csakatoku has joined #ocaml
robink has joined #ocaml
jzelinskie has joined #ocaml
kyrylo has quit [Read error: Operation timed out]
oriba has quit [Quit: oriba]
zpe has joined #ocaml
caligula__ has quit [Read error: Connection reset by peer]
zpe has quit [Ping timeout: 252 seconds]
palomer has quit [Ping timeout: 252 seconds]
michael_lee has joined #ocaml
watermind has quit [Read error: Connection reset by peer]
watermind has joined #ocaml
watermind has quit [Client Quit]
watermind has joined #ocaml
caligula has joined #ocaml
csakatoku has quit [Remote host closed the connection]
csakatoku has joined #ocaml
csakatoku has quit [Ping timeout: 252 seconds]
csakatoku has joined #ocaml
cesar_ has joined #ocaml
cesar_ is now known as Guest66903
Guest66903 is now known as nataren
ggole has joined #ocaml
robink has quit [Quit: No Ping reply in 180 seconds.]
robink has joined #ocaml
ollehar has quit [Ping timeout: 246 seconds]
ygrek has quit [Ping timeout: 252 seconds]
DrZoo has quit [Ping timeout: 245 seconds]
Kakadu has joined #ocaml
csakatoku has quit [Remote host closed the connection]
struktured has quit [Ping timeout: 260 seconds]
struktured has joined #ocaml
maurer_ has quit [Quit: leaving]
maurer has joined #ocaml
philtor has joined #ocaml
nataren has quit [Remote host closed the connection]
rainbyte has joined #ocaml
csakatoku has joined #ocaml
axiles has joined #ocaml
noam has quit [Ping timeout: 245 seconds]
mort___ has joined #ocaml
philtor has quit [Ping timeout: 272 seconds]
hto has quit [Quit: Lost terminal]
totimkopf has joined #ocaml
watermind has quit [Quit: Konversation terminated!]
ygrek has joined #ocaml
yellowfish has joined #ocaml
<yellowfish> hey anyone up?
csakatoku has quit [Ping timeout: 272 seconds]
<Kakadu> what happend?
<yellowfish> I'm new to Ocaml
<yellowfish> just have some syntax qusetions
<yellowfish> can you help Kakadu ?
<Kakadu> Don't ask to ask, just ask
<yellowfish> so I tried to create a list
<yellowfish> I added in an integer to the list, then tried to add a float
<yellowfish> I got back "'a list = []" as my list
<yellowfish> let a = 2;;
<yellowfish> let b = 3.0;;
<yellowfish> let list = [];;
<yellowfish> a :: list;;
<yellowfish> b :: list;;
<Kakadu> list can contain vales only of 1 type
totimkopf has left #ocaml []
<yellowfish> but it didn't complain when I added the float
<yellowfish> how do I print out a list?
<Kakadu> Where do you write your commands?
<Kakadu> in toplevel?
<yellowfish> so yes... I suppose? lol
mort___ has quit [Quit: Leaving.]
mort___ has joined #ocaml
<Kakadu> So, if you want to print expression just enter its name (`list` in your case).
<yellowfish> in single quotes?
<Kakadu> without
<yellowfish> it gives an empty list
<yellowfish> which it shouldn
<yellowfish> t
<Kakadu> expression (a::list) doesn't change the `list`
<yellowfish> oh I see
<yellowfish> how do I add something to the end of list?
Simn has joined #ocaml
mort___ has quit [Ping timeout: 272 seconds]
<Kakadu> you can create new list only
<Kakadu> Are you following some tutorial?
<yellowfish> yes
<yellowfish> the Ocaml tutorial
<yellowfish> also, what is d::=let id = e
<yellowfish> ?
<yellowfish> the ::= makes no sense
<Kakadu> I think your are reading syntax tree in BNF form
claudiuc has joined #ocaml
<yellowfish> that's what I'm following
<yellowfish> I'm trying to understand what this means:
<yellowfish> let rec sumsq (n:int):int =
<yellowfish> why use :int twice?
<Kakadu> 1st for n, 2nd for sumsq
<Kakadu> for sumsq return type*
<Dongyancai> Hello, a newbie problem: I have source files in different dirs, how can I compile them?
<Kakadu> Dongyancai: manual invocation, Makefile or ocamlbuild-like buildsystem?
<yellowfish> so (n:int) = will ensure the input is int
<Kakadu> yellowfish: +
<yellowfish> and (n):int = will only ensure output is int?
<Kakadu> +
<yellowfish> what's is +?
<Kakadu> yes
<yellowfish> okay
<yellowfish> and (n:int):int ensures both
<Kakadu> +
nataren has joined #ocaml
<yellowfish> OCAML is so HARD :(
<Kakadu> not relly
nataren has quit [Ping timeout: 260 seconds]
<Kakadu> It depends what you was doing before
<yellowfish> ok what is the e::=x|c thing?
<Kakadu> it is not real OCaml syntax. This BNF says that e can be either x or c
<yellowfish> do I need to use them?
<Kakadu> It is incorrect question
<Kakadu> What manual do you read?
<yellowfish> How do you mean?
<yellowfish> the Ocaml manual I guess?
pyon has joined #ocaml
<Kakadu> This BNFs like `e::=x|c` doesn't suit for beginners
angerman has joined #ocaml
<yellowfish> okay good
<yellowfish> what about the syntax "in"?
<yellowfish> I can't find what it means
<Kakadu> Just literate English
<Kakadu> let me = King in (where)
<yellowfish> mother of lord this is confusing
<yellowfish> are you gonna be awake for the entire night Kakadu ?
<yellowfish> I'm doing a project that may take 10-12 hours lol
<Kakadu> It is not very good to do everything in last day:)
<yellowfish> well right now I've no choice lul
<yellowfish> it's due in 20 hours
<Kakadu> Are you at the University?
<yellowfish> yes, I'm in a university
talzeus has quit [Read error: Connection reset by peer]
<Kakadu> Well, I remember my 1st pieces of code in OCaml
<gasche> yellowfish: find a learning document and read it
<yellowfish> yes, I'm reading through the Ocaml tutorial
<Kakadu> When I came out to public chat with the issue the guys asked me: do I need full explanation or I just wnat to do this and forget about this?
<gasche> we're not here to serve as teaching doormats for egotists in a hurry
<gasche> if you can't finish your project on time, too bad
<gasche> you don't need to *also* waste 4 hours of Kakadu's time
<gasche> which is, you know, a real person, which may have more interesting things to do -- even though he's nice and will try to help you
shinnya has joined #ocaml
<yellowfish> I was asking you gasche or anyone to stay up for me. I was merely wondering if Kakadu will be here in a few hours, or should I not bother coming back to the chat room
<yellowfish> I was not*
<yellowfish> No need to be so confrontational
bartbes has joined #ocaml
Dongyancai has quit [Quit: leaving]
yellowfish has left #ocaml []
ygrek has quit [Ping timeout: 245 seconds]
claudiuc has quit [Read error: Connection reset by peer]
claudiuc has joined #ocaml
claudiuc has quit [Ping timeout: 245 seconds]
claudiuc has joined #ocaml
ggole has quit [Ping timeout: 260 seconds]
claudiuc has quit [Ping timeout: 246 seconds]
yellowfish has joined #ocaml
<yellowfish> can someone explain how this is valid?
<yellowfish> let sum_left_to_right = fold_left (+) 0
<yellowfish> doesn't (+) require 2 arguments
<yellowfish> ?
<Kakadu> fold_left requires function
<Kakadu> So, everything is OK
ggole has joined #ocaml
claudiuc has joined #ocaml
<flux> yellowfish, hmm, so that's equal to: let sum_left_to_right xs = fold_left (fun a b -> a + b) 0 xs
<flux> xs can be elided due to using partial application
<flux> and (+) is the same as what I opened there
<def-lkb> (that is the "(operator_symbol)" syntax reify an operator to a classic function)
<flux> also there is a cunning corner case: it's best to write ( * ), as (* would start a comment
<flux> similarly some suggest using the same pattern for all operators, for consistency
contempt has joined #ocaml
nataren has joined #ocaml
angerman has quit [Quit: Gone]
<yellowfish> what OCAML IDE should I use?
<flux> emacs with OCamlMerlin :)
claudiuc has quit [Ping timeout: 260 seconds]
<yellowfish> what about for Windows?
nataren has quit [Ping timeout: 245 seconds]
contempt has quit [Ping timeout: 260 seconds]
contempt has joined #ocaml
claudiuc has joined #ocaml
r0b1 has quit [Ping timeout: 246 seconds]
<yellowfish> why isn't there just a simple Ocaml ide that I can click run and it runs
<Kakadu> because Windows sucks
<ggole> emacs works fine for windows, but I wouldn't call it simple.
<yellowfish> tureg's site isn't even working
<yellowfish> any other simple IDEs?
<yellowfish> I just want it to run, and run a few test cases. Nothing fancy
ygrek has joined #ocaml
contempt has quit [Ping timeout: 252 seconds]
claudiuc has quit [Ping timeout: 252 seconds]
contempt has joined #ocaml
<def-lkb> yellowfish: ocamleditor ?
<Kakadu> OcaIDE for eclipse?
<Kakadu> Also, ocamlpro was creating something
<Kakadu> maybe it was called OCaml-top
claudiuc has joined #ocaml
<yellowfish> in this example:
<yellowfish> let rev lst = List.fold_left f [] lst
<yellowfish> why does it return int list list -> int list = <fun>
<yellowfish> instead of int list -> int = <fun>
<bernardofpc> because of the type of f (and of [])
claudiuc has quit [Ping timeout: 260 seconds]
pminten has joined #ocaml
ygrek has quit [Ping timeout: 246 seconds]
angerman has joined #ocaml
<yellowfish> what's an easy way to check if a list contains an element?
<Kakadu> List.mem and List.find
kyrylo has joined #ocaml
smerz has joined #ocaml
<yellowfish> what's a fast way to sort a list?
<yellowfish> and why does List.sort expect 'a -> 'a -> int?
<yellowfish> why can't it be 'a->'a??
<Kakadu> Sort.list;;
<def-lkb> List.sort is a fast way.
<yellowfish> yes, but why does it output an int?
<def-lkb> The function you pass is expected to compare two values.
<yellowfish> shouldnt it be 'a -> 'a?
<yellowfish> there's no default / generic comparison function?
<def-lkb> compare
<bartbes> given two elements return an integer specifying the order
<def-lkb> But it's very usual to have a custom order.
<bartbes> 'a -> 'a -> int
ygrek has joined #ocaml
<yellowfish> let sort list = List.sort list compare ?
<def-lkb> (I agree that returnings an int is not the most beautiful encoding but it's light…)
<def-lkb> …
<def-lkb> List.sort compare lidst
<bartbes> I've seen libraries use < in the past, which is nicer because it returns a boolean, but of course it also means more comparisons
<def-lkb> Yes, it might be less convenient if you want to ensure stable sorting.
lopho has quit [Ping timeout: 272 seconds]
<bartbes> also, it does mean you can reuse compare, which is always nice
<yellowfish> what if I want to sort in reverse?
<yellowfish> is there a simple way to do -compare ?
<ggole> (fun a b -> -(compare a b)), maybe
<def-lkb> fun a b -> compare b a :P
<ggole> Er
<ggole> Yeah :)
<def-lkb> :)
lopho has joined #ocaml
rand000 has joined #ocaml
array has joined #ocaml
Thooms has joined #ocaml
csakatoku has joined #ocaml
smerz has quit [Ping timeout: 264 seconds]
pyon is now known as intui-pyon-istic
nataren has joined #ocaml
nataren has quit [Ping timeout: 252 seconds]
sagotch has joined #ocaml
ikaros has joined #ocaml
lostcuaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ollehar has joined #ocaml
avsm has joined #ocaml
array has quit [Quit: Page closed]
avsm has quit [Quit: Leaving.]
mort___ has joined #ocaml
axiles has quit [Read error: Operation timed out]
mort___ has quit [Read error: Operation timed out]
mort___ has joined #ocaml
AdmiralBumbleBee has quit [Ping timeout: 260 seconds]
mort___ has quit [Quit: Leaving.]
sagotch has quit [Remote host closed the connection]
ikaros has quit [Quit: Ex-Chat]
malo has joined #ocaml
malo has quit [Remote host closed the connection]
intui-pyon-istic has quit [Quit: restart]
mika1 has joined #ocaml
malo has joined #ocaml
csakatoku has quit [Remote host closed the connection]
axiles has joined #ocaml
AdmiralBumbleBee has joined #ocaml
michael_lee has quit [Ping timeout: 260 seconds]
nataren has joined #ocaml
nataren has quit [Ping timeout: 245 seconds]
shinnya has quit [Ping timeout: 260 seconds]
<andreypopp> omake vs. obuild vs. oasis vs. ocp-build?
<andreypopp> omake seems abandoned
<andreypopp> oasis feels complex last time I tried it
mika1 has quit [Ping timeout: 246 seconds]
<pminten> andreypopp: I went with ocamlbuild, but I have to say I don't quite like it as it's not trivial to link to external libraries without specifying them at the command line
<andreypopp> pminten: yeah, I also have a project which is a lib which is linked to C program
<andreypopp> now using make but it is too complex...
<andreypopp> ocp-build looks like the modern and mature, opam is using it to build itself
<pminten> ocp-build seems to be the next big build system
<andreypopp> pminten: gonna try it
<pminten> though at the moment I get the impression that it's very much in development
<gasche> omake is not abandoned at all, people use it
<gasche> ocp-build might be the "next big build system", but it's not released yet
<gasche> to my knowledge it's only been used internally by OCamlPro so far
<gasche> and there is jenga, which is Jane Street's reinvention of ocamlbuild
<pminten> I though they already had the corebuild wrapper
<rks_> gasche: wait, what?
<rks_> of ocamlbuild? I don't think so
<gasche> my impression is that the core design is roughly the same
<gasche> I'm not saying JS specifically intended to reproduce ocamlbuild, but what they arrived at has most of the same ideas
avsm has joined #ocaml
<Drup> (guys, when you want to link an editor that works out of the box, be nice, link this one : http://ocamleditor.forge.ocamlcore.org/ :p)
<flux> though it doesn't quite answer my problem.. is it possible to create custom signals?
<flux> or maybe I'm better off creating my own, as to not be be bound to lablgtk2 that much
avsm has quit [Quit: Leaving.]
cago has joined #ocaml
darkf has quit [Quit: Leaving]
pminten has quit [Quit: Leaving]
yellowfish has quit [Ping timeout: 260 seconds]
hto has joined #ocaml
wolfnn has joined #ocaml
nataren has joined #ocaml
nataren has quit [Ping timeout: 245 seconds]
pminten has joined #ocaml
kyrylo has quit [Ping timeout: 245 seconds]
smerz has joined #ocaml
<ygrek> ocamlbuild+oasis is supereasy with external C libraries
<ygrek> and you get portability out of the box
rainbyte has quit [Ping timeout: 252 seconds]
Eyyub has joined #ocaml
aurynj has joined #ocaml
rainbyte has joined #ocaml
<pminten> ygrek: gotta admit, that's a fairly painless system
Eyyub has quit [Ping timeout: 246 seconds]
michael_lee has joined #ocaml
Zerker has joined #ocaml
nataren has joined #ocaml
<tizoc> Drup: ocamleditor looks great, do you know if there are plans to support OSX?
<Drup> tizoc: why do you think it doesn't ?
<tizoc> Drup: it mentions just linux and windows
<tizoc> (it's webpage)
<tizoc> also opam refuses to install it (`"ocamleditor" is not available for your compiler or your OS.`)
avsm has joined #ocaml
<Drup> huum
<Drup> I don't know, try from source and ask the maintaner
<tizoc> yes, I'm cloning the git repo right now to see if I can build from source
<Drup> (I don't use mac)
<ygrek> pminten, sounds as if it is so unusual to have something painless in ocaml world :)
<pminten> ygrek: I'm new to ocaml, so yeah, I'm not used to that yet
michael_lee has quit [Ping timeout: 260 seconds]
michael_lee has joined #ocaml
Zerker has quit [Quit: Colloquy for iPad - Timeout (10 minutes)]
lostcuaz has joined #ocaml
saarin has quit [Ping timeout: 252 seconds]
clog has quit [^C]
clog has joined #ocaml
pango has quit [Remote host closed the connection]
pango has joined #ocaml
avsm has quit [Quit: Leaving.]
<bernardofpc> Drup: http://ocamleditor.forge.ocamlcore.org/ fails to compile with Error: No implementations provided for the following modules: XmlParser Xml
lovethroat has joined #ocaml
<bernardofpc> I do have xml-light
kyrylo has joined #ocaml
<Drup> bug report, I'm not the maintaner and not even a user :p
<bernardofpc> oh
struktured has joined #ocaml
ygrek has quit [Ping timeout: 252 seconds]
sillyotter has joined #ocaml
sillyotter has quit [Client Quit]
zpe has joined #ocaml
tlockney is now known as tlockney_away
tobiasBora has joined #ocaml
<jdoles> Why do programmers have this culture of projecting their world view in the form of talks and especially lecturing other people about the stupidest of subjects?
<r0b1> when/where does that happen?
<jdoles> Imagine that you work at Google and made the stupid mistake to sit in that room.
<companion_cube> because such subjects seem to matter in the java community
<companion_cube> (at least I guess)
<jdoles> Even at conferences the vast majority of the talks should not have been given.
<r0b1> everyone got an opinion I guess, i think talks like that can be dangerous because programmers can take it as holy-grail advice that causes them to not write code for the situation at hand
<jdoles> The problem is that a conference by definitions consists of relatively large sets of people presenting, but the probability of all of them being actually worthy of listening to is about zero.
<jdoles> definition*
<dsheets> at least it wasn't a presentation about economics or gender
<jdoles> Conference organisers also are often overly excited about their conference.
<jdoles> "Another great talk"...
<jdoles> Yeah, right.
<dsheets> (given by a programmer who hasn't studied either)
<jdoles> They don't discriminate in any way; they just say all the talks are equally good.
<jdoles> (only to stipulate that they organised a "great conference", so they will be "back next year")
<def-lkb> It's probably a subtle mix of "respect", "being polite" and "hypocrisy".
<r0b1> "causes them to not think for themselves" is closer to what i meant
<mrvn> jdoles: what is abd about the talk?
<mrvn> bad even
<jdoles> Global state bad!!! Booh!!!
<Drup> jdoles: if you want to laugh, in this serie of google talk, there is an introduction to monads with code examples in java and javascript
<jdoles> I didn't care to watch the rest of the talk :)
<Drup> it's actually funny :D
<mrvn> jdoles: well, it is. :)
<def-lkb> It's just oop-guys circle jerking. Cool, what's next…
<mrvn> it's nice if functions are pure.
<jdoles> mrvn: sure, but not everything can be written in a pure language.
<r0b1> mrvn: i didn't watch it either, and sure it is - the problem ive seen with preachers or "best practices" is that people assume because its bad it is, without understanding why
<companion_cube> jdoles: well, I guess it's commonly accepted that global state is bad? :D
<r0b1> for example when i began i was told eval() is evil and horrible but it's the most awesome thing out there and powerful when used properly
<jdoles> companion_cube: sure, when you can avoid it without too much effort.
cago has quit [Ping timeout: 246 seconds]
<companion_cube> there's currently an argument agaisnt Str for this very reason
<companion_cube> jdoles: of course, sometimes it makes sense
<jdoles> In the end, all that really matters is whether the object is well-defined.
<jdoles> So, if you can give an axiomatic semantics for a given object and whether that contract is always fullfilled by that object.
<mrvn> jdoles: First that requires the object to have a contract. Most languages don't have contracts that contain global state. Ocaml doesn't.
<jdoles> It's just that by the way which we program (without proof) global state creates a very large conceptual function (one with many parameters).
<jdoles> Since humans can only consider about 7 variables at the same time, it makes sense that global state stresses the human brain architecture.
sagotch has quit [Remote host closed the connection]
<companion_cube> and hampers re-usability
sheijk has joined #ocaml
<mrvn> and how often is global state not thread save?
<ggole> You have to be awfully narrow minded to think that talks that don't interest you "shouldn't be given".
<mrvn> int next_id() { static int count = 0; count = count + 1; return count; }
<jdoles> ggole: there is a whole class of such talks. Do you really think they contribute *anything*?
<mrvn> have fun with two threads getting an id.
<def-lkb> I can't think of a case where global state is both unavoidable and problematic. In instances I can think of, global state is not observable in the end (gensym, enforcing sharing, …)
<bernardofpc> companion> jdoles: well, I guess it's commonly accepted that global state is bad? -> rewrite my gravitation.ml without global state and we talk again ;-)
<jdoles> bernardofpc: URL?
<def-lkb> mrvn: I am not sure it's an issue about global state, it's either poor design or underspecification (adding pthreads to C just change the semantic in more-or-less chaotic ways),
<ggole> jdoles: they do nothing for me. That's not the point, though.
<def-lkb> but use of global state seems justified
<mrvn> bernardofpc: stuff all the global state into a struct called global and pass it as parameter. :)
<bernardofpc> I was talking to cc in fact jdoles ;-)
<bernardofpc> mrvn: does not look much better
<companion_cube> bernardofpc: well you could put it in a functor(sig end), you know
<companion_cube> so that it becomes less of a global state ;)
<mrvn> bernardofpc: but lets you simultate 2 different scenarios in parallel now.
<jdoles> Not in OCaml ;)
<bernardofpc> mrvn: I can do that already
<jdoles> Except for shared-memory constructions and other hacks.
<bernardofpc> the problem is mostly getting everything into the screen
<mrvn> bernardofpc: with the same global state? Won't they affect each others global state then?
cago has joined #ocaml
<bernardofpc> mrvn: the global state is more in lablgtk stuff than in the simulation itself
<bernardofpc> the simulation is mostly "instantiate one object / run simulation"
<bernardofpc> but I'll think about it
<bernardofpc> at the moment, it's ugly as hell with tons of global state everywhere for input/drawing/etc
<bernardofpc> (but it works and it's pretty and I had fun doing it :D)
<mrvn> bernardofpc: that belongs in a class.
<companion_cube> bernardofpc: do you really have global state in lablgtk?
<companion_cube> I thought it was all bound to a widget/window object
<bernardofpc> well, I don't know, but I do have a pixmap that is more or less a global
<bernardofpc> maybe I don't need it absolutely
struktured has quit [Ping timeout: 260 seconds]
<bernardofpc> but if I just want to update a prt of the screen, I push the pixmap ("base") then I draw the update atop
<bernardofpc> so for instance the orbit is fixed, and the traveling planet is in the update
<jdoles> bernardofpc: you can also split the program from the UI.
<bernardofpc> and the pixbuf lives in a global pixbuf ref
<bernardofpc> jdoles: that's mostly done
<bernardofpc> planet.ml does the calculations and returns the orbit, gravitation.ml will sohw the UI where you setup planet/speed/mass/simulation time/...
<companion_cube> bernardofpc: you could put it all in a functor(sig end) -> strut .... put code here .... I believe
<bernardofpc> "it all" is too vague :/
<companion_cube> so that duplicating the global state would be as simple as instantiating the functor twice
<companion_cube> all you current code
<bernardofpc> I fail to understand :/
<companion_cube> instead of let r = ref 0;; let f () = incr r;; ....
<companion_cube> you write module Foo(X : sig end) = struct let r = ref 0 ;; let f () = incr r;; .... end
<companion_cube> now, r is not so global
<companion_cube> you can do let module F1 = Foo(struct end) in F1.f(); let module F2 = Foo(struct end) in F2.f ()
<companion_cube> (two "global states")
<Drup> it's not really a nice way to hide a global state
nataren has quit [Remote host closed the connection]
<companion_cube> no, but at least it mitigates it
<companion_cube> alt-ergo-zero does this ;)
<nicoo> companion_cube: How is it better than let mk_counter () = let r = ref 0 in (fun () -> !r, fun () -> incr r) ?
<nicoo> (Note that I tl;dr-ed the backlog)
<mrvn> that's the same.
<mrvn> minus the namespace
<companion_cube> nicoo: in this case it's useless, of course
<companion_cube> in bigger programs this trick can be helpful if you have pervasive global state
<companion_cube> but still want to control it
<nicoo> mrvn: Except that the reference is hidden, but yes.
<companion_cube> (without adding a parameter to each and every function)
<nicoo> companion_cube: Ah, I see. It is to avoid actually cleaning-up code
<mrvn> nicoo: and it is more type save because you can pass counter1 or counter2 to a function expecting a counter but you can't pass F1.counter to F2.needs_counter
<companion_cube> nicoo: well. For instance you may use this to make one instance of Hashconsing per functor instance
<mrvn> (functors are more type save)
<nicoo> mrvn: In this case, wouldn't both F1.counter and F2.counter both unify to int ref ? (But yes, in general, it is a relatively nice way to wrap hidden state)
<nicoo> companion_cube: Sure. ('though “usual” hashconsing should see any bad effect from sharing with another instance, right ?)
<mrvn> nicoo: only if you export that type.
<companion_cube> nicoo: who knows? :p
<mrvn> nicoo: usualy I would assume the global state remains hidden and abstract
<companion_cube> actually I'm planning to use this architecture in my prover
<companion_cube> because for each problem to deal with, I need a fresh state
<nicoo> companion_cube: Well, I don't see how I could distinguish that I'm sharing values with another instance without doing eeeeeevil things with Obj :(
<companion_cube> but then this state is used in thousands and thousands of lines of code, and it's pretty annoying to pass parameters to every function
<nicoo> Ah, ok, you have mutability in there
<companion_cube> nicoo: how could you share values? private types are distinct every time
<mrvn> companion_cube: that's why classes have member variables
<companion_cube> mrvn: but I don't write all my code in a single class
<nicoo> companion_cube: I was still talking about your exemple (having separate hashconsed-stuff)
<companion_cube> it's thousand of lines, as I said
<companion_cube> nicoo: well, it can then be used to put mutability in hashconsed stuff, yes ;)
<mrvn> companion_cube: wrapping a functor around it has the same effect in ocaml
<nicoo> companion_cube: You made my brain explode and weep at “mutability in hashconsed stuff”
<nicoo> Mmmh, actually, I could see the use if you are mutating a sub-problem into an equivalent (but simpler) subproblem, as sharing would be helpful
<nicoo> But then, shouldn't it be safely shareable ?
<nicoo> (modulo thread-safety)
<companion_cube> let me detail why: I have mathematical objects (clauses), that I hashcons; but in the context of proving their state changes (they may be redundant, for instance)
<companion_cube> which is most efficiently dealt with by putting a flag "redundant" in the clause itself
<nicoo> But how do you ensure that clauses are only shared in contexts where “being redundant” is the same over all uses of the clause?
<companion_cube> such contexts would be distinct instanciations of the functor
<companion_cube> (one instance of the functor = 1 problem = one "being redundant" state)
avsm has joined #ocaml
<companion_cube> also, I need some global values that are used everywhere (a term ordering and a few heuristics)
<nicoo> Ok, now I see
* nicoo is thus enlightened.
dant3 has joined #ocaml
<companion_cube> :D
cyanure__ has joined #ocaml
milosn has quit [Ping timeout: 246 seconds]
smerz has quit [Ping timeout: 245 seconds]
oriba has joined #ocaml
tane has quit [Quit: Verlassend]
avsm has quit [Quit: Leaving.]
philtor has quit [Ping timeout: 246 seconds]
milosn has joined #ocaml
tane has joined #ocaml
<oriba> I want to try ulex, and use OCamlMakefile... will that work together without problems? Are there examples for ulex somewhere? Did not found something that could help me...
uggwar has joined #ocaml
avsm has joined #ocaml
struktured has joined #ocaml
<companion_cube> no idea
avsm has quit [Quit: Leaving.]
ggole has quit []
lovethroat has quit [Ping timeout: 265 seconds]
klrr has joined #ocaml
cyanure__ has quit [Remote host closed the connection]
tlockney_away is now known as tlockney
tlockney is now known as tlockney_away
klrr has quit [Remote host closed the connection]
<uggwar> new to ocaml, so i'm reading through real world ocaml. getting some errors running the first Core_bench example: http://pastebin.com/jf5sW8Vc
<uggwar> didn't find anything in the errata about this either
<companion_cube> maybe you're not using the right version?
<companion_cube> the signature of bench clearly isn't the expected one
<uggwar> yes, that looks right. the version of core_bench used in the book isn't obvious. maybe i should just read some current core_bench documentation and try to rewrite it
nataren has joined #ocaml
ulfdoz has quit [Ping timeout: 252 seconds]
nataren has quit [Ping timeout: 252 seconds]
<companion_cube> I'm surprised they didn't write versions in the preamble
<uggwar> i need to have another look. i agree, it sounds weird
<adrien> gasche: hahah, thanks for the roscidus/lablgtk link
<adrien> bernardofpc: "ml_point_array_new(0)" doesn't seem to make much sense; I'm not sure it should raise an exception but at least you should check why it is being called with a length of 0
<uggwar> nope, they only write that they're using Core and it's installed with opam :-P
arj has quit [Quit: Leaving.]
<companion_cube> uggwar: hmmmpf.
<adrien> seems to be used for polygons and a polygon of 0 side is "surprising"
<companion_cube> that might be a good idea to email them to update the online version of RWO
<companion_cube> so that they specify which versions of the libraries they use
<uggwar> agree. will do so. otherwise an excellent book tho :)
<uggwar> and i'm enjoying ocaml a lot. fantastic environment aswell, utop, opam etc
<companion_cube> nice to hear that!
<uggwar> and now i just discovered merlin... :) nice since i'm a vim addict
<companion_cube> nice to hear that (again)
<companion_cube> welcome here anyway
<uggwar> thanks :)
kakadu_ has joined #ocaml
Kakadu has quit [Ping timeout: 272 seconds]
<bernardofpc> adrien: somehow a canvas was getting a resize event to 1x1, and that made me pass a [] to the function
<bernardofpc> it's strange that it got this 1x1 thing (during application launch)
<adrien> hmm, I see
<bernardofpc> point array is also used to draw isolated points
<adrien> would you say that your code that lead to passing [] had a flaw or that it's a code that could be done fairly commonly?
<bernardofpc> it probably had a flaw (in that I could test the size and draw points only if there *were* points to be drawn)
<bernardofpc> and eventually as the code evolved this part got removed ^^
tobiasBora has quit [Read error: No route to host]
tobiasBora has joined #ocaml
avsm has joined #ocaml
dant3 has quit [Remote host closed the connection]
<adrien> I meant a logic flaw
<bernardofpc> It's hard to tell
<adrien> or in other words: is there a lablgtk bug or is it a case noone should reach?
<bernardofpc> I'm not sure, exactly because of what you meant
<bernardofpc> making an Array of 0 length is somewhat useless
<adrien> but it's still valid sometimes
<bernardofpc> but maybe the method #points (and all other that end up using PointArray's) should tell that they expect to be given a non-empty list
wolfnn has joined #ocaml
<bernardofpc> I guess that it would be simple to correct, and have no effect whatsoever if on the Gtk side it handles an empty array by doing nothing
<bernardofpc> but that might not be true
<adrien> I can't tell right now and it might be better to leave it like it is if it helps find application bugs
axiles has quit [Remote host closed the connection]
ocramz has joined #ocaml
ollehar has quit [Ping timeout: 246 seconds]
ollehar has joined #ocaml
angerman has quit [Quit: Gone]
ocramz has quit [Quit: ocramz]
kakadu_ has quit [Quit: Konversation terminated!]
nataren has joined #ocaml
rainbyte has quit [Quit: Leaving]
nataren has quit [Remote host closed the connection]
lostcuaz_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
palomer has joined #ocaml
Simn has quit [Quit: Leaving]
rand000 has quit [Quit: leaving]
<sheijk> does anyone know why opam might not see the latest version of a package? i'm trying to update to merlin 1.5 but my opam keeps claiming 1.4.1 is the latest even after updating
<sheijk> only unusual thing with this package is that i used to have it pinned to a local git version. but merlin has been removed and unpinned and it still does not show the latest version
<def-lkb> sheijk: you're not using the good adress for repository
<def-lkb> (it has changed in an earlier update of opam)
<def-lkb> address*
<def-lkb> probably you should update opam binary or check how to update the local config on opam website
<sheijk> good address?
<def-lkb> opam repo: https://opam.ocaml.org
<def-lkb> $ opam repo
<def-lkb> on your computer probably returns the old url
<sheijk> oh, i still have opam 1.0.0 instead of the current one installed
<sheijk> will update it
<def-lkb> :)
<def-lkb> check the documentation, there might be a trick or two to make sure upgrade suceeds
nikki93 has quit [Remote host closed the connection]
avsm has quit [Quit: Leaving.]
uggwar has quit [Quit: leaving]
struktured has quit [Ping timeout: 265 seconds]
lovethroat has joined #ocaml
Eyyub has joined #ocaml
tlockney_away is now known as tlockney
Eyyub has quit [Read error: Operation timed out]
tane has quit [Quit: Verlassend]
Eyyub has joined #ocaml
oriba has quit [Quit: oriba]
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
Eyyub has quit [Ping timeout: 260 seconds]
struktured has joined #ocaml
zpe has quit [Ping timeout: 265 seconds]
Eyyub has joined #ocaml
philtor has joined #ocaml
zpe has joined #ocaml
shinnya has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Ping timeout: 272 seconds]
hcarty has quit [Ping timeout: 272 seconds]
tlockney is now known as tlockney_away
hcarty has joined #ocaml
Eyyub has quit [Ping timeout: 260 seconds]
csakatoku has joined #ocaml
Eyyub has joined #ocaml
philtor has quit [Ping timeout: 272 seconds]
csakatoku has quit [Remote host closed the connection]
Thooms has quit [Ping timeout: 272 seconds]
aurynj has quit [Quit: Leaving]
zpe has joined #ocaml
tobiasBora has quit [Quit: Konversation terminated!]
hcarty has quit [Ping timeout: 264 seconds]
hcarty has joined #ocaml
lovethroat has quit [Ping timeout: 265 seconds]
zpe has quit [Ping timeout: 260 seconds]
darkf has joined #ocaml
Eyyub has quit [Ping timeout: 252 seconds]
darkf_ has joined #ocaml
darkf has quit [Disconnected by services]
darkf_ is now known as darkf
tnguyen_ has quit [Quit: Leaving]
tnguyen_ has joined #ocaml
philtor has joined #ocaml
mmachenry has joined #ocaml
madroach has quit [Ping timeout: 252 seconds]
madroach has joined #ocaml
<mmachenry> I am having a hard time making my OUnit tests build properly with Oasis. I'm wondering if someone could take a look at my project and tell me what I'm doing wrong. I am try to build a test executable and it needs my code as a dependency. The only way I've been able to get it to work is to make a Library entry in my _oasis file for every .ml file in my project. https://github.com/dskippy/pcf/blob/master/_oasis
<mmachenry> I'm pretty sure there's a better way to do this but it's not really documented well and trolling github for projects that use ounit and oasis hasn't really lead me anywhere.
<Drup> you are the first person I've seen that use the legitimate meaning of trolling, congratulations for that :O
<Drup> (sorry, I don't use OUnit, can't help you)
NoNNaN has quit [Remote host closed the connection]
NoNNaN has joined #ocaml
mmachenry1 has joined #ocaml
mmachenry has quit [Read error: Connection reset by peer]
<mmachenry1> Thanks, drup. :
mmachenry1 is now known as mmachenry
palomer has quit [Ping timeout: 245 seconds]
aurynj has joined #ocaml
madroach has quit [Read error: Connection timed out]
<smondet> mmachenry: Jane St uses oUnit: https://github.com/janestreet/bin_prot/blob/master/_oasis
madroach has joined #ocaml
array has joined #ocaml
<mmachenry> Checking
zpe has joined #ocaml
csakatoku has joined #ocaml