<dmbaturin>
When I define types, should I always have unique type constructor names?
<mrvn>
Within a module that is preferable. But I often have Module.t
<flux>
4.02? brought some ability to disambiguate, but I would still choose to use unique constructor names within a module
<flux>
simply for the fact that when you read the code, it can help you :)
shinnya has joined #ocaml
<dmbaturin>
http://bpaste.net/show/yHsvhzncejo4dVncAav8/ I noticed that at least in top level loop if you use the same constructor name, it compiles but that constrctor belongs to the last defined type.
<mrvn>
just like binding a variable
<flux>
but you can type let x : foo = Int 42
<flux>
starting at least from 4.01
<flux>
but, as I said, I wouldn't recommend it, unless it's much more convenient :)
<flux>
I've actually tried out the mechanism for sharing record field names, not sure yet if I prefer it or not..
Kakadu has joined #ocaml
<dmbaturin>
flux: "let x: foo = Int 42" doesn't seem to work in 4.00.1. Wonder if I should upgrade ocaml.
ollehar has quit [Ping timeout: 244 seconds]
<flux>
it is a very recent feature
Haudegen has quit [Quit: No Ping reply in 180 seconds.]
NoNNaN has quit [Remote host closed the connection]
NoNNaN has joined #ocaml
travisbrady has joined #ocaml
Sim_n has joined #ocaml
Simn has quit [Ping timeout: 240 seconds]
rand000 has quit [Quit: leaving]
oriba has joined #ocaml
oriba has quit [Client Quit]
pgomes has joined #ocaml
Sim_n is now known as Simn
SethTisue has joined #ocaml
oriba has joined #ocaml
travisbrady has quit [Quit: travisbrady]
<adrien>
anyone remember whether the M.(...) syntax is in ocaml 3.12?
Thooms has joined #ocaml
<dsheets>
adrien, is not, iirc
parcs has quit [Remote host closed the connection]
<adrien>
ok, thanks
<adrien>
damn
<dsheets>
adrien, hmmm actually it is
<dsheets>
3.12.1 anway
<adrien>
well, I'll have to do a run with a 3.12 because I'm sure I've introduced some 4.00-isms
shinnya has quit [Ping timeout: 272 seconds]
<adrien>
hmmm
<adrien>
you sure?
<dsheets>
ya, just tested
<adrien>
I remembered I had a machine with 3.12.1 and it seems to work
<dsheets>
Objective Caml version 3.12.1 # String.(length (create 12));; - : int = 12
<adrien>
ah, I hadn't seen one of your message
<adrien>
the one saying it actually is :)
<adrien>
well, perfect then :)
<adrien>
then Drup can continue to criticize me for keeping compat with 3.12.1
<Drup>
:D
<adrien>
actually I've been pondering dropping it after the next release of win-builds
<adrien>
but ubuntu 12.04 has it and it's still widespread
parcs has joined #ocaml
ousado has quit [Remote host closed the connection]
ousado has joined #ocaml
<whitequark>
companion_cube: so, I fixed my mill
racycle has joined #ocaml
zarul has joined #ocaml
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
eikke__ has quit [Ping timeout: 245 seconds]
Submarine has quit [Quit: Leaving]
racycle has quit [Quit: ZZZzzz…]
englishm has quit [Ping timeout: 264 seconds]
englishm has joined #ocaml
tac-tics has joined #ocaml
avsm has joined #ocaml
fold has quit [Ping timeout: 255 seconds]
fold has joined #ocaml
Algebr has joined #ocaml
pgomes has quit [Ping timeout: 250 seconds]
<Algebr>
I'm trying to use some of menhir's neater features. Say I have a list of (qualifiers * string), like a list of arguments to a function. I'm guessing I can't do separated_list(COMMA, (qual, ident)) ?
<Drup>
just do a rule that return a pair (qualifiers * string)
<Drup>
and call "separated_list(COMMA, qual_ident)
<Algebr>
seems like every answer related to the parser generator is along the lines of "make another rule" lol.
<Drup>
well, how is the parser going to guess how your pair is formated ?
<Algebr>
is guessing involving when the error messages say stuff like "arbirtrarily resolved"
<Drup>
yes and no, not the same guessing
<Drup>
what I mean is that : what is the syntax for a pair of rule like (qual, ident) ?
<Algebr>
i guess something like q = QUAL; COLON; i = IDENT { (q, i) }
<Drup>
no paranthesis ? why a colon and not, let's say, a semicolon ? :)
<Drup>
hence why you have to make a new rule for it.
<Algebr>
ah
<Drup>
(or use a higher level rule, I think there is one for pairs, but you can define it too)
Nuki has joined #ocaml
<Algebr>
How can you usually tell the difference between a literal string and an identifier?
<mrvn>
ups
<mrvn>
a string starts with "
<Algebr>
what's ups?
<mrvn>
Algebr: ignore that
<mrvn>
Normaly you tokenize the input. A string becomes a token STRING of string and an ident a token IDENT of string
axiles has joined #ocaml
<Drup>
Algebr: <mrvn style>an international postal service</mrvn style>
<Drup>
;)
<Algebr>
yea, that's what I'm confused about scanner rule for that. Would a string rule be like "\"someregexforeverthingascii\""
<Drup>
or just : "\" [^"\""]* "\""
<Algebr>
would this also work: "\".*\""
<Drup>
actually : '"' [^'"']* '"'
<mrvn>
or more complex if you allow/count nested comments in strings
<Drup>
Algebr: you might have issues related to eagerness with this rule
<mrvn>
Drup: you have to consider \" inside a string too
<Drup>
yeah
axiles has quit [Client Quit]
<mrvn>
'"' ([^'"']*|\\'"')* '"'
<mrvn>
'"' ([^'"'\\]|\\'"')* '"'
axiles has joined #ocaml
<mrvn>
and other \x sequenzes: '"' ([^'"'\\]|\\'"'|\\[^'"'])* '"'
sad0ur has quit [Ping timeout: 240 seconds]
Kakadu has quit [Quit: Page closed]
jao has quit [Ping timeout: 250 seconds]
BitPuffin has quit [Ping timeout: 264 seconds]
sad0ur has joined #ocaml
englishm has quit [Remote host closed the connection]
Muzer has quit [Excess Flood]
avsm has quit [Quit: Leaving.]
BitPuffin has joined #ocaml
Muzer has joined #ocaml
_0xAX has joined #ocaml
NoNNaN has quit [Read error: Connection reset by peer]
studybot has quit [Write error: Connection reset by peer]
Algebr has quit [Ping timeout: 250 seconds]
NoNNaN has joined #ocaml
studybot has joined #ocaml
maattdd has joined #ocaml
bjorkintosh has quit [Remote host closed the connection]
ygrek has joined #ocaml
bjorkintosh has joined #ocaml
<whitequark>
companion_cube: nevermind, I suck at machining anyway
<Drup>
whitequark: I think companion_cube is in holiday until september now :p
ollehar1 has joined #ocaml
ollehar1 has quit [Client Quit]
BitPuffin has quit [Ping timeout: 240 seconds]
englishm has joined #ocaml
BitPuffin has joined #ocaml
<dmbaturin>
Is it possible to compile ocaml code into a shared library?
cody__ has joined #ocaml
<adrien>
yes
samrat has joined #ocaml
samrat has quit [Client Quit]
samrat has joined #ocaml
<dmbaturin>
I started something in python, but I wonder if I should rewrite the part that's dealing with fancy datastructures in ocaml instead.
manizzle has quit [Ping timeout: 260 seconds]
dsheets has quit [Ping timeout: 260 seconds]
englishm has quit [Remote host closed the connection]
fold has quit [Ping timeout: 255 seconds]
ygrek has quit [Ping timeout: 272 seconds]
jprakash has joined #ocaml
<cody__>
interfacing python and ocaml is not easy
<Drup>
I think the 0install guy serialized everything to comunicate between the two parts, when there was two parts
<cody__>
that seems reasonable
<Drup>
depends of the amount of communication
samrat has quit [Remote host closed the connection]
<Drup>
but the ocaml part might be faster than python enough to compensate the fact that you serialize (not counting the other benefits).
axiles has quit [Ping timeout: 250 seconds]
englishm has joined #ocaml
boogie has joined #ocaml
englishm has quit [Remote host closed the connection]
axiles has joined #ocaml
demonimin has quit [Remote host closed the connection]
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
demonimin has joined #ocaml
philtor has joined #ocaml
<adrien>
cody__: why are you trying to do that?
fold has joined #ocaml
oriba has quit [Quit: oriba]
MercurialAlchemi has joined #ocaml
Mercuria1Alchemi has joined #ocaml
<cody__>
I'm not trying to do anything
<cody__>
a while ago I was trying to interface ocaml and python
<cody__>
it was a nightmare
tane has joined #ocaml
maattdd has quit [Ping timeout: 264 seconds]
zarul has quit [Read error: Connection reset by peer]
zarul has joined #ocaml
boogie has quit [Quit: Leaving...]
<adrien>
you were aware there were exiting projects, right?
<adrien>
dmbaturin: ocaml in a shared library works well
<adrien>
it's quite simple too
<Drup>
ocaml-python ?
<Drup>
tried to use that once
<dmbaturin>
cody__: What are the main problems in interfacing with python?
<cody__>
there's no way to do it cleanly
<Drup>
afair, it doesn't work at all
<cody__>
pycaml is dead and buried
<Drup>
(it was a few years ago)
<cody__>
so you can either try to ressurect it or write your own hackish interface
<Drup>
(I was naive and hopeful)
<cody__>
basically do ocaml <-> C <-> Python
<cody__>
but then garbage collecting will be a nightmare
<Drup>
(or serialize everything)
<adrien>
I've seen pycaml work :P
<cody__>
if you're brave you can try using swig + C glue code
jao has quit [Ping timeout: 244 seconds]
<cody__>
but the cost would probably outweight the benifits
<dmbaturin>
Speaking of that, is it true that the marshalling module kills all type safety?
<Drup>
it doesn't kills *all* type safety
<Drup>
it's just unsafe, period.
<whitequark>
it just leads to undefined behavior if you unmarshall something that has a different type than you expect
<Drup>
(which often results in a segfault)
philtor has quit [Ping timeout: 250 seconds]
<cody__>
makes it hard to debug things
<adrien>
segfault? look for uses of Obj and Marshal :P
<Drup>
explosions of explosions \o/
<dmbaturin>
type explosions = Explosions of explosions ;;
<Drup>
type explosion = Explosions of explosions
<Drup>
and explosions = explosion list
<Drup>
:D
fold has quit [Ping timeout: 255 seconds]
axiles has quit [Ping timeout: 240 seconds]
<dmbaturin>
Oh, so "and" works for type definitions as well? Good to know.
<Drup>
for mutually recursive types, yes
_0xAX has quit [Remote host closed the connection]
Nuki has quit [Ping timeout: 255 seconds]
<dmbaturin>
I only used it for mutually recursive functions (I still need to make those a bit less mutually recursive).
axiles has joined #ocaml
<toroidalcode>
works for mutually recursive modules, too
<dmbaturin>
Nice.
<dmbaturin>
I'm still to write my first module.
<whitequark>
any .ml file is a module ;D
<dmbaturin>
Well, I mean a full-fledged module with .mli and stuff. :)
MercurialAlchemi has quit [Ping timeout: 240 seconds]
slash^ has quit [Read error: Connection reset by peer]
Mercuria1Alchemi has quit [Ping timeout: 240 seconds]
parcs has quit [Remote host closed the connection]
parcs has joined #ocaml
jprakash has quit [Ping timeout: 255 seconds]
axiles has quit [Ping timeout: 244 seconds]
bezirg has joined #ocaml
kvelicka has joined #ocaml
Muzer has quit [Excess Flood]
tac-tics has quit [Ping timeout: 240 seconds]
fold has joined #ocaml
Muzer has joined #ocaml
oriba has joined #ocaml
BitPuffin has quit [Ping timeout: 246 seconds]
bezirg has quit [Quit: Leaving.]
bezirg has joined #ocaml
bezirg has quit [Client Quit]
travisbrady has quit [Quit: travisbrady]
bezirg has joined #ocaml
<oriba>
any ideas, hot to make relative urls (links extrated from a web-page) to absolute urls easily? I have written such stuff long ago, and my solution looks ugly to me. Maybe there is an easy and clean way to it?
<oriba>
with ocamlnet
Thooms has quit [Read error: No route to host]
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
bezirg has quit [Quit: Leaving.]
bezirg has joined #ocaml
WraithM has joined #ocaml
jprakash has joined #ocaml
cthuluh has quit [Ping timeout: 260 seconds]
cthuluh has joined #ocaml
tac_ has joined #ocaml
philtor has joined #ocaml
bezirg has quit [Quit: Leaving.]
bezirg has joined #ocaml
bezirg has quit [Client Quit]
bezirg has joined #ocaml
bezirg has quit [Client Quit]
bezirg has joined #ocaml
bezirg has quit [Client Quit]
bezirg has joined #ocaml
BitPuffin has joined #ocaml
jprakash has quit [Ping timeout: 264 seconds]
rand000 has joined #ocaml
Hannibal_Smith has quit [Quit: Sto andando via]
fold has quit [Ping timeout: 244 seconds]
philtor has quit [Ping timeout: 240 seconds]
fraggle_laptop has quit [Read error: Connection reset by peer]
kvelicka has quit [Read error: Connection reset by peer]
kvelicka has joined #ocaml
kvelicka1 has joined #ocaml
rand000 has quit [Quit: leaving]
kvelicka has quit [Ping timeout: 250 seconds]
travisbrady has joined #ocaml
Simn has quit [Quit: Leaving]
travisbrady has quit [Client Quit]
tane has quit [Quit: Verlassend]
philtor has joined #ocaml
bezirg has quit [Ping timeout: 260 seconds]
mcclurmc has quit [Remote host closed the connection]
mcclurmc has joined #ocaml
simon_ has joined #ocaml
simon_ has quit [Client Quit]
mcclurmc has quit [Read error: Connection reset by peer]
mcclurmc has joined #ocaml
Nahra has joined #ocaml
tac-tics has joined #ocaml
pgomes has quit [Quit: Leaving]
nojb has quit [Ping timeout: 245 seconds]
racycle has joined #ocaml
tac_ has quit [Ping timeout: 240 seconds]
ia0 has quit [Quit: leaving]
bezirg has joined #ocaml
darkf has joined #ocaml
ia0 has joined #ocaml
lpvb has joined #ocaml
mcclurmc has quit [Read error: Connection reset by peer]
mcclurmc has joined #ocaml
Thooms has joined #ocaml
Skolem has joined #ocaml
oriba has quit [Quit: oriba]
<Skolem>
I’m having trouble installing conf-gnomecanvas with opam on OS X. libgnomecanvas2.0 was already installed with homebrew. opam says the compilation failed, but the resulting .env and .out files are empty. Here’s a typescript: http://pastebin.com/54C651TF Any suggestions on things I can try?
<Drup>
Skolem: do "opam show lablgtk", there are notes for macOS
Kakadu has quit [Quit: Konversation terminated!]
<Drup>
(I think it's related to your issue)
<Skolem>
Drup, that completely fixed it. Thank you!
shinnya has joined #ocaml
jprakash has joined #ocaml
madroach has quit [Ping timeout: 250 seconds]
bezirg has quit [Ping timeout: 260 seconds]
madroach has joined #ocaml
NoNNaN has quit [Remote host closed the connection]