<Muzer>
say I have a custom type myType defined as MyInt of int | MyBool of bool (and a few more, you get the idea). Is there a nice way I can check that two variables are both (eg) some value of MyInt OR some value of MyBool (but not necessarily the same value - just as long as it isn't the case that (for instance) one is MyInt and the other is MyBool) without matching each possibility (only two here, but there are more in reality)?
shinnya has quit [Ping timeout: 264 seconds]
r0b2 has joined #ocaml
philtor has joined #ocaml
ygrek has joined #ocaml
<Drup>
if I understand what you want : no
<Drup>
match x, y with MyInt _ , MyInt _ -> ... | MyBool _, MyBool _ -> ... | _ -> ...
talzeus has quit [Read error: Connection reset by peer]
nikki93 has quit [Remote host closed the connection]
nikki93 has joined #ocaml
nikki93 has quit [Remote host closed the connection]
talzeus has joined #ocaml
serwombat has quit [Ping timeout: 240 seconds]
jpdeplaix has quit [Ping timeout: 244 seconds]
nikki93 has joined #ocaml
jpdeplaix has joined #ocaml
pyon has joined #ocaml
philtor has quit [Remote host closed the connection]
lostcuaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dsheets_ has quit [Ping timeout: 245 seconds]
siddhart1v_away is now known as siddharthv
csakatoku has joined #ocaml
S11001001 has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
rob3 has joined #ocaml
r0b2 has quit [Ping timeout: 252 seconds]
Guest___ has joined #ocaml
introom2 has joined #ocaml
Guest___ has quit [Quit: Computer has gone to sleep.]
yacks has joined #ocaml
Guest___ has joined #ocaml
ygrek has quit [Ping timeout: 240 seconds]
druzac has joined #ocaml
axiles has joined #ocaml
claudiuc has joined #ocaml
claudiuc_ has joined #ocaml
claudiuc has quit [Read error: Connection reset by peer]
<philip_>
after 5 hours i am suprised to see no new content on here.
<adrien>
on the night from sunday to monday?
<adrien>
last message was 4 hours ago, I'd say that was a very active night :)
<flux>
muzer, well, another way might be just defining a function such as: let constructor_of_t x = match x with MyInt _ -> MyIntTag | .. etc (or the same with polymorphic variants), and then use that function
<flux>
but I suppose it doesn't really make that patrticular case much easier. it might ease other cases, though.
<flux>
muzer, if you really feel compelled to reduce the amount of code, you could use the functions found from Obj, and risk the wrath of whomever needs to debug your code after a segfault ;).
<flux>
(though I suppose calling just Obj.tag should be safe, though the results could sometimes be unexpected)
arturgadelshin has joined #ocaml
ygrek has joined #ocaml
angerman has joined #ocaml
Kakadu has joined #ocaml
<philip_>
exit
maurer has quit [Remote host closed the connection]
philip_ has quit [Quit: Lost terminal]
maurer has joined #ocaml
arturgadelshin has quit [Ping timeout: 244 seconds]
maurer has quit [Ping timeout: 265 seconds]
maurer has joined #ocaml
maurer has quit [Ping timeout: 240 seconds]
maurer has joined #ocaml
<Kakadu>
#join #english
<Kakadu>
oups
maurer has quit [Ping timeout: 240 seconds]
ygrek has quit [Ping timeout: 265 seconds]
maurer has joined #ocaml
claudiuc has joined #ocaml
claudiuc_ has quit [Ping timeout: 240 seconds]
csakatoku has quit [Remote host closed the connection]
druzac has quit []
angerman has quit [Read error: Connection reset by peer]
Guest___ has quit [Quit: Computer has gone to sleep.]
introom2 has quit [Ping timeout: 240 seconds]
csakatoku has joined #ocaml
yacks has quit [Ping timeout: 240 seconds]
angerman has joined #ocaml
angerman has quit [Read error: Connection reset by peer]
Guest___ has joined #ocaml
angerman has joined #ocaml
ygrek has joined #ocaml
siddharthv is now known as siddharthv_away
arjunguha has joined #ocaml
ggole has joined #ocaml
arjunguha has quit [Ping timeout: 240 seconds]
cago has joined #ocaml
ygrek has quit [Ping timeout: 244 seconds]
arjunguha has joined #ocaml
struktured has quit [Read error: Operation timed out]
ulfdoz has joined #ocaml
arturgadelshin has joined #ocaml
arjunguha has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
avsm has joined #ocaml
struktured has joined #ocaml
yacks has joined #ocaml
arjunguha has joined #ocaml
ygrek has joined #ocaml
arjunguha has quit [Client Quit]
Thooms has joined #ocaml
johnelse_away is now known as johnelse
Simn has joined #ocaml
avsm has quit [Quit: Leaving.]
arjunguha has joined #ocaml
siddharthv_away is now known as siddharthv
arjunguha has quit [Client Quit]
arjunguha has joined #ocaml
arjunguha has quit [Client Quit]
mika1 has joined #ocaml
cdidd has quit [Read error: Operation timed out]
arjunguha has joined #ocaml
maurer has quit [Remote host closed the connection]
maurer has joined #ocaml
arjunguha has quit [Ping timeout: 252 seconds]
csakatoku has quit [Remote host closed the connection]
struktured has quit [Ping timeout: 264 seconds]
csakatoku has joined #ocaml
AltGr has joined #ocaml
mort___ has joined #ocaml
bicgena has quit [Quit: Connection closed for inactivity]
ulfdoz has quit [Ping timeout: 264 seconds]
ulfdoz has joined #ocaml
Dongyancai has quit [Ping timeout: 252 seconds]
Dongyancai has joined #ocaml
arturgadelshin1 has joined #ocaml
maurer has quit [Ping timeout: 265 seconds]
arturgadelshin has quit [Ping timeout: 240 seconds]
arturgadelshin1 is now known as arturgadelshin
sw1nn has joined #ocaml
maurer has joined #ocaml
sw1nn is now known as Guest45104
ddosia has joined #ocaml
Guest45104 is now known as sw1nn`
sw1nn` is now known as Guest49314
Dongyancai has quit [Ping timeout: 240 seconds]
Guest49314 has quit [Remote host closed the connection]
maurer has quit [Remote host closed the connection]
maurer has joined #ocaml
csakatoku has quit [Remote host closed the connection]
ulfdoz has quit [Ping timeout: 240 seconds]
Dongyancai has joined #ocaml
divyansr__ has joined #ocaml
sw1nn has joined #ocaml
jonludlam has joined #ocaml
maurer has quit [Ping timeout: 244 seconds]
ulfdoz has joined #ocaml
Dongyancai has quit [Ping timeout: 240 seconds]
Dongyancai has joined #ocaml
ggole has quit [Ping timeout: 240 seconds]
maurer has joined #ocaml
Dongyancai has quit [Ping timeout: 240 seconds]
ggole has joined #ocaml
maurer has quit [Ping timeout: 252 seconds]
sw1nn has quit [Ping timeout: 240 seconds]
Dongyancai has joined #ocaml
lostcuaz has joined #ocaml
ulfdoz has quit [Ping timeout: 240 seconds]
maurer has joined #ocaml
lostcuaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cdidd has joined #ocaml
maurer has quit [Ping timeout: 240 seconds]
maurer has joined #ocaml
ygrek has quit [Ping timeout: 244 seconds]
skchrko has joined #ocaml
freling has joined #ocaml
introom2 has joined #ocaml
Dongyancai has quit [Ping timeout: 244 seconds]
Dongyancai has joined #ocaml
dsheets_ has joined #ocaml
csakatoku has joined #ocaml
csakatoku has quit [Remote host closed the connection]
Dongyancai has quit [Ping timeout: 252 seconds]
Dongyancai has joined #ocaml
bicgena has joined #ocaml
ygrek has joined #ocaml
avsm has joined #ocaml
Dongyancai has quit [Ping timeout: 264 seconds]
Dongyancai has joined #ocaml
cdidd has quit [Ping timeout: 240 seconds]
maurer has quit [Remote host closed the connection]
maurer has joined #ocaml
avsm has quit [Quit: Leaving.]
avsm has joined #ocaml
rand000 has joined #ocaml
Guest___ has quit [Quit: Computer has gone to sleep.]
talzeus has quit [Remote host closed the connection]
hyperboreean has quit [Quit: leaving]
hyperboreean has joined #ocaml
_5kg has quit [Ping timeout: 252 seconds]
Dongyancai has quit [Ping timeout: 240 seconds]
siddharthv is now known as siddharthv_away
maurer has quit [Ping timeout: 240 seconds]
Dongyancai has joined #ocaml
maurer has joined #ocaml
serwombat has joined #ocaml
divyansr__ has quit [Quit: Connection closed for inactivity]
bjorkintosh has quit [Ping timeout: 252 seconds]
G________ has joined #ocaml
introom2 has quit [Ping timeout: 264 seconds]
cdidd has joined #ocaml
maurer has quit [Remote host closed the connection]
maurer has joined #ocaml
Dongyancai has quit [Ping timeout: 252 seconds]
bjorkintosh has joined #ocaml
introom2 has joined #ocaml
Dongyancai has joined #ocaml
Dongyancai has quit [Ping timeout: 244 seconds]
Dongyancai has joined #ocaml
lostcuaz has joined #ocaml
lostcuaz has quit [Read error: Connection reset by peer]
lostcuaz has joined #ocaml
talzeus has joined #ocaml
rand000 has quit [Quit: leaving]
talzeus has quit [Remote host closed the connection]
csakatoku has joined #ocaml
talzeus has joined #ocaml
yacks has quit [Quit: Leaving]
AltGr has left #ocaml []
AltGr has joined #ocaml
<Kakadu>
Any ideas what is wrong it this line? Lwt_Query.view dbh <:view< { id=node.id } | node in $nodes_table$; node.id=$string:nodeId$; >>
<Kakadu>
it says: Parse error: EOI expected after [view] (in [view])
arj has joined #ocaml
Dongyancai has quit [Ping timeout: 240 seconds]
<Drup>
(for anyone wondering what the crazy syntax is, it's macaque syntax extension)
lostcuaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
G________ has quit [Quit: Computer has gone to sleep.]
tchell has quit [Ping timeout: 264 seconds]
tchell has joined #ocaml
csakatoku has quit [Remote host closed the connection]
yacks has joined #ocaml
Dongyancai has joined #ocaml
darkf has quit [Ping timeout: 265 seconds]
maufred has quit [Ping timeout: 264 seconds]
maufred has joined #ocaml
claudiuc has quit [Read error: Connection reset by peer]
claudiuc has joined #ocaml
rks_ has quit [Ping timeout: 264 seconds]
rks has joined #ocaml
pyon has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
<jpdeplaix>
Kakadu: tell me if you don't want/have time to fill a bug. Otherwise I can do it for you.
<adrien_oww>
there's no fsync at all in Unix?
<adrien_oww>
ygrek: ^
struktured has joined #ocaml
Thooms has quit [Ping timeout: 240 seconds]
Thooms has joined #ocaml
sw1nn has joined #ocaml
lostcuaz has joined #ocaml
mort___ has quit [Ping timeout: 240 seconds]
Dongyancai has quit [Ping timeout: 240 seconds]
Dongyancai has joined #ocaml
pango has quit [Read error: Operation timed out]
lostcuaz has quit [Ping timeout: 244 seconds]
Anarchos has joined #ocaml
<Muzer>
flux: thanks - fair enough, I'll leave in
<Muzer>
*it
Thooms has quit [Ping timeout: 244 seconds]
<Kakadu>
jpdeplaix: done
lostcuaz has joined #ocaml
gael has quit [Ping timeout: 264 seconds]
gael has joined #ocaml
lostcuaz has quit [Ping timeout: 252 seconds]
maurer has quit [Remote host closed the connection]
maurer has joined #ocaml
saml has joined #ocaml
maurer has quit [Read error: Operation timed out]
<ygrek>
adrien_oww, ?
<ygrek>
there is in extunix
avsm has quit [Quit: Leaving.]
Thooms has joined #ocaml
pango has joined #ocaml
zpe has joined #ocaml
maurer has joined #ocaml
<adrien_oww>
ygrek: thought so, thanks
mika1 has quit [Ping timeout: 265 seconds]
mika1 has joined #ocaml
struktured has quit [Ping timeout: 240 seconds]
lostcuaz has joined #ocaml
shinnya has joined #ocaml
rand000 has joined #ocaml
serwombat has quit [Ping timeout: 240 seconds]
amirmc has joined #ocaml
Thooms has quit [Ping timeout: 240 seconds]
michael_lee has joined #ocaml
arturgadelshin has quit [Ping timeout: 264 seconds]
teiresias has quit [Ping timeout: 265 seconds]
tobiasBora has quit [Read error: Connection reset by peer]
arjunguha has joined #ocaml
maurer has quit [Ping timeout: 240 seconds]
mort___ has joined #ocaml
maurer has joined #ocaml
teiresias has joined #ocaml
arjunguha has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
serwombat has joined #ocaml
_5kg has joined #ocaml
ollehar has quit [Quit: ollehar]
r0b4 has joined #ocaml
rob3 has quit [Ping timeout: 240 seconds]
maurer has quit [Remote host closed the connection]
serwombat has quit [Ping timeout: 240 seconds]
dsheets__ has joined #ocaml
dsheets__ is now known as dsheets
dsheets_ has quit [Ping timeout: 244 seconds]
ocp has quit [Ping timeout: 245 seconds]
lostcuaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
maurer has joined #ocaml
oriba has joined #ocaml
mgodshall has joined #ocaml
introom2 has quit [Ping timeout: 264 seconds]
nlucaroni has joined #ocaml
ollehar has joined #ocaml
yacks has quit [Quit: Leaving]
shinnya has quit [Ping timeout: 240 seconds]
S11001001 has joined #ocaml
S11001001 has quit [Changing host]
S11001001 has joined #ocaml
<oriba>
I want to make a string-substitution with Pcre, and replace a matched string by a group-of-that-string, e.g. something like s/(.*?)foobar/$1/g
<oriba>
How to do that?
<oriba>
I tried Pcre.replace but the \1 will be replaced literally.
<oriba>
I mean the group will be replaced by the "\1"
arturgadelshin has joined #ocaml
maurer has quit [Ping timeout: 240 seconds]
<oriba>
Or is Pcre.substitute, what I need, not Pcre.replace?
mika1 has quit [Quit: Leaving.]
arjunguha has joined #ocaml
skchrko has quit [Read error: Operation timed out]
Guest___ has joined #ocaml
arjunguha has quit [Client Quit]
<companion_cube>
no idea, isn't there a documentation?
arjunguha has joined #ocaml
<companion_cube>
val get_named_substring <-- you may need to use this to extract the captured group?
lostcuaz has joined #ocaml
<oriba>
companion_cube, always the same with me and PCre-ocaml: I learn, use and forget :-( I would prefer to have a book or something like that...
Fullma has joined #ocaml
<oriba>
Ah, just found it out: I can use Pcre.replace with itempl... and e.g. ~itempl:(Pcre.subst "$1")
Kakadu has quit [Ping timeout: 245 seconds]
boogie has joined #ocaml
<companion_cube>
oriba: would be nice if you wrote something on the web about it ;)
<companion_cube>
(or try to enhance the doc)
AltGr has left #ocaml []
<oriba>
companion_cube, hmhh.... it's not my code... so enhancing the doc... don't know if thats an easy way...
skchrko has joined #ocaml
<companion_cube>
oriba: if you can grab the code (git repo), you can propose a patch to the author
bicgena has quit [Quit: Connection closed for inactivity]
<oriba>
hmhh, not sure if it's in a git repo. Maybe an external text would make sense...
<oriba>
(If I want a book, I could write one ;-))
arjunguha has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
root_empire has joined #ocaml
<companion_cube>
oriba: I mean, if you can add 3 lines of text in the ocamldoc saying "if you want to substitute with a captured group, do this and this"
<companion_cube>
I think the author would merge it
michael_lee has quit [Ping timeout: 265 seconds]
<oriba>
companion_cube, maybe he would merge it... just adding some more sentences would make things much clearer I think...
<oriba>
hmhh... it's on bitbucket... (mercurial, not git)
<oriba>
well, maybe it's worth thinking about it... some m ore general explanations could be added, or some sentences at each of the functions... I think about contacting the author, maybe thats a good idea.
<Drup>
oriba: which library are you using ?
<oriba>
Pcre-ocaml
<oriba>
I use it sometimes, write some wraoping code and forget the details
<oriba>
next time I stumble ove the same things again
claudiuc has quit [Remote host closed the connection]
<Drup>
ok
<Drup>
(you don't really need pcre for what you did, btw)
<oriba>
Drup, Str would do that... or what would you use for it?
jwatzman|work has joined #ocaml
<Drup>
ocaml-re
<Drup>
don't use Str
<Drup>
just don't
mort___ has quit [Ping timeout: 244 seconds]
<jpdeplaix>
why ?
ygrek has quit [Ping timeout: 240 seconds]
<Drup>
crappy interface, full of state, not even super efficient
<adrien>
but it has split!
<Drup>
:D
<oriba>
Drup I know that Str is deprecated, thats why I use pcre.
<oriba>
But what is ocaml-re?
<adrien>
deprecated?
<oriba>
not officially
<Drup>
another regular expression library, it's just "re" in opam