Camarade_Tux has quit [Read error: 110 (Connection timed out)]
ulfdoz_ has joined #ocaml
ulfdoz has quit [Read error: 60 (Operation timed out)]
ulfdoz_ is now known as ulfdoz
jeff_s_ has joined #ocaml
jamii has quit [Connection timed out]
seafood has joined #ocaml
Associ8or has quit []
alexyk has joined #ocaml
Kerris7 has quit ["Don't even think about saying Candlejack or else you wi"]
<palomer>
whoa
<palomer>
revised syntax changes the application order of constructors
<palomer>
type constructors
jeff_s_ has quit []
<palomer>
anyone have any pcre friendly regexps for specifying floats and integers?
Amorphous has quit [Read error: 110 (Connection timed out)]
<kaustuv_>
integers is easy: -?\d+
<palomer>
works
<palomer>
oh, and string
<kaustuv_>
surely the answers you seek are just a google search away?
<palomer>
actually, scratch string
<palomer>
but they won't give me ocaml friendly regexps!
Amorphous has joined #ocaml
sanguine1 has quit [lindbohm.freenode.net irc.freenode.net]
xevz has quit [lindbohm.freenode.net irc.freenode.net]
Demitar has quit [lindbohm.freenode.net irc.freenode.net]
maxote has quit [lindbohm.freenode.net irc.freenode.net]
mattam has quit [lindbohm.freenode.net irc.freenode.net]
haelix_ has quit [lindbohm.freenode.net irc.freenode.net]
bohanlon has quit [lindbohm.freenode.net irc.freenode.net]
xerxes has quit [lindbohm.freenode.net irc.freenode.net]
gildor has quit [lindbohm.freenode.net irc.freenode.net]
hto has quit [lindbohm.freenode.net irc.freenode.net]
authentic has quit [lindbohm.freenode.net irc.freenode.net]
Asmadeus has quit [lindbohm.freenode.net irc.freenode.net]
Mr_Awesome has quit [lindbohm.freenode.net irc.freenode.net]
patronus has quit [lindbohm.freenode.net irc.freenode.net]
maskd has quit [lindbohm.freenode.net irc.freenode.net]
ScrumMaster has quit [lindbohm.freenode.net irc.freenode.net]
kaustuv has quit [lindbohm.freenode.net irc.freenode.net]
gl has quit [lindbohm.freenode.net irc.freenode.net]
munga_ has quit [lindbohm.freenode.net irc.freenode.net]
brendan has quit [lindbohm.freenode.net irc.freenode.net]
aij has quit [lindbohm.freenode.net irc.freenode.net]
nimred has quit [lindbohm.freenode.net irc.freenode.net]
lanaer has quit [lindbohm.freenode.net irc.freenode.net]
javax has quit [lindbohm.freenode.net irc.freenode.net]
kaustuv_ has quit [lindbohm.freenode.net irc.freenode.net]
r0bby has quit [lindbohm.freenode.net irc.freenode.net]
alexyk has quit [lindbohm.freenode.net irc.freenode.net]
cloudhead has quit [lindbohm.freenode.net irc.freenode.net]
palomer has quit [lindbohm.freenode.net irc.freenode.net]
bebui has quit [lindbohm.freenode.net irc.freenode.net]
ozzloy has quit [lindbohm.freenode.net irc.freenode.net]
ulfdoz has quit [lindbohm.freenode.net irc.freenode.net]
m3ga has quit [lindbohm.freenode.net irc.freenode.net]
jonafan has quit [lindbohm.freenode.net irc.freenode.net]
smimou has quit [lindbohm.freenode.net irc.freenode.net]
sgnb has quit [lindbohm.freenode.net irc.freenode.net]
peddie has quit [lindbohm.freenode.net irc.freenode.net]
ertai has quit [lindbohm.freenode.net irc.freenode.net]
mbishop has quit [lindbohm.freenode.net irc.freenode.net]
Amorphous has quit [lindbohm.freenode.net irc.freenode.net]
mellum has quit [lindbohm.freenode.net irc.freenode.net]
Pepe_ has quit [lindbohm.freenode.net irc.freenode.net]
sgwizdak has quit [lindbohm.freenode.net irc.freenode.net]
mal`` has quit [lindbohm.freenode.net irc.freenode.net]
fremo has quit [lindbohm.freenode.net irc.freenode.net]
prigaux has quit [lindbohm.freenode.net irc.freenode.net]
mfp has quit [lindbohm.freenode.net irc.freenode.net]
sbok has quit [lindbohm.freenode.net irc.freenode.net]
bacam has quit [lindbohm.freenode.net irc.freenode.net]
Ori_B has quit [lindbohm.freenode.net irc.freenode.net]
jlouis has quit [lindbohm.freenode.net irc.freenode.net]
delroth has quit [lindbohm.freenode.net irc.freenode.net]
negacthulhu has quit [lindbohm.freenode.net irc.freenode.net]
mishok13 has quit [lindbohm.freenode.net irc.freenode.net]
mrvn has quit [lindbohm.freenode.net irc.freenode.net]
acatout has quit [lindbohm.freenode.net irc.freenode.net]
|jeremiah has quit [lindbohm.freenode.net irc.freenode.net]
pants3 has quit [lindbohm.freenode.net irc.freenode.net]
det has quit [lindbohm.freenode.net irc.freenode.net]
wli has quit [lindbohm.freenode.net irc.freenode.net]
TaXules has quit [lindbohm.freenode.net irc.freenode.net]
hcarty has quit [lindbohm.freenode.net irc.freenode.net]
seafood has quit [lindbohm.freenode.net irc.freenode.net]
ztfw has quit [lindbohm.freenode.net irc.freenode.net]
svenl_ has quit [lindbohm.freenode.net irc.freenode.net]
tarbo2 has quit [lindbohm.freenode.net irc.freenode.net]
holgr has quit [lindbohm.freenode.net irc.freenode.net]
ReinH has quit [lindbohm.freenode.net irc.freenode.net]
hkBst has quit [lindbohm.freenode.net irc.freenode.net]
willb has quit [lindbohm.freenode.net irc.freenode.net]
rumbleca has quit [lindbohm.freenode.net irc.freenode.net]
tomaw has quit [lindbohm.freenode.net irc.freenode.net]
petchema_ has quit [lindbohm.freenode.net irc.freenode.net]
flux has quit [lindbohm.freenode.net irc.freenode.net]
totom has quit [lindbohm.freenode.net irc.freenode.net]
ppsmimou has quit [lindbohm.freenode.net irc.freenode.net]
tsuyoshi has quit [lindbohm.freenode.net irc.freenode.net]
ski__ has quit [lindbohm.freenode.net irc.freenode.net]
clog has joined #ocaml
jli has joined #ocaml
ztfw has quit [Connection timed out]
ray has joined #ocaml
palomer has quit [Remote closed the connection]
sporkmonger has joined #ocaml
ulfdoz_ has joined #ocaml
seafood has joined #ocaml
ulfdoz has quit [Read error: 110 (Connection timed out)]
ulfdoz_ is now known as ulfdoz
vithos has joined #ocaml
cloudhea has joined #ocaml
seafood has quit []
ulfdoz_ has joined #ocaml
xerxes_ has joined #ocaml
AxleLonghorn has joined #ocaml
AxleLonghorn has quit [Client Quit]
AxleLonghorn has joined #ocaml
ulfdoz__ has joined #ocaml
ulfdoz has quit [Read error: 110 (Connection timed out)]
ulfdoz__ is now known as ulfdoz
xerxes has quit [Read error: 110 (Connection timed out)]
ulfdoz_ has quit [Read error: 110 (Connection timed out)]
jknick has joined #ocaml
jeff_s_ has joined #ocaml
kaustuv_ has quit ["07d7f4fd60d747431207d33555e04773"]
jeff_s_ has quit []
seafood has joined #ocaml
seafood has quit [Client Quit]
xerxes_ has quit ["Ex-Chat"]
Jedai has joined #ocaml
seafood has joined #ocaml
pants1 has joined #ocaml
Associat0r has joined #ocaml
Camarade_Tux has joined #ocaml
pants3 has quit [Read error: 113 (No route to host)]
seafood has quit []
<mrvn>
jli: It depends. If your list is really circular then no. If you mark the endpoints by pointing them at themself then yes.
<flux>
mrvn, but it doesn't help at all, because the list is doubly-linked
<flux>
it keeps bouncing next/prev/next/prev/next/prev/.. even with just two non-circular nodes
<mrvn>
right.
<flux>
I suppose the printer could be better
<flux>
by pointing out "visited already" or something
ikaros has joined #ocaml
komar_ has joined #ocaml
<mrvn>
{ prev = { prev = a; next = a; ... } as b; next = b; ... } as a ?
<flux>
I just used type t = { mutable prev : t option; mutable next : t option } let t1 = { prev = None; next = None } let t2 = { prev = None; next = None } let _ = t1.next <- Some t2; t2.prev <- Some t1
<mrvn>
I ment as output of the printer.
<flux>
oh, right
<flux>
yes, something like that could be
cloudhea has quit []
<kaustuv>
it's easy to override the printer for any type
sporkmonger has quit []
ikaros has quit ["Leave the magic to Houdini"]
cloudhead has quit [Success]
m3ga has quit ["disappearing into the sunset"]
ulfdoz_ has joined #ocaml
ztfw` has quit [Remote closed the connection]
vithos has quit []
Camarade_Tux has quit [Read error: 110 (Connection timed out)]
acatout has quit [Read error: 60 (Operation timed out)]
ulfdoz has quit [Read error: 110 (Connection timed out)]
ulfdoz_ is now known as ulfdoz
spez has joined #ocaml
alexyk has quit []
Mr_Awesome has quit [Read error: 110 (Connection timed out)]
<rwmjones>
cp -a does a recursive copy and preserves timestamps
<flux>
I meant -- is useful, unless Filename.quote also handles first character being a dash
<kaustuv>
-a preserves all of mode, ownership and timestamps, when possible
<flux>
I've used .. cp -a -- "$A" "$B" where A and B are environment variables I've set prior to the call. it should work around magic character issues, but pollutes the environment..
<iago__>
rwmjones, uhm, thanks
<rwmjones>
flux, good point
<mrvn>
flux: so unset them after the cp
<mrvn>
rwmjones: why not Sys.command (Printf.sprintf "cp -a -- '%s' '%s'"?
<rwmjones>
mrvn, that won't work if the filenames contain ' chars
<rwmjones>
or do you mean using Filename.quote as well?
<mrvn>
s,','\'',g
<rwmjones>
IIRC Filename.quote adds single quotes around the whole string
<mrvn>
You still need some quoting but far less than without '' or ""
<kaustuv>
Using library functions for such things is generally a better idea than rolling your own for whatever bogus reason
<mrvn>
rwmjones: if the quoting works.
<mrvn>
- rwmjones
<kaustuv>
I think Printf.sprintf "cp -a -- %S %S" f1 f2 would also work, but I won't stake my reputation on it
<mrvn>
Also why isn't there a Sys.cmd ["cp"; "-a"; "--"; f1; f2]?
<kaustuv>
Unix.open_process_*
<mrvn>
val open_process : string -> in_channel * out_channel
<AxleLonghorn>
so, anyone have any thoughts on which would be a better way of doing tuples?
<AxleLonghorn>
lists or cons-esque data type
<mbac>
oh my god it uses the object system
<rwmjones>
AxleLonghorn, it depends how you want to use it & how you want to parse the input ... it's not something we can really answer
<AxleLonghorn>
well, I was just wondering if anyone knew of any consequences I wasn't thinking of
<mbac>
well, looks like i'm writing my own irc library again
<mbac>
thanks
mbac has quit ["lulz"]
<AxleLonghorn>
the expr * expr way is ugly in that the nesting could become hideous
alexyk has joined #ocaml
<AxleLonghorn>
how about this for a contraint: there's no pattern matching in the language
ikaros has quit ["Leave the magic to Houdini"]
lutter has joined #ocaml
itewsh has joined #ocaml
komar_ has quit [Read error: 113 (No route to host)]
alexyk has quit []
ulfdoz_ has joined #ocaml
komar_ has joined #ocaml
alexyk has joined #ocaml
Alpounet has quit [Read error: 60 (Operation timed out)]
Alpounet has joined #ocaml
ulfdoz has quit [Read error: 110 (Connection timed out)]
ulfdoz_ is now known as ulfdoz
Snark has quit ["Ex-Chat"]
Ched has quit [Read error: 54 (Connection reset by peer)]
AxleLonghorn has left #ocaml []
<Camarade_Tux>
I find qt quite annoying to work with actually, I think I prefer gtk but I don't know if I prefer gtk or lablgtk actually
<jonafan>
you mean gtk from c?
monadic_kid has joined #ocaml
iago has joined #ocaml
<Camarade_Tux>
I don't have much experience with GTK in C as I've mainly used lablgtk (and edited others' code), so I am not sure why I prefer gtk : is it because of lablgtk which is a nice interface or is because gtk seems saner to me
<flux>
you should use anonymous functions instead: doWhen (..) (fun () -> Sys.remove ..)
<iago>
well, was the another option
<flux>
or, if you do that a lot, you may want to take a look at monads
<iago>
some external library?
<flux>
monads is a concept, not a specific library
<flux>
but if your code is built according to the monadic principles, you can use pa_monad to lighten the syntactic load
<iago>
I know what monads are, but there are libraries to implement them
<iago>
mtl for example in Haskell :?
<flux>
what I'm thinking here is continuation passing style monad
<monadic_kid>
mtl is the monad transfomer library, thats more to do with combining monads
<iago>
monadic_kid, well, ok, anyway, monads in Haskell are defined in libraries
<flux>
iago, in any case, using anonymous functions is likely slightly faster than lazy values
<flux>
also using lazy values seems like abuse here, because you aren't really storing values but actions :)
<iago>
yep, I ask because I see it a bit ugly
<iago>
:P
<flux>
there are also syntax extensions that make the syntactic load of defining a lot of functions lighter, but I'm not sure if they apply to unit functions
<flux>
pa_hole (or pa_holes?) might be useful
<iago>
well, perhaps anonymous fun's will be the better option, I only use this in some places
<flux>
there's one trick that might be suitable or not:
<flux>
instead of let do_somethin f = f ()
<flux>
you have: let do_something f a = f a
<flux>
so instead of do_something (fun () -> print_endline "hello world")
<flux>
you can write do_something print_endline "hello world";;
<flux>
of course, the trick can make functions with more arguments look worse
<flux>
because then it's like: do_something (Printf.printf "%s %s" "hello") "world"
<iago>
yep
<iago>
I follow some near to this
<iago>
before write this version
monadic_kid has quit ["Leaving"]
itewsh has quit [Read error: 110 (Connection timed out)]
nwardez has joined #ocaml
itewsh has joined #ocaml
nwardez has quit [Client Quit]
nwardez has joined #ocaml
monadic_kid has joined #ocaml
nwardez has quit [Client Quit]
Yoric[DT] has joined #ocaml
rjack has quit ["leaving"]
nwardez has joined #ocaml
<jli>
if I have a sum type with Construct Cons of complicated_record, and I pattern match with "Cons record", "record" is no longer a Cons. so do I just say "Cons record" to make a new Cons, or is it idiomatic to change the match to "| Cons record as cons", or something?
sanguinev has quit [Read error: 110 (Connection timed out)]
AxleLonghorn1 has joined #ocaml
AxleLonghorn has quit [Read error: 104 (Connection reset by peer)]
alexyk_ has joined #ocaml
<kushou>
I tried to creat two "type foo = {bar1: int; bar2}" (i don't know the english name), with both the same first input name
Ched has quit [Read error: 104 (Connection reset by peer)]
<kushou>
(sorry for my bad english)
<Ariens_Hyperion>
kushou: give a name to the type
<kushou>
that is what i've done, isn't it ?
Camarade_Tux has quit [Read error: 113 (No route to host)]
Ched has joined #ocaml
<Alpounet>
hcarty, AFAIK, such libraries do not use objects, since that's not OCaml's main "view of programming"
angerman_ has quit []
<AxleLonghorn1>
kushou
<AxleLonghorn1>
you can't have records with the same labels
<AxleLonghorn1>
they are not objects
<kushou>
ok
<AxleLonghorn1>
what you are seeing is the fact that you keep redefining types with the same label, so each time you try to refer to the record with the same label, it sees a different type each time
Ariens_Hyperion has left #ocaml []
<AxleLonghorn1>
this is partly because ocaml reads definitions from top to bottom, and if you overwrite a definition, you will use the last one defined
<AxleLonghorn1>
this happens with function definitions as well
<AxleLonghorn1>
let foo x y = 1;; val foo : 'a -> 'b -> int = <fun>
<kushou>
ok, but when record tri1 = {x1; x2; x3} and tri2 = {x1; x2}, i don't understand why tri1 overwrite tri2
<AxleLonghorn1>
let foo x y z = 1;; val foo : 'a -> 'b -> 'c -> int = <fun>
<AxleLonghorn1>
foo;; 'a -> 'b -> 'c -> int = <fun>
<AxleLonghorn1>
because it was the last one defined, from top to bottom
<kushou>
hum ok
<kushou>
so i can't define two records in the same time ?
<AxleLonghorn1>
you can, just not with the same label
<AxleLonghorn1>
s/label/labels
<kushou>
ok, hum i need to try something
<AxleLonghorn1>
type tri1 = {x : int; y : int; z : int};; type tri2 = {x1 : int; y : int} will work
<AxleLonghorn1>
the problem is that OCaml can't infer the record type involved if multiple records use the same label
alexyk has quit [Read error: 110 (Connection timed out)]
<AxleLonghorn1>
again, like I said, you can't use the same label in different types
<kushou>
oh i haven't seen the "x1"
<AxleLonghorn1>
when OCaml sees a record label of x, it looks for the last type that defined that label, which was tri2
<kushou>
;; type tri2 = {x1
<kushou>
ok ok, i've understood
<kushou>
thanks
<AxleLonghorn1>
I find records to be slightly annoying because of the label issue
<AxleLonghorn1>
in order to access the value under a label from outside the module the record was defined in, you have to open the module it was defined in
<AxleLonghorn1>
which is annoying if you don't want to pollute the function namespace
<kushou>
ok, i don't know what is the modules yet
<kushou>
i need to go to bed, good night all
<kushou>
and thank you
<jli>
AxleLonghorn1: you mean record.label access?
kushou has quit ["Konversation terminated!"]
<AxleLonghorn1>
yes
komar__ has quit [Remote closed the connection]
m3ga has joined #ocaml
Alpounet has quit ["Ex-Chat"]
<jli>
AxleLonghorn1: hm, that's really annoying.
FFighter has joined #ocaml
<FFighter>
hello!
<FFighter>
what is the best book to start learning OCaml ?
<jli>
FFighter: I've been learning with Oreilly's free book
<brendan>
there's also the hickey book, if you don't mind it being cursed
<m3ga>
brendan: the hickey book isn't cursed, just the ripoff of it :-)
<jli>
cursed?
sovesky_ has joined #ocaml
sovesky_ has left #ocaml []
<jli>
oh, I tried using that book. I don't think it's organized very well
<m3ga>
jason hickey wrote a book and released it on the net, someone else published large chunks of it as their own work
<jli>
weird
<jli>
published? was it printed?
jamii has quit [Connection timed out]
<jli>
hcarty: ah, thanks. it works now.
<jli>
has anyone read OCaml for Scientists?
<m3ga>
i would buy it but the author has annoyed me way too many times on usenet/mailing lists/reddit etc
<jli>
heh, really? weird. isn't he a Dr.?
<m3ga>
in physics. he has no compsci or engineering education
<jli>
still :)
ikaros_ has quit ["Leave the magic to Houdini"]
iago has quit ["Leaving"]
FFighter has quit ["Leaving"]
<m3ga>
well, i've worked with a couple of compsci phds who couldn't code their way out of a wet paper bag
alexyk_ has quit []
jeanbon has joined #ocaml
AxleLonghorn1 has left #ocaml []
slash_ has quit [Client Quit]
jeanbon has quit [Read error: 113 (No route to host)]
<hcarty>
jli: Regarding accessing records defined in a module - if the record type is defined in module Foo, you can do x.Foo.label if you want to avoid using "open Foo"
<hcarty>
jli: And OCaml for Scientists has received a lot of very positive reviews, but Mr. Harrop has... a reputation as m3ga pointed out :-) And it is a rather expensive book.
<m3ga>
i also find his code (the stuff on his website for free) rather quirky and not really what I consider good idiomatic ocaml code.
<palomer>
hcarty, ill check if sexplib is object friendly in a sec
<palomer>
but looking at the code, there doesn't seem to be any code for objects