levi has quit [Read error: Connection reset by peer]
levi has joined #ocaml
darkf has quit [Read error: Connection reset by peer]
Sim_n has joined #ocaml
darkf has joined #ocaml
levi has quit [Read error: Connection reset by peer]
levi has joined #ocaml
Simn has quit [Ping timeout: 276 seconds]
chambart has quit [Ping timeout: 246 seconds]
chambart has joined #ocaml
csakatoku has joined #ocaml
avsm has quit [Quit: Leaving.]
levi has quit [Read error: Connection reset by peer]
levi has joined #ocaml
avsm has joined #ocaml
shinnya has joined #ocaml
chambart has quit [Ping timeout: 246 seconds]
tane has quit [Quit: Verlassend]
Yoric has quit [Read error: Connection reset by peer]
Drup has quit [Ping timeout: 246 seconds]
levi has quit [Remote host closed the connection]
levi has joined #ocaml
mort___ has quit [Quit: Leaving.]
levi has quit [Read error: Connection reset by peer]
levi has joined #ocaml
levi has quit [Read error: Connection reset by peer]
levi has joined #ocaml
alex-hu has joined #ocaml
mort___ has joined #ocaml
levi has quit [Read error: Connection reset by peer]
wwilly has joined #ocaml
levi has joined #ocaml
<wwilly>
bonjour
<adrien>
o/
zpe has quit [Remote host closed the connection]
levi has quit [Read error: Connection reset by peer]
<alex-hu>
I'm trying to configure opam to use bytecode compiler by default, but unable to find the config file. The documentation also seems to be absent. Does anyone know how to do it, or where I could find data on this?
levi has joined #ocaml
ttamttam has joined #ocaml
levi has quit [Read error: Connection reset by peer]
levi has joined #ocaml
gnuvince- has quit [Changing host]
gnuvince- has joined #ocaml
levi has quit [Read error: Connection reset by peer]
levi has joined #ocaml
levi has quit [Read error: Connection reset by peer]
levi has joined #ocaml
levi has quit [Read error: Connection reset by peer]
levi has joined #ocaml
levi has quit [Read error: Connection reset by peer]
levi has joined #ocaml
Yoric has joined #ocaml
levi has quit [Read error: Connection reset by peer]
levi has joined #ocaml
levi has quit [Read error: Connection reset by peer]
pango has quit [Quit: Client exiting]
levi has joined #ocaml
xavierm02 has joined #ocaml
levi has quit [Read error: Connection reset by peer]
levi has joined #ocaml
avsm has quit [Quit: Leaving.]
pango has joined #ocaml
levi has quit [Read error: Connection reset by peer]
levi has joined #ocaml
levi has quit [Read error: Connection reset by peer]
levi has joined #ocaml
<xavierm02>
Hey. I was wondering how I should organize my functions between those 3 ( http://pastebin.com/fthesLP2 ) or more if all are wrong. The first one is just giving a name to a part of the code, in this case it's completely useless (just like most variables) but in my case, I was creating an enum and I had a huuuuge next function so it made sense to do that to make the code more readable. I'd like to know if transforming it into t
<xavierm02>
To sum up that: Do I put my helper functions in my main function and let it use local variable, do I put it in but make it use only variables it gets as arguments or do I put it out of the main function?
introom has quit [Remote host closed the connection]
<ggole>
There's no hard and fast rule for that kind of decision.
levi has quit [Read error: Connection reset by peer]
levi has joined #ocaml
introom has joined #ocaml
<ggole>
Nested functions are difficult to test and reuse, so I tend to avoid them.
<xavierm02>
So you'd use 3?
<ggole>
It's hard to say because your function doesn't really do anything. But usually, yes.
levi has quit [Read error: Connection reset by peer]
<mrvn>
or put it outside but rebind it to the local variables inside.
dsheets has quit [Ping timeout: 264 seconds]
introom has quit [Remote host closed the connection]
<mrvn>
I do that when i have to call something ten times with the first args always the same
chambart has joined #ocaml
<xavierm02>
Ok. Thank you :)
avsm has joined #ocaml
ttamttam has quit [Quit: ttamttam]
Kakadu has quit [Quit: Konversation terminated!]
cdidd has quit [Read error: Connection reset by peer]
darkf has quit [Quit: Leaving]
Drup has joined #ocaml
<bernardofpc>
mrvn> I do that when i have to call something ten times with the first args always the same -> for the sake of clarity or for speed
<bernardofpc>
?
<bernardofpc>
(sorry, dumb keyboard here)
Neros has quit [Ping timeout: 264 seconds]
<ggole>
Clarity
<ggole>
Constructing the closure is probably worse for speed.
<bernardofpc>
xavierm02: usually, when I use functions inside functions is in the case of auxiliary recursive functions
<bernardofpc>
ggole: it`s faster to pass 1 more argument than to have it captured by context ?
<ggole>
Yeah, I'd imagine so
<ggole>
I wouldn't go making any decisions based on that though
<ggole>
Because usually it just doesn't matter
<ggole>
Better to write the cleanest code you can and only nitpick at hotspots after you run a profiler
cdidd has joined #ocaml
<xavierm02>
okay
<xavierm02>
then I'll go with 2
<xavierm02>
because 3 forces me to change the order of some elements that make the code a bit harder to understand
mort___ has quit [Ping timeout: 276 seconds]
mcclurmc has joined #ocaml
beginner42 has joined #ocaml
beginner42 has quit [Client Quit]
Neros has joined #ocaml
Yoric has quit [Ping timeout: 240 seconds]
beckerb has quit [Ping timeout: 245 seconds]
csakatoku has quit [Remote host closed the connection]
pkrnj has joined #ocaml
Neros has quit [Ping timeout: 264 seconds]
ygrek has quit [Ping timeout: 246 seconds]
ulfdoz has joined #ocaml
avsm has quit [Quit: Leaving.]
mcclurmc has quit [Ping timeout: 248 seconds]
Harzilein has quit [Ping timeout: 245 seconds]
avsm has joined #ocaml
csakatoku has joined #ocaml
ggole has quit []
csakatoku has quit [Ping timeout: 276 seconds]
Drup has quit [Ping timeout: 246 seconds]
avsm has quit [Quit: Leaving.]
osa1 has quit [Read error: Connection reset by peer]
baff has quit [Remote host closed the connection]
Sim_n is now known as Simn
osa1 has joined #ocaml
hellome has quit [Remote host closed the connection]
hellome has joined #ocaml
Neros has joined #ocaml
milosn has quit [Ping timeout: 264 seconds]
walter has quit [Quit: This computer has gone to sleep]
hellome has quit [Remote host closed the connection]
hellome has joined #ocaml
csakatoku has joined #ocaml
pkrnj has quit [Read error: Operation timed out]
csakatoku has quit [Ping timeout: 246 seconds]
oriba has joined #ocaml
watermind has joined #ocaml
watermind has quit [Client Quit]
pkrnj has joined #ocaml
pkrnj has quit [Client Quit]
pkrnj has joined #ocaml
gautamc has joined #ocaml
watermind has joined #ocaml
<watermind>
is it possible to list the contents of a module?
<watermind>
something akin to ghc's :browse
<watermind>
^ from toplevel that is
<adrien>
in the toplevel, you can do:
<adrien>
module X = TheModule;;
<adrien>
little trick
<watermind>
I see
<watermind>
nice
Drup has joined #ocaml
<travisbrady>
Anyone aware of a sort of reverse regex compiler, that given a set of string literals will return the minimum number of regexes necessary to match every pattern? Off topic I know, but #ocaml is smart
<mrvn>
let gen_regexp list = let s = (List.fold_left (fun acc s -> acc ^ "|" ^ s) "" list) ^ ")" in s[0] <- '('; s
<travisbrady>
haha, well that's one way
<mrvn>
the regexp compiler can optimize it
chambart has quit [Ping timeout: 246 seconds]
<watermind>
I'm still starting to read ocaml... this seems rather straighforward... you're just creating the disjunction of all strings in the list
<watermind>
also in the end you put a )
<watermind>
and in the begining a (
<watermind>
but... the s[0] confuses me a bit
<mrvn>
(foo|bar|baz)
<watermind>
exactly
<watermind>
but isn't the ( overriding the first character already in the generated list?
<watermind>
e.g, (oo|bar|baz)
<mrvn>
s/[/.[/
Harzilein has joined #ocaml
Harzilein has quit [Max SendQ exceeded]
Harzilein has joined #ocaml
Harzilein has quit [Max SendQ exceeded]
<watermind>
?
Harzilein has joined #ocaml
<mrvn>
watermind: the generated string is |foo|bar|baz, then I add ) and change s.[0] to (
<ousado>
how about String.concat "|" list ?
<watermind>
oh
<watermind>
right
<mrvn>
ousado: even better
<watermind>
I forgot about the trailing '|'
<mrvn>
"(" ^ (String.concat "|" list) ^ ")"
<travisbrady>
I may run a test to see how well this is optimized. I'd be interested to see what it does if I pass it "N", "NN", "NNN", "NNNN".
bkpt has joined #ocaml
chambart has joined #ocaml
gautamc has quit [Read error: Connection reset by peer]
gautamc has joined #ocaml
<oriba>
when I use Graphics.resize_window the window disappears as if this crashed the app, but I got no exception message.
<oriba>
is there something special with graphics.resize_window ?
<adrien>
Graphics has some, hmm, "limitations"
<oriba>
hmhh
<oriba>
but it also has resize_window ;-)
<adrien>
well, it should work but generally-speaking, unless you want to keep things simple, you might be better served by something else
metasyntax has quit [Quit: Leaving]
<oriba>
I just need a simple display, nothing special
<adrien>
and you need a space as first char before a resolution btw
<adrien>
(been a long time since I used Graphics)
<oriba>
?
<adrien>
resolution string*
<oriba>
resize_window gets two ints
<adrien>
that applies to "open_graph" :)
<oriba>
hmhh
<oriba>
I used ":0.0" for that string
<oriba>
It worked
<oriba>
I can plot
<oriba>
but resize_window shuts down the app
* adrien
has always used something like " 640x480" for that string
<oriba>
hmhh let me read the documentation ;-)
<oriba>
"The string argument is used to pass optional information on the desired graphics mode, the graphics window size, and so on."
<oriba>
OMG
<oriba>
I used the $DISPLAY :-(
<oriba>
my blindness...
troydm has quit [Ping timeout: 264 seconds]
<oriba>
hmhhh
<oriba>
I think $DISPLAY was good
<oriba>
with "640x480" I get the error "Cannot open display 640x480"
<oriba>
yes, thats why I used $DISPLAY... I had that error before
<adrien>
space first
<adrien>
the format is weird
wwilly has quit [Quit: This computer has gone to sleep]
<oriba>
space first works also
<oriba>
but with resize_window again "crash"
<oriba>
empty string also works...
<oriba>
but resize_window also crashes
<oriba>
Maybe I should try on other computer, where I have newer ocaml installed... maybe it's an old bug
troydm has joined #ocaml
malo has joined #ocaml
<oriba>
adrien, also same problems on newer install :(
_andre has quit [Quit: leaving]
<oriba>
using other sizes in open_graph displays the window accordingly in the needed size...
<oriba>
ok, so I will open the window at the needed size initially.... but that resizing does not work is a bit ugly...
<Drup>
oriba: a reason not to use something else like lablgtk ?
mort___ has joined #ocaml
skchrko has quit [Quit: Leaving]
<oriba>
Drup, I just wanted a simple interface, not much effort. The tool is too simple/stuoid for ealobarted APIs....
<oriba>
...or is there somethng like easy-lablgtk?
<oriba>
a three-lines-to-start wiki?
<oriba>
Graühoics is just so simple.
<oriba>
Graphics
csakatoku has joined #ocaml
<oriba>
I mean... KISS
<adrien>
lablgtk is simple :P
<Drup>
oriba: Graphics is not really kiss .. it doesn't do the job very well.
csakatoku has quit [Ping timeout: 276 seconds]
<oriba>
lablgtk is simple?
<adrien>
yup
<oriba>
It's a while ago when I used it, maybe its not complicated.
<oriba>
But I don't need a fancy GUI
<adrien>
I'm very interested in each issue you'll have while doing something with it
<adrien>
complain extensively :P
<Drup>
adrien: oh, since you're at it
<adrien>
Drup: I don't like you -_-è
<adrien>
:D
<Drup>
:D
<oriba>
adrien, you mean lablgtk will make no problems?
<oriba>
or what?
<oriba>
I don't need any button
<adrien>
I'm interested in your "path"
<oriba>
?
<adrien>
I'm a lablgtk dev and I'd like to fix this bad reputation
<adrien>
so let me know what you do, the issues you have (even if you fix them within 2 minutes), the websites you visit...
<oriba>
adrien, ah, I see.
<oriba>
So, you want me to see that lablgtk is easy...?!
<Drup>
adrien: it look's to me like bolterplate (and I probably copy/paste it from somewhere else), so I suppose you can so simpler
<adrien>
Drup: looks good to me; it's obviously boilerplate but you're not going to get anything shorter
<Drup>
ok
<Drup>
it's fine, I was just curious
<adrien>
code to use drawing areas is a bit difficult to guess but what you have is good
<adrien>
oriba: actually it would be better for me if you managed to stumble on each and every issue :P
<Drup>
yeah, it's old, so I don't remember when I wrote it :D
<oriba>
adrien, oh... so you need my failure for your pleasure! maybe thats not the win-win-situation I'm looking for ;-)
<adrien>
Drup: you could have something shorter but it would make the overall API bigger
<adrien>
I prefer to have to write some boilerplate code and not have Java frameworks ;-t)
<adrien>
oriba: :)
<Drup>
ahah, swing die in hell please. =')
<adrien>
oriba: well, I'll be happy whichever issus you get, without trying to make them worse
<adrien>
Drup: I have wonderful memories of the "matrix" stuff and how you put something in position 3,3
<oriba>
I will come back to that later, when I really need lablgtk... for the moment I try it with Graphics :-) :P
<adrien>
you put it at position 9 and have set it to use 3 columns: 9 % 3 = 3
<adrien>
(or something close to that)
* adrien
-> bed
<Drup>
adrien: yeah, the whole layout stuff is badly inspired from html + css, which is already ugly
<companion_cube>
adrien >>= bed
travisbrady has quit [Quit: travisbrady]
xavierm02 has quit [Remote host closed the connection]
Simn has quit [Quit: Leaving]
osa1 has quit [Read error: Connection reset by peer]
avsm has joined #ocaml
tlockney has quit [Excess Flood]
thomasga has quit [Read error: Connection reset by peer]
thomasga1 has joined #ocaml
thomasga1 has quit [Client Quit]
tlockney has joined #ocaml
dsheets has joined #ocaml
thomasga has joined #ocaml
thomasga has left #ocaml []
AtKaaZ has joined #ocaml
mort___ has quit [Quit: Leaving.]
mort___ has joined #ocaml
<AtKaaZ>
hi, i'm on http://try.ocamlpro.com/ lesson 4 step1 and i noticed that I can't pass -1 to that function, it says "This expression has type int -> string" but I can pass (2-1) could someone please explain ?
<AtKaaZ>
i mean (1-2) :)
<AtKaaZ>
hmm i can even pass (-1) with parens that is
mort___ has quit [Remote host closed the connection]
<Drup>
AtKaaZ: " bla -1 is parsed as "(bla) - (1)"
Snark has quit [Quit: leaving]
<Drup>
binary operators and co :)
mort___ has joined #ocaml
tlockney has quit [Excess Flood]
<AtKaaZ>
so if I do: string_of_int 1-2 it says "This expression has type string"
<AtKaaZ>
why is it string though
<Drup>
this is parsed as "(string_of_int 1) - (2)"
tlockney has joined #ocaml
<AtKaaZ>
ok I get it now, thanks Drup
AtKaaZ has quit [Quit: tired]
csakatoku has joined #ocaml
osa1 has joined #ocaml
Xom has quit [Ping timeout: 264 seconds]
Xom has joined #ocaml
<oriba>
is ocamlbrowser in OCaml 4.x also in standard package, or not?
ulfdoz has quit [Ping timeout: 264 seconds]
hellome has quit [Write error: Connection reset by peer]
osa1 has quit [Quit: Konversation terminated!]
mort___ has quit [Quit: Leaving.]
ohama has joined #ocaml
pango_ has joined #ocaml
oriba has quit [Quit: oriba]
smondet has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
pango has quit [Ping timeout: 248 seconds]
pkrnj has quit [Quit: Computer has gone to sleep.]
malo has quit [Quit: Leaving]
avsm has quit [Quit: Leaving.]
rwmjones has quit [Ping timeout: 240 seconds]
ollehar has quit [Ping timeout: 276 seconds]
csakatoku has quit [Remote host closed the connection]
rwmjones has joined #ocaml
Myk267 has joined #ocaml
avsm has joined #ocaml
bkpt has quit [Quit: Leaving]
pkrnj has joined #ocaml
Xom has quit [Quit: ChatZilla 0.9.90.1 [Firefox 22.0/20130618035212]]
watermind has quit [Quit: Konversation terminated!]
Xom has joined #ocaml
Harzilein has quit [Ping timeout: 264 seconds]
Xom has quit [Quit: ChatZilla 0.9.90.1 [Firefox 22.0/20130618035212]]