adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.02.2 announced http://ocaml.org/releases/4.02.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
monod has quit [Quit: Sto andando via]
SomeDamnBody has joined #ocaml
tennix has quit [Ping timeout: 265 seconds]
MercurialAlchemi has quit [Ping timeout: 264 seconds]
keen__________11 has joined #ocaml
keen__________10 has quit [Ping timeout: 255 seconds]
smtb has quit [Quit: WeeChat 0.4.2]
Algebr has joined #ocaml
Algebr has quit [Ping timeout: 252 seconds]
rgrinberg has joined #ocaml
c74d3a4e has quit [Ping timeout: 252 seconds]
echo-area has quit [Remote host closed the connection]
browncodes has quit [Remote host closed the connection]
tnguyen has joined #ocaml
rgrinberg has quit [Ping timeout: 240 seconds]
swgillespie has joined #ocaml
tennix has joined #ocaml
tibor_ has quit [Quit: Page closed]
tennix has quit [Client Quit]
rgrinberg has joined #ocaml
echo-area has joined #ocaml
raphaelss has joined #ocaml
tibor_ has joined #ocaml
c74d3a4e has joined #ocaml
ygrek has joined #ocaml
rgrinberg has quit [Ping timeout: 240 seconds]
nullcatxxx_ has joined #ocaml
nullcatxxx_ has quit [Read error: Connection reset by peer]
nullcatxxx_ has joined #ocaml
nullcatx_ has joined #ocaml
nullcatxxx_ has quit [Read error: Connection reset by peer]
habnabit is now known as _habnabit
ygrek has quit [Ping timeout: 250 seconds]
Algebr has joined #ocaml
rgrinberg has joined #ocaml
ygrek has joined #ocaml
Algebr has quit [Remote host closed the connection]
Algebr has joined #ocaml
mcc has quit [Quit: This computer has gone to sleep]
browncodes has joined #ocaml
darkf has joined #ocaml
browncodes has quit [Remote host closed the connection]
bjorkintosh has quit [Quit: Leaving]
browncodes has joined #ocaml
toomuchtvrotsurb has joined #ocaml
nullcatx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bjorkintosh has joined #ocaml
browncodes has quit [Remote host closed the connection]
MercurialAlchemi has joined #ocaml
nullcatxxx_ has joined #ocaml
mac10688_ has quit [Ping timeout: 268 seconds]
mea-culpa has quit []
struk|desk has joined #ocaml
<struk|desk> companion_cube: u around? question about containers
moei has quit [Quit: Leaving...]
moei has joined #ocaml
Algebr has quit [Ping timeout: 246 seconds]
MercurialAlchemi has quit [Ping timeout: 264 seconds]
struktured has joined #ocaml
kushal has joined #ocaml
shinnya has quit [Ping timeout: 260 seconds]
jimt has quit [Ping timeout: 272 seconds]
jimt has joined #ocaml
browncodes has joined #ocaml
toomuchtvrotsurb has quit [Remote host closed the connection]
ggole has joined #ocaml
raphaelss has quit [Quit: Leaving]
MercurialAlchemi has joined #ocaml
<companion_cube> struk|desk: yep
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tmtwd has joined #ocaml
Haudegen has quit [Ping timeout: 256 seconds]
tmtwd has quit [Quit: Leaving]
Haudegen has joined #ocaml
nullcatxxx_ has joined #ocaml
rgrinberg has quit [Ping timeout: 268 seconds]
oscar_toro has joined #ocaml
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
kushal has quit [Read error: Connection reset by peer]
kushal has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ely-se has joined #ocaml
swgillespie has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rgrinberg has joined #ocaml
SomeDamnBody has quit [Ping timeout: 264 seconds]
sh0t has joined #ocaml
rgrinberg has quit [Ping timeout: 250 seconds]
sh0t has quit [Ping timeout: 244 seconds]
bitbckt has quit [K-Lined]
sh0t has joined #ocaml
bitbckt has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 240 seconds]
orbifx has joined #ocaml
MercurialAlchemi has joined #ocaml
sh0t has quit [Ping timeout: 246 seconds]
browncodes has quit [Remote host closed the connection]
larhat2 has quit [Quit: Leaving.]
<orbifx> ls
rgrinberg has joined #ocaml
browncodes has joined #ocaml
ygrek has quit [Ping timeout: 240 seconds]
struktured has quit [Ping timeout: 264 seconds]
rgrinberg has quit [Ping timeout: 240 seconds]
thmslld has quit [Ping timeout: 240 seconds]
infinity0_ has joined #ocaml
infinity0_ has quit [Changing host]
infinity0_ has joined #ocaml
infinity0 has quit [Ping timeout: 260 seconds]
native_killer has joined #ocaml
native_killer has quit [Remote host closed the connection]
native_killer has joined #ocaml
infinity0_ has quit [Remote host closed the connection]
jonludlam has joined #ocaml
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
<tobiasBora> Hello !
<tobiasBora> I have a question : I use the Lwt_process.exec command with stdout configured with (`FD_copy (Unix.descr_of_out_channel stdout))
<tobiasBora> however the Lwt_process display isn't written in the good order, there are usually displayed above the displays with Printf.printf.
<tobiasBora> Does anyone knows why ?
<flux> tobiasbora, do you use %! to flush in printf or other means of flushing?
<tobiasBora> flux: Yes, I even do some of them just before the process call to be sure the buffer is flushed.
<tobiasBora> is it bad ?
Kakadu has joined #ocaml
Haudegen has quit [Ping timeout: 260 seconds]
yomimono has joined #ocaml
<flux> no, it's good to use flushing
rossberg has quit [Ping timeout: 246 seconds]
<flux> I need to be going in a few minutes, but maybe you can give something to go on on a pastebin or something.
ely-se has quit [Quit: leaving]
rgrinberg has joined #ocaml
ely-se has joined #ocaml
infinity0 has quit [Ping timeout: 265 seconds]
Haudegen has joined #ocaml
rgrinberg has quit [Ping timeout: 264 seconds]
infinity0 has joined #ocaml
rossberg has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
<tobiasBora> flux: Hum I found the problem :
<tobiasBora> I defined my own printf function with
<tobiasBora> let pr x =
infinity0 has quit [Remote host closed the connection]
<tobiasBora> Printf.ksprintf (fun s ->
<tobiasBora> if true then Printf.printf "%s" s
<tobiasBora> else ())
<tobiasBora> x
<tobiasBora> but I suppose that when I run "%!" in pr "%!", the "%!" is evaluated nowhere
<tobiasBora> and isn't given to Printf.printf
<tobiasBora> so I put "%s%!" instead of "%s" and it seems to work !
<tobiasBora> Thank you !
<tobiasBora> (by the way if anyone has some details about the strange "format" syntax I am interested in it !)
infinity0 has joined #ocaml
schoppenhauer has quit [Quit: Adé]
echo-area has quit [Remote host closed the connection]
oscar_toro has quit [Ping timeout: 272 seconds]
rgrinberg has joined #ocaml
oscar_toro has joined #ocaml
rgrinberg has quit [Ping timeout: 240 seconds]
freehck has joined #ocaml
Simn has joined #ocaml
ely-se has quit [Quit: leaving]
ceryo has joined #ocaml
hcarty1 has joined #ocaml
tane has joined #ocaml
octachron has joined #ocaml
rgrinberg has joined #ocaml
rgrinberg has quit [Ping timeout: 250 seconds]
rgrinberg has joined #ocaml
__uu__ has joined #ocaml
ely-se has joined #ocaml
shinnya has joined #ocaml
ygrek has joined #ocaml
echo-area has joined #ocaml
beginner has joined #ocaml
<beginner> what is the current status of opam for windows?
<Drup> being worked on
<beginner> is there any information on the release date?
chris2 has quit [Quit: trotz alledem!]
chris2 has joined #ocaml
<Drup> when it's ready :p
ollehar has joined #ocaml
native_killer has quit [Ping timeout: 244 seconds]
BitPuffin has joined #ocaml
Bluddy has quit [Quit: Connection closed for inactivity]
freehck has quit [Quit: Page closed]
<ely-se> Vagrant :P
ygrek has quit [Ping timeout: 255 seconds]
ollehar has quit [Ping timeout: 256 seconds]
ely-se has quit [Quit: leaving]
orbifx has quit [Ping timeout: 256 seconds]
ely-se has joined #ocaml
orbifx has joined #ocaml
ely-se has quit [Quit: leaving]
MercurialAlchemi has quit [Ping timeout: 240 seconds]
freehck has joined #ocaml
<freehck> hi2all
shinnya has quit [Ping timeout: 268 seconds]
marsam has joined #ocaml
native_killer has joined #ocaml
<apache2> can I do pattern matching on arrays?
<hcarty1> apache2: Yes
<apache2> match myarray with ["foo"] -> ... ?
<hcarty1> apache2: [| ... |]
<apache2> thanks!
<apache2> how about empty varrays?
<def`> [||]
<apache2> thanks!
<flux> how about arrays of variable length? :-(
<hcarty1> flux: match a with [||] -> .. | [|e1|] -> .. | [|e1; e2|] -> ... (out to forever) :-)
hcarty1 is now known as hcarty
<apache2> I can do | [| h ; _ |] -> ..
yomimono has quit [Ping timeout: 268 seconds]
<apache2> if I only care about the first element, right? like h :: _ for lists?
<Drup> No, that doesn't work
<Drup> It would only match an array with two elements
<apache2> ok, so only option for me is Array.get foo 0 with a try .. match around?
<Drup> or test Array.length before
marsam has quit [Read error: Connection reset by peer]
<octachron> why not use "foo.(0)"?
<flux> if you want to use a patetrn match, then you can use pattern guards
jeffmo has joined #ocaml
<def`> or write a safe getter : 'a array -> int -> 'a option
<flux> but you still need to use the length check if you don't want to deal with exceptions
<apache2> I'd rather try .(0) with .. than having to sum up the entire length of the array
<apache2> intuitively seems cheaper
<hcarty> Or you can match on the length, but that doesn't offer much over a few if branches
<def`> 0_∆
marsam has joined #ocaml
<flux> I suppose .(0) is going to check the length regardless, so it's cheaper to then handle the exception if it's a rare occurrence
<flux> if it's a common case then perhaps checking array length beforehand is a faster approach
<flux> but, the question you need to think about - do you care?-)
<Drup> apache2: your intuition is wrong. :p
<flux> I think try/catch if the exception is never thrown is very very cheap?
<tane> shouldn't array length be in O(1)?
<apache2> ah because it stores the length right
<flux> and not a lot more expensive even if the exception is thrown?
<def`> and discussing that kind of performance on a modern computer... :(
<def`> flux: cheap in both case, O(1)
<flux> well, everything becomes expensive if you do it for, say, hd video and for each pixel ;)
<freehck> apache2: arr.(0) contains the first element of the array arr. If you wanna get the length of array you should use 'Array.length arr'
<def`> be careful however, backtraces are a bit more expensive
<def`> (if you really care about perf)
<freehck> apache2: what do u really want to do?
<def`> flux: then you should achange your tools :)
<apache2> freehck: I just want to get the first element of an array
<apache2> I'll do an if Array.length
SomeDamnBody has joined #ocaml
<freehck> apache2: why don't u like this: try arr.(0) with Invalid_argument _ -> "Some default"
<Drup> Please don't match on Invalid_argument
<Drup> just don't
<flux> why not?
<freehck> apache2: or of course u can use this: if (Array.length arr) > 0 then arr.(0) else "Some default"
<freehck> Drup: Array.get raises Invalid_argument "index out of bounds" if index is wrong.
<freehck> So it's the right way in this case.
<Drup> freehck: No it's not, the right way is to check that you are not giving stupid indexes :)
yomimono has joined #ocaml
<flux> no, clearly the exception version is shorter, therefore better and nicer all around
<freehck> Drup: what's the difference for the examples above?
<flux> also less repetition!
MercurialAlchemi has joined #ocaml
<Drup> invalid_argument is to signal that the code is violating some invariants about the function you are using (here, Array.get). It should not be raised and caught, you are supposed to check the invariant to avoid it (and use options)
<freehck> def`: heathen! :)
<def`> and beware of -unsafe compiler flag
oscar_toro has quit [Ping timeout: 250 seconds]
ely-se has joined #ocaml
<freehck> Drup: I dont know why Array.get raises specifically Invalid_argument instead of some Out_of_bounds exception. It should be raised and catched this way, because (obviously) it's a normal situation when a programmer's trying to get a value out of bound of some array.
<freehck> Drup: So I think Invalid_argument is not a quite good decision for exception in this case.
<freehck> But the standard library uses it, so we must to follow the rules.
<freehck> *must follow
<octachron> freehck: the out of bound check can be disabled by a compiler option, so any out of bound exception would be unreliable
Bluddy has joined #ocaml
<freehck> octachron: oh, really?
<freehck> okay, so I am completely wrong.
<apache2> ew, imperative
<freehck> apache2: don't use the 1st example.
<flux> it affects .(x) only though?
<flux> Array/String.get is always checked?
<ggole> It's checked unless you compile with -unsafe
<flux> or maybe not
<ggole> Array/String.unsafe_get/set are always unchecked.
<flux> it seems that .(0) is converted to .unsafe_xxx as expected
<flux> with -unsafe
<flux> whereas regularly it's of course compiled to .get/.set
<flux> so I imagine -unsafe does not affect the functionality of the functions
<ggole> I guess you could module Array = CheatingArray at the top of the file and intercept the rewrite
<freehck> Wait-wait-wait. Do I ubderstabd right that .(x) is Array.get if -unsafe is not enabled, and otherwise it's Array.unsafe_get?
<ggole> Yep.
<freehck> *understand
<freehck> cool. thx.
<octachron> beware that the rewriting from .() to Array.get/set is not here anymore in the dev version of the compiler
ely-se has quit [Quit: leaving]
<flux> hmm, so I wonder how the -unsafe switch works there?
cball has quit [Ping timeout: 246 seconds]
<freehck> octachron: what does mean 'is not here'?
<freehck> here is where?
<flux> 'there'
<flux> .(x) uses some other mechanism than rewriting
<flux> currently .(x) is literally rewritten to Array.xxx
<flux> you can define your own Array module and it gets called
<octachron> flux, there are new compiler primitives whose behavior is controled by -unsafe
<ggole> Is this part of flambda?
<hcarty> ggole: Separate
<ggole> Hmm, interesting.
<flux> flambda is not integrated yet to master is it?
<ggole> Guess I should stop suggesting that awful hack
<flux> ..you've been suggesting that awful hack?-)
ely-se has joined #ocaml
<ggole> Mostly because it is intriguingly disgusting.
<ggole> And no, not as a serious development practice.
<apache2> are there any plans to port the bitstring module to the new immutable string paradigm?
nullcatxxx_ has joined #ocaml
cball has joined #ocaml
ely-se has quit [Quit: leaving]
<nicoo> apache2: bitstring was written by Richard WM Jones, so you are better off asking him. In any case, porting it to use ppx rather than camlp4 would be more pressing.
* nicoo also doesn't see what is so new or paradigm-y about immutable strings.
<apache2> ah, perhaps that's what I meant. I'm not so well-versed in the ocaml ecosystem yet
<nicoo> No, the ppx vs. camlp4 issue is completely different. Basically, both are mechanisms for implementing language extensions; camlp4 is more powerful, but not-so-nice to work with and camlp4 extensions do not compose well.
ollehar has joined #ocaml
thmslld has joined #ocaml
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Kakadu has quit [Ping timeout: 246 seconds]
nullcatxxx_ has joined #ocaml
tg has quit [Ping timeout: 255 seconds]
yomimono has quit [Ping timeout: 240 seconds]
orbifx has quit [Quit: WeeChat 1.3]
ollehar has quit [Ping timeout: 256 seconds]
<tibor_> How can I compare two strings?
<tibor_> match s1 with
<tibor_> match s1 with s2 -> true | _ -> false;;
<tibor_> ?
<Drup> s1 = s2 ?
<ggole> String.compare?
<tibor_> let eq s1 s2 = if s1 = s2 then true else false;;
<tibor_> let eq s1 s2 = if 0 = String.compare s1 s2 then true else false;;
<Drup> tibor_: think very hard about this if expression,then simplify it
tg has joined #ocaml
<tibor_> I have a simple bug and I can't manage to fix it
<tibor_> if something || String.compare s1 s2 then x1 else x2;; something is always false and s1 <> s2 but then how can x1 execute?
ofzyh has joined #ocaml
<ggole> Well, String.compare returns an int, so I suppose that should be String.compare s1 s2 = 0 (which indicates they are equal)
<tibor_> yes
<ggole> If you've got that right, then x1 should not execute indeed
^elyse^ has joined #ocaml
<tibor_> if something || 0 = String.compare s1 s2 then x1 else x2;;
<tibor_> Yes :( I'm very confused
<octachron> tibor_, is the prevously line *exactly* your code?
<ggole> Pastebin the code, maybe
<ggole> By the way, if you have adopted the 0 = expr test trick from C, that isn't necessary in OCaml - the error it is intended to avoid isn't possible
Tekilla has joined #ocaml
<tibor_> no : let strcmp = match s1 "some string"-> true | _ -> false;
<Drup> ggole: I don't even know that thing, what is it ?
<ggole> Writing if (0 == expr) instead of if (expr == 0) to avoid the = vs == mistake
<tibor_> if something || 0 = strcmp s1 then x1 else x2;;
<ggole> That is, if you typo == as = it will fail to compile instead of just doing something wacky
<ggole> I've heard them called "Yoda conditions"
<Drup> ggole: ah, I see, that is ... C
shinnya has joined #ocaml
<jerith> In Java and friends, "foo".equals(thing) allows one to avoid a null check.
<jerith> (That's where I got into the habit of putting the constant first when comparing.)
<octachron> tibor_, a possibility, if x1 and x2 have side-effect and you have them defined as "let x1=.. in", then the side effect have already been executed before the if _ else _
<octachron> otherwise, you should probably pastebin your code. Predicting misunderstanding is hard.
HoloIRCUser1 has joined #ocaml
<tibor_> let isC str = match str with | "%#sdfdf$%" -> true | _ ->false;;
<tibor_> f = if !flag || Sess.is c then x1 else x2;; and found x1 in my f but flag is false and c <> "%#sdfdf$%"
jwatzman|work has joined #ocaml
HoloIRCUser1 has quit [Remote host closed the connection]
tane has quit [Quit: Verlassend]
HoloIRCUser1 has joined #ocaml
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Haudegen has quit [Ping timeout: 250 seconds]
HoloIRCUser1 has quit [Remote host closed the connection]
<octachron> tibor_, how did you deduce that your error is in this code fragment and not somewhere before?
HoloIRCUser has joined #ocaml
jonludlam has quit [Ping timeout: 252 seconds]
HoloIRCUser has quit [Remote host closed the connection]
tane has joined #ocaml
<SomeDamnBody> I am using ocamlgraph, and I'm having difficulty with the fact that the module functors that I pass in that define operations and types of nodes and edges respectively don't expose type equality outside of the module itself
<SomeDamnBody> so I have module NodeAreInts = struct type t = int;; let compare = max end
Haudegen has joined #ocaml
<SomeDamnBody> but later, I try and manipulate nodes with regular functions that take ints and the compiler is not having any of it because int != G.NodesAreInts.t
toomuchtvrotsurb has joined #ocaml
tani has joined #ocaml
<Drup> compare = max ???
tane has quit [Ping timeout: 244 seconds]
<Drup> (also, please pastebin the whole code)
psy_ has joined #ocaml
psy_ has quit [Max SendQ exceeded]
blueperson1102 has joined #ocaml
psy_ has joined #ocaml
nullcatxxx_ has joined #ocaml
mserpent has joined #ocaml
kushal has quit [Ping timeout: 246 seconds]
blueperson1102 has quit [Remote host closed the connection]
<mrhmouse> SomeDamnBody: could you pastebin an example? is NodesAreInts.t an int or is it an abstract type?
<mrhmouse> SomeDamnBody: https://ideone.com/E9HaQP this works, for example
Algebr has joined #ocaml
<mrhmouse> SomeDamnBody: this doesn't https://ideone.com/LowVKV
ygrek has joined #ocaml
kushal has joined #ocaml
<SomeDamnBody> mrhmouse, NodesAreInts.t is an int
<SomeDamnBody> so I have module NodeAreInts = struct type t = int;; let compare = max end
<ggole> It'll be the functor application that's hiding the type
<SomeDamnBody> ggole, how do I expose it? Use some kind if with magic?
<ggole> Yeah, with
<ggole> eg, if you were to name the type of a functor application in a signature, you would say Map.S with type t = int
<pippijn> let compare = max
<def`> SomeDamnBody: as Drup said, compare = max ???
<pippijn> that's an interesting comparison operator
<SomeDamnBody> one sec
<SomeDamnBody> where do I put with?
<pippijn> max 1 2 > 0; max 2 1 > 0
<pippijn> => oops
<pippijn> no order
<ggole> SomeDamnBody: on the *type* of the functor application, eg, in the .mli
<SomeDamnBody> pippijn, oh wait, I put compare = max above before I pastebinned the actual code
<SomeDamnBody> the actual code doesn't contain that
<SomeDamnBody> ggole, the application of the functor to resolve to a module is done in the same module where it's being used
<ggole> Oh, hmm
<SomeDamnBody> well actually it could be that I misdiagnosed what the issue was
<SomeDamnBody> effectively, I think that what I summarized is the problem, but the actual compiler error is:
<SomeDamnBody> Error: This expression has type float but an expression was expected of type
<SomeDamnBody> G.edge = InsnNodes.t * ProbabilisticEdges.t * InsnNodes.t
<ggole> Looking at the ocamlgraph docs, they seem to expose the type equalities using with
<ggole> So you shouldn't be having trouble there, unless I misunderstand
<ggole> Sounds like a boring old type error.
<SomeDamnBody> well, merlin is reporting something different from what the compiler does
<SomeDamnBody> G.edge = float if I am right, I have no idea where this node * edge * node business is coming from
<SomeDamnBody> I'm taking the maximum float of a group of edges that are touching a node
<SomeDamnBody> with this code:
ollehar has joined #ocaml
<ggole> If merlin reports different errors to the compiler, trust the compiler's
<SomeDamnBody> ok I got them in sync now
<octachron> SomeDamnBody, the type of G.edge is defined by the ConcreteBidirectionnalLabeled functor to be G.edge = vertex * base_edge * vertex
<SomeDamnBody> oh lol whoops
<SomeDamnBody> thanks
rgrinberg has quit [Ping timeout: 244 seconds]
octachron has quit [Quit: Leaving]
freling1 has joined #ocaml
freling1 has quit [Client Quit]
mserpent has quit [Remote host closed the connection]
blueperson1102 has joined #ocaml
TheLemonMan has joined #ocaml
__rlp_ is now known as __rlp
rgrinberg has joined #ocaml
slash^ has joined #ocaml
jeffmo has quit [Ping timeout: 255 seconds]
j0sh__ is now known as j0sh
native_killer has quit [Ping timeout: 246 seconds]
tristero has quit [Quit: tristero]
systmkor has joined #ocaml
systmkor has quit [Remote host closed the connection]
systmkor has joined #ocaml
yomimono has joined #ocaml
blueperson1102 has quit [Remote host closed the connection]
jeffmo has joined #ocaml
<struk|desk> companion_cube: do you have any plans to add a result or or_error type to containers, or do you want users to consider using rresult, core's or_error, or argarwal/future instead?
lwlvlpl has quit [Quit: Updating details, brb]
strmpnk has joined #ocaml
yomimono has quit [Ping timeout: 250 seconds]
yomimono has joined #ocaml
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
yomimono has quit [Ping timeout: 260 seconds]
yomimono has joined #ocaml
ril has joined #ocaml
kushal has quit [Ping timeout: 255 seconds]
thmslld has quit [Ping timeout: 264 seconds]
Tekilla has quit [Quit: Quitte]
darkf has quit [Quit: Leaving]
tmtwd has joined #ocaml
<companion_cube> struk|desk: there is CCError for this, using poly variants
<companion_cube> once the stdlib result arrives, I will probably add CCResult
kushal has joined #ocaml
<adrien> "there is a CC* for everything"
NingaLeaf123 has quit [Quit: Leaving]
<zozozo> companion_cube: with the stdlib result type, will CCError use it, or keep the same type with poly variants ?
tmtwd has quit [Remote host closed the connection]
sh0t has joined #ocaml
<companion_cube> I think I will keep the poly variant, for retrocompat
yomimono has quit [Ping timeout: 268 seconds]
yomimono has joined #ocaml
<Drup> meh
<Drup> don't
<companion_cube> don't preserve retrocompat ?
yomimono has quit [Ping timeout: 255 seconds]
<Drup> In this case, yes. It's better to be compatible with the rest of the ecosystem
<companion_cube> well I'm not sure the ecosystem will move instantly toward the result type
<companion_cube> e.g. will Bunzli break all his libraries?
<Drup> Bunzli already made Rresult, which will be compatible with the stdlib thing, and is moving towards using it instead
<companion_cube> so he's breaking his libraries?
<companion_cube> well I will have a transition period, I guess
thmslld has joined #ocaml
<companion_cube> or I could break everything and put labels and stuff, sure
BitPuffin has quit [Ping timeout: 268 seconds]
<Drup> I think the first step is to tell everyone to use function constructor and avoid manual pattern matching, then the transition is painless
<companion_cube> yeah
<hcarty> Drup: 'R.ok v' vs 'Ok v'?
<companion_cube> CCError.catch
<Drup> yes
<companion_cube> sometimes I really want labels in containers, btw
<companion_cube> like, today
<adrien> it's a good thing you can add them :P
<companion_cube> well not without breaking compat or duplicating a lot of code, sadly :/
<adrien> you should have made the API label-only :P
<companion_cube> I was young and foolish
<companion_cube> ;)
<hcarty> If we're wishing, I want a way to cleanly mix rresult with lwt!
<ggole> Having users is the worst thing for a library other than not having any users.
<hcarty> And implicit modules. I'm hoping I get all of my wishes within the next year.
<companion_cube> yeah
<companion_cube> and flambda
<Drup> and .... and .... and ...
<Drup> oh fuck, I created C++
<companion_cube> and that's it :p
<Drup> :D
<companion_cube> and remove objects :p
<companion_cube> so that we don't have C++
slash^ has quit [Read error: Connection reset by peer]
<Drup> objects are really not the most complicated things in OCaml
<ggole> They sure are the thing you'd rip out first though.
<Drup> I certainly hope we can rip Stream out first, but that's not a language thing
<companion_cube> Drup: well, they are the most complicated to use imho
<hcarty> companion_cube: ∅Caml?
<companion_cube> just look at the error messages
<Drup> companion_cube: eh, module much ? poly variants ?
shinnya has quit [Ping timeout: 255 seconds]
<companion_cube> no
<companion_cube> poly variants are so much easier
<companion_cube> don't have self types, for one
<def`> ok my wishes: I want erlang/smalltalk like introspection, and a high-quality GUI toolkit
* Drup smiles devilishly as maintainer and user of tyxml.
<Drup> companion_cube: actually, they do.
natrium1970 has joined #ocaml
<ggole> Polymorphism makes introspection a bit tough
<def`> I know :(
<companion_cube> 'a ty wouldn't satisfy you?
<def`> it would surely be better than nothing
yomimono has joined #ocaml
<natrium1970> When I run “opam show js_of_ocaml”, I see the line “version: 2.6” and under available versions, it shows “1.2, 1.3.1, 1.3.2, 1.4.0, 2.0, 2.1, 2.2, 2.3, 2.4, 2.4.1, 2.5, 2.6”. However, if I run “opam install js_of_ocaml”, it installs 2.5. I want 2.6.
<ggole> You could try to associate an 'a ty with every top level binding and each element of each stack frame
<Drup> natrium1970: pastebin "opam config report"
<ggole> But it turns out not to work
<ggole> Without doing work at runtime
<ggole> I think you could do it with type-passing, but that has a real performance hit afaik
<Drup> natrium1970: install aspcud
<natrium1970> I tried it. I cannot figure out how.
<natrium1970> It was an exercise in frustration.
<hcarty> Drup: How would you avoid explicit pattern matching, and keep relatively clean code, when you have: match a_err, b_err with | Ok _, Error _ -> ... | Ok _, Ok _ -> ... | Error _, Ok _ -> ... | etc.
<def`> ggole: if this feature has runtime cost, nobody will use it
<hcarty> Drup: It's something I run into now and then but haven't come up with a satisfactory option to replace pattern matching.
<natrium1970> Why can’t I just force it to install 2.6? There’s no way to do that?
<Drup> hcarty: no idea in general
<Drup> natrium1970: sure "opam install js_of_ocaml.2.6"
<Drup> but the underlying problem is going to bite you later
<natrium1970> Drup: No package matches js_of_ocaml
<hcarty> Drup: Just thought I'd ask. Matching works well enough.
<Drup> so you should try to install aspcud, but I don't know anything about mac os, so I can't help you much
<natrium1970> Drup: I spent a couple of hours trying to figure out how to install aspcud, and I could not do it.
<ggole> def`: I know
<Drup> natrium1970: that answer is fishy
<ggole> That's why it probably doesn't work.
<natrium1970> Drup: Are you saying that I am lying?
<ggole> :(
thmslld has quit [Ping timeout: 246 seconds]
<Drup> natrium1970: hum, you should also update your opam
<def`> :) too bad
<Drup> natrium1970: No, I meant that "No package matches js_of_ocaml" is fishy :D
<natrium1970> Drup: Updated opam a few days ago.
<ggole> Maybe a clever implementer could get the cost down enough for people to swallow it
<Drup> last version is 1.2.2
<natrium1970> I think I”m just going to give up on opam. I have spend more time hassling with it than is I installed everything from source.
<hcarty> natrium1970: I've had to use Mac OS on occasion. If you use brew and install opam that way then I think it pulls aspcud automatically.
<ggole> I don't think it would be zero, though
<natrium1970> I don’t use brew. All those extra things really create problms for me.
<Drup> how did you installed opam ?
<natrium1970> I believe that I compiled it from source.
<def`> ggole: if it is zero, then nothing happens at runtime :)
<Drup> you *believe* ? :D
<natrium1970> I installed it some quite ago, and I do not recall what steps I took.
yomimono has quit [Ping timeout: 264 seconds]
<Drup> I really don't know mac, I can't help you on that, I heard most people use brew succesfully.
<Drup> Anyway : your opam is not up to date, last is 1.2.2
<natrium1970> I did “opam update” and “opam upgrade” and it still reports 1.2.0.
<Drup> because opam doesn't upgrade itself
<natrium1970> Oh. Maybe i need to rebuild opam from source.
<Drup> port doesn't work for you either ?
<natrium1970> I don’t see the point of those.
<natrium1970> I have a perfectly good Unix (real Unix, not Linux) system. Why would I want to add stuff?
<Drup> and yet you are having issues that would be probably solved with them
yomimono has joined #ocaml
<natrium1970> Even finding aspcud to download is daunting. The link from the opam page is not helpful.
<def`> "perfectly good Unix (real Unix, not Linux)" :DDDDD
<natrium1970> It’s the truth. Linux is not Unix. Mac OS X is.
<Drup> please do not start this troll here, it's not going to end well ^^'
<natrium1970> Nothing ever does for me.
<def`> I know. I know. I know :)
<natrium1970> Anyway, Do I want the prepcessor/wrapper soruces?
<Drup> natrium1970: if you don't want to use aspcud : http://cudf-solvers.irill.org/index.html
<Drup> try that
<Drup> (and, as I said, upgrade your opam)
SomeDamnBody has quit [Ping timeout: 255 seconds]
lobo has joined #ocaml
sh0t has quit [Ping timeout: 240 seconds]
rand__ has joined #ocaml
natrium1970 has quit [Quit: natrium1970]
tmtwd has joined #ocaml
yomimono has quit [Ping timeout: 244 seconds]
yomimono has joined #ocaml
thmslld has joined #ocaml
Kakadu has joined #ocaml
<struk|desk> companion_cube: ahh ccerror. thanks
Haudegen has quit [Ping timeout: 250 seconds]
ril is now known as ril[away]
rgrinberg has quit [Ping timeout: 240 seconds]
nullcatxxx_ has joined #ocaml
orbifx has joined #ocaml
yomimono has quit [Ping timeout: 264 seconds]
yomimono has joined #ocaml
tmtwd has quit [Ping timeout: 268 seconds]
ceryo has quit [Quit: Textual IRC Client: www.textualapp.com]
jonludlam has joined #ocaml
Haudegen has joined #ocaml
<Algebr> What tool or who is using ocaml to statically analyze C code to find vulnerabilties
<def`> frama-c
<def`> though it's not exactly to find vulnerabilities, more to prove absence of them :_
<def`> (you will have a better time tracking vulnerabilities with fuzzers :))
yomimono has quit [Ping timeout: 268 seconds]
larhat1 has joined #ocaml
<Algebr> are there any in ocaml
<def`> fuzzers don't do static analysis
<def`> I am not aware of any in
<def`> C
<def`> OCaml* sorry
freehck has quit [Ping timeout: 246 seconds]
MercurialAlchemi has quit [Ping timeout: 256 seconds]
<adrien> yacfe could be used too
SomeDamnBody has joined #ocaml
<^elyse^> Algebr: I have a tool written in OCaml that can find whether C code has vulnerabilities, but it can't enumerate them.
<Algebr> where is it
<^elyse^> let () = printf "yes\n"
Haudegen has quit [Ping timeout: 246 seconds]
ollehar has quit [Ping timeout: 256 seconds]
<orbifx> :P
rgrinberg has joined #ocaml
<def`> :)
<Algebr> I don't get the joke
<orbifx> Algebr: that snippet always says "yes" (there are vulnerabilities)
<orbifx> a tiny "tool" to tell if you if there are any... not which they are.
<orbifx> probably works 99% of the time :P
ygrek has quit [Remote host closed the connection]
ygrek has joined #ocaml
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Haudegen has joined #ocaml
Algebr` has joined #ocaml
marsam has quit [Remote host closed the connection]
ygrek has quit [Ping timeout: 264 seconds]
Algebr has quit [Ping timeout: 250 seconds]
marsam has joined #ocaml
palomer has joined #ocaml
<palomer> hey guys
<palomer> assume StringPairSet = Set.Make(struct type t = string * string let compare = compare end)
ygrek has joined #ocaml
<palomer> StringPairSet.t <— is this nice and hashable?
<def`> No
<def`> It is hashable, but you'll get structural equality, not something respecting the equality of sets
tani has quit [Quit: Verlassend]
<ggole> You can pass that module to Hashtbl.Make, if that's what you mean
<ggole> (Since it provides an equal element that should do the right thing.)
<ggole> No wait, it doesn't provide hash. You'll have to write a module that *uses* that element, but uses something like Hashtbl.hash for hash.
<def`> Yes!
<ggole> Aargh, too late. Brain not working.
ggole has quit []
<def`> Seppuku. :(
rand__ has quit [Quit: leaving]
ollehar has joined #ocaml
Simn has quit [Quit: Leaving]
rfv has quit [Ping timeout: 256 seconds]
lambdahands has quit [Ping timeout: 240 seconds]
<ollehar> Algebr: checked out the tool facebook bought?
<ollehar> don't remember the name
<ollehar> analyze java, c, c++, made in ocaml
cojy has quit [Read error: Connection reset by peer]
<Drup> infer
msch has quit [Read error: Connection reset by peer]
<ollehar> right, thanks drup
<jwatzman|work> http://fbinfer.com/
<ollehar> ;)
<ollehar> ah, that was over an hour ago!
<Drup> jwatzman|work: do you have an HL on "infer" ? :D
<jwatzman|work> Drup: nope, but I have one on "facebook" in this channel :)
oldmanistan_ has quit [Ping timeout: 256 seconds]
<jwatzman|work> (I don't actually work on Infer, though I worked a tiny bit with the team to help them open source it)
<ollehar> but what if we speak of books with faces in them?
<Drup> I guess it works too. "infer" might be too noisy ^^ '
n1ftyn8_ has quit [Ping timeout: 256 seconds]
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
<ollehar> jwatzman|work: btw, when you're here, any news about LLVM for HHVM?
<jwatzman|work> ollehar: last I heard, it was still being worked on, perhaps on the back burner? I think they got it perf neutral? I don't know for sure
Bluddy has quit [Ping timeout: 264 seconds]
<ollehar> jwatzman|work: hm ok, thanks!
NhanH has quit [Read error: Connection reset by peer]
<ollehar> jwatzman|work: can I ping anyone who works on it? I have a question about php exceptions and llvm function attributes. but I guess that's a c++ team...
<jwatzman|work> ollehar: yeah. you are best off going into #hhvm, bsimmers is a good person to try to poke
<jwatzman|work> he's not in the channel nor at his desk right now though
<ollehar> thanks again!
<ollehar> hm ok
ygrek has quit [Ping timeout: 264 seconds]
<mfp> Drup: I realized RList's make_from_s cannot be safely executed within an update step, and defining a correct one is surprisingly hard
hcarty has quit [Ping timeout: 240 seconds]
<mfp> using make_from (make + using the handle is no good as it performs send x on an internal event, which musn't be done within an update step)
ril[away] has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nullcatxxx_ has joined #ocaml
ril has joined #ocaml
ril has quit [Client Quit]
nullcatxxx_ has quit [Client Quit]
ChezDexter has quit [Quit: ZNC - http://znc.in]
<mfp> it all amounts to this problem: given a 'a React.signal, how do you get an 'a React.event (with the initial value) without waiting for a change, using only combinatorial ops (no primitives like S.value or E.create)
<mfp> so far I've been unable to, using the fixed point operator and/or higher-order signals :-/
xfighter1188 has joined #ocaml
<xfighter1188> hello
<xfighter1188> can someone explain why my first code works
<xfighter1188> but not my second?
<palomer> darn! sets are not usefully hashable!
<xfighter1188> can someone explain
<def`> xfighter1188: your fist call to check_duplicates lacks eq argument
<def`> (line 4)
<xfighter1188> it does?
<xfighter1188> oh it does hold on
<Algebr`> Drup: Say I wanted to use jsoo with nodejs, or whatever, how can I make that happen?
<xfighter1188> i don't think thats the issue tho?
<xfighter1188> oh it is
<xfighter1188> hmmm
<xfighter1188> wow ty
<xfighter1188> why does the error message
<Algebr`> Drup: I'm also interested in using jsoo with Electron, that thing that lets you make cross platform GUI applications.
<xfighter1188> not telkl me anything then
<def`> it tells you that the type of check_duplicates is wront
<def`> wrong*
ollehar has quit [Quit: ollehar]
<xfighter1188> oh
<xfighter1188> okay darn im really bad at reading
<xfighter1188> these ocaml
<xfighter1188> error messages
<bbc_> doesn't it says that `a` is not of the expected type?
<def`> but it can't tell why it is wrong :)
<xfighter1188> Error: This expression has type 'a but an expression was expected of type 'a -> 'b -> bool The type variable 'a occurs inside 'a -> 'b -> bool
<xfighter1188> i thought that it was trying to apply
<xfighter1188> eq to
<xfighter1188> h and t on line 7
<def`> it said line 4
<xfighter1188> i don't see a line number in the error message?
<xfighter1188> unless im blind
<xfighter1188> oh
<xfighter1188> on the website
<xfighter1188> hmmm how come ocaml on my computer doesn't give me the line number thats
<xfighter1188> weird
<xfighter1188> thanks anyawys didn't realize it was just me being dumb
<xfighter1188> can you explain to me how ocaml knows not to apply the function but to pass it in stead?
<xfighter1188> is it because i specified in the parameter?
NhanH has joined #ocaml
<def`> what do you mean?
bbc_ is now known as bbc
<xfighter1188> like
<xfighter1188> if (check_duplicates eq h t)
<xfighter1188> how does it know to not just pass
<xfighter1188> (eq h t)
<xfighter1188> does it do it by type?
<mrvn> xfighter1188: precedence
oldmanistan_ has joined #ocaml
<xfighter1188> can you elaborate a bit haha sory
cojy has joined #ocaml
<mrvn> xfighter1188: in "x y z" x is an expression that gets arguments applied. Anything that comes after that are arguments. Arguments take precedence over any applications you might see in "y z".
<def`> xfighter1188: it surely not do it by type, a property of ocaml is that type don't affect semantics
<def`> yep as mrvn said, it is purely syntactic
<xfighter1188> okay hold on
<xfighter1188> i have some method defined like
<xfighter1188> let something f x y
<mrvn> You have to write if check_duplicates (eq h t)
<xfighter1188> where f is a function
<xfighter1188> oh
<xfighter1188> okay so it dfeaults
<xfighter1188> wait okay so lets say i have some function
<xfighter1188> let something boolean x y
<mrvn> A function is just another value. nothing special about it.
<xfighter1188> and f is likle a' -> boolean
<xfighter1188> if i do something f x y
<xfighter1188> it won't work right>?
<xfighter1188> because it would treat f like a function not
<xfighter1188> a boolean?
<mrvn> sure it works. It passes f, x and y to something.
<flux> precedence means a b c d is interpreted exactly as: (a (b (c (d))))
<xfighter1188> oh
<flux> waaiit, no :-)
<mrvn> flux: other way
<xfighter1188> wait but
<flux> I of course meant ((((a) b) c) d)
<mrvn> ((((a b) c) d) e)...
<xfighter1188> okay sorry can we walk through this
<xfighter1188> okay in this code here
<xfighter1188> remove_duplicates takes in
<xfighter1188> eq which is of type int -> int -> boolean
<xfighter1188> and l which is a' list
<xfighter1188> when i call remove_duplicates f a
<xfighter1188> where f is some function int -> int -> boolean and a is a list
<xfighter1188> how does it know to pass f as a fucntion, rather than apply a to f
<xfighter1188> and pass it in as a boolean
<mrvn> It doesn't and it never would
<xfighter1188> well other than that doesn't work with those types
<xfighter1188> what do you mean it doesn't
<mrvn> remove_duplicates f a == ((remove_duplicates f) a)
<xfighter1188> i thought the whole point of higher order functions is you can pass in fucntions
n1ftyn8_ has joined #ocaml
<xfighter1188> oh youare saying
<xfighter1188> it would never do the latter
<xfighter1188> it would always pass in as a fucntion
<flux> yes, it would never apply the argument
<xfighter1188> i see
<mrvn> It (at first) has no idea what f is. The grammar simply says that it is an argument that gets applied to a function.
<flux> if you have a b c, b and c are not applied
<xfighter1188> i see i see
<flux> , it is a that is applied the arguments b and c
<xfighter1188> so lets say i have some function boolean -> int
<flux> of course, if you have a (b c), then you have 'b' in the first position, and c gets applied to it
ygrek has joined #ocaml
<xfighter1188> wait okay let me rephrase
<xfighter1188> if i wanted it to pass in whatever the value of the function was
<xfighter1188> i would need to do (f a b)
<xfighter1188> or something?>
<mrvn> xfighter1188: then you must use ()
<xfighter1188> oh
<xfighter1188> makes so much more sense haha
<xfighter1188> thank you guys
<xfighter1188> i have a midterm tomorrow
<mrvn> xfighter1188: ocaml works the other way than you think. It seed "x y z". So it figures x is a function taking y and z as arguments. It then figures out what types y and z could have and from that constructs the type of x.
<xfighter1188> and i just hd some lingery questions
<xfighter1188> yeah
<mrvn> s/seed/sees/
<xfighter1188> that makes more sense now
<xfighter1188> i was thinking that
<xfighter1188> it knew the type of y
<xfighter1188> and operated under that notion
<mrvn> Nope
<xfighter1188> but it actually doesn't and just treats it like
<xfighter1188> some dumb argument
<xfighter1188> okay
<xfighter1188> horrayyy
<mrvn> as the saying goes: functions are first class
<xfighter1188> yeah i can't say im taht familiar with funtional programming yet
<xfighter1188> i did some over the summer but it was scala
<xfighter1188> which is kinda different
<mrvn> xfighter1188: a function is just like any other value. In ocaml you can even pass modules as areguments nowadays.
<xfighter1188> yeah okay thank you
<xfighter1188> i was so confused before
<xfighter1188> wondering how it knew to do things
<mrvn> anyway, the grammar says what gets applied where and the type system comes way later.
<xfighter1188> yeah okay
<xfighter1188> oh i have one more question
<xfighter1188> in this same example http://ideone.com/xalFRj
<xfighter1188> i have it using the keyword in
<xfighter1188> and then matching after
<xfighter1188> but this also works if i just have 2 functions
<xfighter1188> let me type out what im ean
<mrvn> the check_duplicates is a local (or nested) function. Makes it unavailable from the outside. Doesn't pollute the global namespace.
<xfighter1188> oh lol
nullcatxxx_ has joined #ocaml
<xfighter1188> answered my question
<xfighter1188> without me providing more info ty
sh0t has joined #ocaml
<mrvn> Another way of looking at it is: check_duplicates is just a value you create inside the outer function. That it happens to be a function itself is no realy relevant (until you call it).
<xfighter1188> yeah
<xfighter1188> okay that makes sense once you said that
<mrvn> It's like: let f x y = let t1 = x * y in let t2 = x + y in ...
<mrvn> But the keeping it local and out of the global namespace is usualy the reason why you have nested functions.
<xfighter1188> yeah then i can use
<xfighter1188> t1 and t2 again
<xfighter1188> as variable names
<xfighter1188> but not as funcitons
<mrvn> (makes little sense in your example though, check_duplicates sounds like a perfectly usefull global function)
<mrvn> xfighter1188: you can use them as functions. But then you get a type error.
msch has joined #ocaml
<mrvn> xfighter1188: you can also try using them as floats, lists or arrays and you just get a type error because they are int.
<xfighter1188> oh okay
<xfighter1188> wait but
<xfighter1188> if i do something like what yousaid
<xfighter1188> then aren't t1 and t2
<xfighter1188> the scope is only without
<xfighter1188> f right?
<mrvn> being a function makes 0 difference. It's just another value with a certain type and types have to match their use.
rfv has joined #ocaml
<xfighter1188> sorry i mis worded it
<xfighter1188> but im eant
<xfighter1188> the scope just lasts
<xfighter1188> within f
<xfighter1188> and outside of f
<xfighter1188> the names are free again
<mrvn> yes, t1 and t2 are purely local.
<xfighter1188> okay
<xfighter1188> time to go study my induction proofs
rpg has joined #ocaml
^elyse^ has quit [Quit: sleep]
icicled has quit [Quit: Leaving]
opal has joined #ocaml
<Drup> Algebr`: I know some people used jsoo for node.js
<Drup> so it works
<Drup> about electron, nothing built in, so you'll have to create a binding, but no reason to expect any issue
Bluddy has joined #ocaml
<Algebr`> Drup: I heard of that too, saw some murmuring on the mailing list, any code examples? I don't see anything on opam
<Drup> Not that I know of
lobo has quit [Quit: leaving]
<Drup> I wouldn't really be surprised if it "just worked"™
Algebr`` has joined #ocaml
<palomer> does ocaml have a generic print function?
<mrvn> yes
<mrvn> it takes a pretty printer
Algebr` has quit [Ping timeout: 252 seconds]
mac10688_ has joined #ocaml
<SomeDamnBody> How would I write a short circuiting iteration over a list?
<SomeDamnBody> with the list apis... I don't see how I could tell the iteration to quit
<mrvn> recursve or folding with exceptions
lambdahands has joined #ocaml
<SomeDamnBody> oh I see core_kernel's for_all now, my bad
<SomeDamnBody> I asked prematurely
<Drup> SomeDamnBody: you should really be able to write that yourself, it's a good exercise
<Drup> (the secret to exit the recursion prematurely is ... not to recurse, simply)
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
xfighter1188 has quit []
palomer has quit [Quit: palomer]
<SomeDamnBody> oh psh, dude, I don't want to reinvent the wheel. I was looking at fold_left and was like... I don't think I can exit out of this until the list is exhausted
nullcatxxx_ has joined #ocaml
<Drup> not for fold, no
<SomeDamnBody> Drup, I write good code. Just sometimes when I'm addressing something complicated I get to where I'm like... "does the air I breathe have oxygen in it? What year is it really?" -> I question shit really hard and just get intensely focused
<SomeDamnBody> :)
palomer has joined #ocaml
orbifx1 has joined #ocaml
<Algebr``> Drup: just checking if you addressed me a message about node js code examples for jsoo, lost connection for a second.
Korhonen has joined #ocaml
orbifx has quit [Quit: WeeChat 1.3]
Kakadu has quit [Remote host closed the connection]
orbifx1 has quit [Ping timeout: 250 seconds]
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<apache2> what's the best way to store a stack (first-in-last-out) structure of variable-size strings?
<apache2> an array?
marsam has quit [Remote host closed the connection]
<Drup> Stack ? :)
<mrvn> best for what? space, time, ease of use? I would go with list.
<Drup> (yes, there is a module stack in the stdlib)
<mrvn> arrays are fixed size so you have to know how bit to make them and carry an index around too.
<mrvn> # let x = Stack.create ();;
<mrvn> val x : '_a Stack.t = <abstr>
<apache2> sorry I'm stupid, first-in-first-out, not a stack
<mrvn> Queue.t?
<apache2> thanks!
<apache2> mrvn: that is mutable right?
sh0t has quit [Ping timeout: 250 seconds]
<mrvn> RTFM
<apache2> point taken
nullcatxxx_ has joined #ocaml
jonludlam has quit [Ping timeout: 244 seconds]
Korhonen has quit [Quit: ZNC - http://znc.in]
rpg has quit [Quit: rpg]
Korhonen has joined #ocaml
opal has left #ocaml [#ocaml]
jeffmo has quit [Quit: jeffmo]