infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
wtetzner has quit [Remote host closed the connection]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
sz0 has quit [Quit: Connection closed for inactivity]
shinnya has joined #ocaml
ziyourenxiang has quit [Quit: Leaving]
mengu has joined #ocaml
mengu has quit [Ping timeout: 268 seconds]
nomicflux has joined #ocaml
mengu has joined #ocaml
nomicflux has quit [Quit: nomicflux]
mengu has quit [Ping timeout: 240 seconds]
shinnya has quit [Ping timeout: 240 seconds]
cbot_ has quit [Quit: Leaving]
cbot has joined #ocaml
pilne has quit [Quit: Quitting!]
_whitelogger has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 240 seconds]
lucasem has left #ocaml [#ocaml]
mengu has joined #ocaml
mengu has quit [Ping timeout: 240 seconds]
mengu has joined #ocaml
cbot has quit [Read error: Connection reset by peer]
mengu has quit [Ping timeout: 256 seconds]
lostman_ has joined #ocaml
lostman_ is now known as lostman
_whitelogger has joined #ocaml
_whitelogger has joined #ocaml
minn has quit [Ping timeout: 240 seconds]
MercurialAlchemi has joined #ocaml
ziyourenxiang has joined #ocaml
_whitelogger has joined #ocaml
mengu has joined #ocaml
mengu has quit [Ping timeout: 260 seconds]
Simn has joined #ocaml
mengu has joined #ocaml
mengu has quit [Ping timeout: 264 seconds]
argent_smith has joined #ocaml
fraggle_ has quit [Read error: Connection reset by peer]
fraggle_ has joined #ocaml
slash^ has joined #ocaml
johnelse has quit [Ping timeout: 240 seconds]
johnelse has joined #ocaml
<Simn>
Why does oasis build .cmo files if I use `CompiledObject: native` everywhere?
mengu has joined #ocaml
<companion_cube>
good question
fraggle_ has quit [Remote host closed the connection]
average has joined #ocaml
slash^ has quit [Remote host closed the connection]
<infinity0>
gasche: standard backslash-escaping made it more awkward to implement in higher-level languages and "-quoting doesn't exist uniformly AFAICT so we would've had to reimplement it anyways
<infinity0>
this way you can just split on ":" "=" without worrying whether the previous character was a \
<Simn>
Looks like it needs the .cmo files to build the .cma files, which raises the question why it builds these...
larhat has joined #ocaml
rand__ has joined #ocaml
snhmib has joined #ocaml
octachron has joined #ocaml
orbifx has joined #ocaml
Simn has quit [Quit: Leaving]
zv has quit [Ping timeout: 268 seconds]
<orbifx>
does tyxml have an escape function for turning unescaped strings into escaped ones?
lostman has quit [Quit: Connection closed for inactivity]
<orbifx>
I want to use it externally, withouth using the rest of the framework
govg has joined #ocaml
fraggle_ has joined #ocaml
zv has joined #ocaml
<gasche>
infinity0: but the non-standard escaping adds quite a bit of complexity, or at least 'distance from what is already known', to your specification
<gasche>
(it also makes it hard for humans to define the environment variable)
rwmjones has quit [Ping timeout: 255 seconds]
rwmjones has joined #ocaml
<gasche>
(as in: I understand why this encoding scheme is objectively good, but I am pointing out that it looks subjectively complex and that it may create some resistance to adoption)
sepp2k has joined #ocaml
slash^ has joined #ocaml
<infinity0>
gasche: well, patches are what counts, and they would just be a few lines. we also have a bunch of example code
rawra has joined #ocaml
silver has joined #ocaml
mengu has quit [Remote host closed the connection]
mengu has joined #ocaml
rpg_ has joined #ocaml
mengu has quit [Ping timeout: 246 seconds]
_whitelogger has joined #ocaml
rpg_ has quit [Ping timeout: 264 seconds]
wtetzner has joined #ocaml
trapz has joined #ocaml
jnavila has joined #ocaml
pilne has joined #ocaml
trapz has quit [Quit: trapz]
cbot has joined #ocaml
trapz has joined #ocaml
Simn has joined #ocaml
wtetzner has quit [Remote host closed the connection]
<infinity0>
ocaml does have the optimisation where if i check <long string> = <long string> it will first test for physical equality before comparing the entire string, right?
<lapinot>
mhh ocaml scoping is weird.. i have a module defining some type t and a submodule in which i want to alias type t = <Outer>.t .. but the compiler complains that this abbreviation is cyclic. Is there any way to specify that in the definition, t refers to the outer one (which is already defined)?
<Drup>
lapinot: "type nonrec t = t"
<lapinot>
Drup: cool, why isn't this a default? (especially since let binding have the opposite default)
<Drup>
because it would break nearly all packages in existance :p
<Drup>
it's a bit unfortunate, but it's a very old decision, and it's pretty much impossible to change now
<lapinot>
i see.. so the one to blame is xavier leroy ;) actually it's not so annoying, once you know it
jsoo has joined #ocaml
jsoo has quit [Client Quit]
adnotamentum has joined #ocaml
shinnya has quit [Ping timeout: 260 seconds]
tane has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 240 seconds]
Simn has quit [Ping timeout: 246 seconds]
orbifx has quit [Ping timeout: 240 seconds]
nomicflux has joined #ocaml
bungoman_ has quit [Ping timeout: 246 seconds]
Simn has joined #ocaml
sh0t has joined #ocaml
orbifx has joined #ocaml
bungoman has joined #ocaml
sh0t has quit [Ping timeout: 240 seconds]
MercurialAlchemi has joined #ocaml
nomicflux has quit [Quit: nomicflux]
<zozozo>
infinity0: the polymorphic equality (=) does not check fro physical equality first afaik, so you should probably define your own comparison function
rpg_ has joined #ocaml
_rpg has joined #ocaml
rpg_ has quit [Ping timeout: 256 seconds]
sh0t has joined #ocaml
silver has quit [Read error: Connection reset by peer]
silver has joined #ocaml
argent_smith has quit [Quit: Leaving.]
nomicflux has joined #ocaml
nomicflux has quit [Client Quit]
ollehar has joined #ocaml
sh0t has quit [Remote host closed the connection]
<infinity0>
zozozo: ah that's a shame. yeah that doesn't seem so hard, i can do that. i thought it would be an "obvious" thing to optimise though
sh0t has joined #ocaml
alphor has joined #ocaml
<hannes>
infinity0: according to byterun/str.c caml_string_compare first checks physical equality, then length, then contents
sh0t has quit [Client Quit]
sh0t has joined #ocaml
<infinity0>
ah thanks, yes
nomicflux has joined #ocaml
<zozozo>
:o, my bad
<hannes>
(not entirely sure whether this is bytecode only or native as well)
<mengu>
thanks shon_, i'm writing the pitch for my startup
<mengu>
in the meanwhile studying some ocaml
nomicflux has quit [Quit: nomicflux]
<mengu>
& data structures
<mengu>
in the code above, i got that it appends to the head of the queue
<mengu>
but i did not get how it can pop from the tail
<mengu>
can anyone help me understand what am i missinG?
<mengu>
missing*
jnavila has quit [Ping timeout: 240 seconds]
<shon_>
Lemme take a look.
<shon_>
at this line, input, item :: output -> item, (input,output) the tail of the queue is destructured into it's head and tail (i.e., it takes off the first element of the "output" list) and returns that.
<shon_>
We can be sure that the head of the output list will be the "last" element of output list, because every time time the output list gets empty, and we try to pop from it, we reverse the input list, and store that as the output.
<shon_>
input, [] -> pop ([], List.rev input)
<mengu>
oh
<mengu>
the last line
<mengu>
i missed that
<mengu>
i was going to bang my head against the wall
<shon_>
Makes sense?
<mengu>
shon_: of course it does
<mengu>
thanks
<mengu>
i haven't seen the last line where it reverses the input
<shon_>
(^_^)d
<mengu>
so i could not get how output was retrieved
<shon_>
Yeah... I think that would have read cleaner if the exception was raised as the final case.
<shon_>
But then I think it would be incorrect too...
<mengu>
yeah, input can be empty
<shon_>
unless you destructured input to ensure it wasn't empty.
<mengu>
indeed
tane has quit [Ping timeout: 260 seconds]
jnavila has joined #ocaml
<shon_>
That's probably what I would have done, since it would end up giving you aline symmetrical with the first case.
<octachron>
Personally, I would also expand input to (_ :: _ as input), the choice of raising an exception is also questionable
<shon_>
True. An implementation using total functions might be a good addition.
slash^ has quit [Remote host closed the connection]
jnavila has quit [Ping timeout: 240 seconds]
<mengu>
thanks shon_
tane has joined #ocaml
<mengu>
would a mutable version where you just change the ref of tail run faster than this reversing version?
jnavila has joined #ocaml
kakadu has joined #ocaml
TheLemonMan has joined #ocaml
jnavila has quit [Ping timeout: 240 seconds]
<shon_>
mengu: Yeah, I'm pretty sure and it would certainly save space, but you'd give up persistence.
<shon_>
However, Okasaki has a nice treatment of how to leverage laziness and memoization to get O(1) amortaized performance even while taking advantage of persistency in "Purely Functional Data Structures".
<shon_>
I'm inexpert in these areas, but I'm finiding the book fun.
<mengu>
shon_: i've just started reading that book
<mengu>
i'm actually on the amortization section
<shon_>
Ah! We're in about the same place then :)
<shon_>
I'm just half way through chapter 6
<mengu>
i'm reading it through safaribooksonline
<shon_>
I assume the improved performance of the mutating approach must be why the std lib uses it (as per the comments on that Rosetta Code implementation).
jnavila has joined #ocaml
<mengu>
shon_: it's a great book, a great reference material
rand___ has joined #ocaml
orbifx has quit [Ping timeout: 260 seconds]
ryanartecona has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 258 seconds]
sh0t has quit [Quit: Leaving]
sh0t has joined #ocaml
sh0t has quit [Client Quit]
sepp2k has quit [Quit: Leaving.]
jnavila has quit [Read error: Connection reset by peer]
Simn has quit [Quit: Leaving]
sh0t has joined #ocaml
octachron has quit [Quit: Leaving]
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
mfp has joined #ocaml
spew has joined #ocaml
sh0t has quit [Remote host closed the connection]
sh0t has joined #ocaml
rand___ has quit [Quit: leaving]
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
rand__ has quit [Quit: leaving]
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
ollehar has quit [Quit: ollehar]
murmour has quit [Quit: Leaving.]
sh0t has quit [Remote host closed the connection]
tane has quit [Quit: Leaving]
spew has quit [Quit: foobar]
silver has quit [Quit: rakede]
wtetzner has quit [Remote host closed the connection]
maattdd has quit [Ping timeout: 246 seconds]
<adnotamentum>
Hey, we're working with Ocamllex/yacc but for some reason our lexer isn't able to read numbers when it should http://pastebin.com/1Q5YPxcz