<pippijn>
whitequark: I didn't know about this feature until recently, when I was reading the ocamllex grammar specification
lunaryorn has joined #ocaml
<whitequark>
pippijn: I actually needed it, to exclude whole Unicode classes.
<gasche>
(foo | bar) would work, wouldn't it?
<whitequark>
gasche: but I need to exclude them.
<gasche>
oh, I see
<gasche>
I missed the caret
<whitequark>
[^"()" unicode_C unicode_Z] is what I have now
<whitequark>
but that doesn't work
<gasche>
interesting
<kerneis>
is ulex still maintained?
<whitequark>
last release in 2008
<kerneis>
whitequark: anyway, adding support for # is a one-line patch
<kerneis>
in pa_ulex.ml
<whitequark>
yeah, figured it out already
<kerneis>
probably worth sending an email to Alain, in case he still cares
<whitequark>
yeah
<whitequark>
hm. what exactly does # do in ocamllex?
<whitequark>
A # B → A but not B ?..
siddharthv is now known as siddharthv_away
<kerneis>
(difference of character sets) Regular expressions regexp1 and regexp2 must be character sets defined with [… ] (or a a single character expression or underscore _). Match the difference of the two specified character sets.
<pippijn>
set difference
<kerneis>
not that A and B are restricted to character sets
<kerneis>
not any regexp
<whitequark>
right. that's a bit more complex than an one-line patch
<pippijn>
hehe
<thorsten`>
is there a ocaml library that implements a shell-like repl interface (history, readline-support, tokenizing, quoting,..)?
<kerneis>
yes, because you must handle the cases for [ ] and [^ ]
<adrien_oww>
thorsten`: rlwrap, utop, lambda-term and something else I've forgotten about
<adrien_oww>
erf
<Drup>
oh, you want to use shell comands inside ocaml ?
<adrien_oww>
not rlwrap but ledit of course
* adrien_oww
catching up on backlog and now hiding
<thorsten`>
Drup: no, just easy command-line-style access to all the functionality ;)
<Drup>
oh, right
avsm has joined #ocaml
<Drup>
cmdliner then
<Drup>
(if I get what you want)
<Drup>
(I'm a bit slow today)
<thorsten`>
the name sounds primising
<ggole>
I'd love a decent toplevel :(
<Drup>
ggole: isn't utop decent enough ?
<ggole>
Everything is rubbish compared to, say, slime
<ggole>
Of course that's partly a language thing
<ggole>
Eg, not having enough information to print constructor names
<whitequark>
done!
<ggole>
Or having no way to print (non-built in) sequences
<mk270>
gday - i'm using oasis to build some libraries used in an executable, all in separate directories; i can access the supposedly "internal" modules of these libraries from outside - is that expected?
<ggole>
And no real debugger support or backtraces
<ggole>
And none of the nice stuff like , commands, the inspector, etc, etc
<Drup>
ggole: you have backtraces, you just need to add the flag at compile time
<ggole>
Not in the toplevel
<Drup>
oh, maybe
<Drup>
I don't use the toplevel all that much
<ggole>
I have a makefile hack to make it slightly less tedious and workflow breaking (ie type the offending code into debugrun.ml, make debugrun, OCAMLRUNPARAM="b1" ./debugrun.byte)
<thorsten`>
hm no, cmdliner just is a library for advanced command line argument parsing
<ggole>
But that doesn't really compare favourably to "look at the screen, which is showing what you want"
<Drup>
thorsten`: then I still don't get what you want :(
zpe has joined #ocaml
talzeus has quit [Remote host closed the connection]
<hcarty>
mk270: I don't know if it's expected, but it is how the tool currently works. It's caused me trouble in a project with two libraries which share internal module names.
<mk270>
hcarty: cheers
<Drup>
mk270: there is a bug report about it, I think
<mk270>
hcarty: i want to be able to split code across files
<mk270>
without external programs/libs being able to get under the hood
<Drup>
thorsten`: If you want to re implement a custom shell, then zed + lambda-term
<mk270>
drup: thanks .. that's fairly bad news
<mk270>
hcarty: do you mean "it's how oasis currently works"? or how something else in the toolchain does, e.g., ocamlbuild?
<Drup>
it's oasis fault
<mk270>
drup: thanks
<mk270>
drup: so i can do this with lower-levels tools, but oasis is not using these tools the way i want?
<Drup>
as far as I understand it, it's an installation issue,
<mk270>
ok
<Drup>
mk270: which version of oasis are you using ?
<hcarty>
mk270: What Drup said :-)
<mk270>
unknown option `--version'.
<Drup>
drop the "--"
<mk270>
v0.4.2
<mk270>
drup: it was a joke
<Drup>
you need the smileys ! :O
<mk270>
no, they confuse bash
<hcarty>
mk270: Packing your libraries should hide internal modules. Unfortunately that doesn't seem to work within a single _oasis file.
<Drup>
try to update it, it may be solved in a more recent version
<Drup>
not sure, should ask jpdeplaix about that
<mk270>
hcarty: ah ok - my code is already split up into directories - i could deepen the split and make a separate _oasis for each
<mk270>
... but then i'd have to install the packed modules somewhere, i guess, during the build?
<mk270>
this i
<mk270>
this all seems like a mess
<whitequark>
opam is really cool. all I needed was to do opam pin ulex git://github.com/whitequark/ulex
<hcarty>
Drup: Do you have a link to the bug report? I searched through the bugs reported on the forge but didn't find anything
<Drup>
hcarty: I don't find it anymore
avsm has joined #ocaml
<whitequark>
kerneis: hm, does ocamllex have a way to concatenate two regexps as well?
<whitequark>
er, not concatenate
<whitequark>
make a union
<Drup>
whitequark: union is just |
<whitequark>
Drup: that won't work if I want to subtract that regexp from something else
<Drup>
that's not an union then :D
<ggole>
There's no difference operation afaik
<whitequark>
no. I mean I can't do foo # (bar | baz)
<whitequark>
ggole: there is, #, and I just reimplemented it for ocamllex
<Drup>
you could do (foo # bar) # baz
<ggole>
Oh, really?
<ggole>
Never mind then.
<whitequark>
ggole: er, s,ocamllex,ulex, in last message
<whitequark>
ocamllex has it already
<jpdeplaix>
mk270, Drup: InternalModules should work as expected with this version
<jpdeplaix>
(or maybe I didn't understand your question
<jpdeplaix>
)
<Drup>
jpdeplaix: the bug was fixed in 0.4.3 ?
<Drup>
(their was a bug previously, right ?)
<Drup>
there*
<jpdeplaix>
mk270: mmmh oh. You have several libraries and you don't want to access to the internal modules ?
<jpdeplaix>
Drup: nope.
<jpdeplaix>
there were no bugs
<Drup>
huum
<Drup>
weird
<jpdeplaix>
but the remaining tyxml « bug » can only be fixed with the subdirectories feature
<Drup>
oh, right
<Drup>
that was not a internal modules issue, but a "everything end up in the same directory" issue
<Drup>
thorsten`: was zed+lambda-term what you are looking for ? it's a bit overkill I think but you should find in the example something similar to what you want (I think)
<mk270>
when i add InternalModules to the _oasis file for the first library, it doesn't stop other libraries and exes in the _oasis file from accessing those modules
<Drup>
mk270: are all those in the same directory ?
<Drup>
if yes, it's normal
lunaryorn has joined #ocaml
<mk270>
drup: all in separate subdirs: src/{lib1,lib2,lib3,exe}
<hcarty>
jpdeplaix: Ah, I apologize - I just submitted a bug before reading your response
<hcarty>
jpdeplaix: Is there a workaround from within oasis?
divyanshu has joined #ocaml
Thooms has quit [Quit: WeeChat 0.3.8]
tristero has joined #ocaml
ygrek has joined #ocaml
tristero has quit [Quit: tristero]
aurynj has quit [Ping timeout: 240 seconds]
tristero has joined #ocaml
avsm has joined #ocaml
talzeus has joined #ocaml
yacks has joined #ocaml
avsm has quit [Ping timeout: 245 seconds]
talzeus_ has joined #ocaml
talzeus has quit [Ping timeout: 240 seconds]
nikki93 has joined #ocaml
saml has joined #ocaml
avsm has joined #ocaml
mort___ has joined #ocaml
avsm has quit [Quit: Leaving.]
Hannibal_Smith has joined #ocaml
<orbitz>
Is there a good implementation of a sorted associative datastructure that provides an iterator for walking in in a sorted fashion? Preferabbly reasonably performant
<companion_cube>
you mean, Map ?
aurynj has joined #ocaml
<orbitz>
does that provide an iterator?
<orbitz>
I effectively want "find me the first key to match this value" "find me the next key after this value" in sorted order
<companion_cube>
orbitz: does a fold function match your definition of "iterator"?
<orbitz>
no
<orbitz>
since I have to fold over th whole thing
<companion_cube>
there is Map.split
<companion_cube>
otherwise if you can use Batteries, it contains Map.enum to really iterate
<gasche>
yeah, we don't have enough contenders for the perfect enumeration interface yet
<Drup>
Sequence :D
<companion_cube>
gasche: ;)
<companion_cube>
you need several interfaces, that's all
<gasche>
possibly
mort___ has joined #ocaml
<gasche>
but note that your fold_stop can trivially be achieved with fold and an exception
<companion_cube>
this is just a glorified Sequence.t
<companion_cube>
yes
<gasche>
orbitz: if you expect to fold over a *small* number of values, next_key iteration is probably best
nikki93 has joined #ocaml
<gasche>
if you expect to fold over an arbitrary number of value, split then fold would be best
lunaryorn has quit []
mort___ has quit [Ping timeout: 252 seconds]
Hannibal_Smith has quit [Read error: Connection reset by peer]
jonludlam has quit [Ping timeout: 268 seconds]
Hannibal_Smith has joined #ocaml
<ggole>
You could do an "applicative for loop" for folds
<companion_cube>
what would that be?
<ggole>
Something like, say, for x = init, elt in List.iter | loop (f elt x) | x
<ggole>
Where loop denotes recursion with arguments
<ggole>
The | x is how to handle end of iteration
<ggole>
And if you want to stop, just don't call loop.
<companion_cube>
I prefer the stoppable fold :p
<companion_cube>
it's easier to implement
<ggole>
It's pretty obvious sugar for a recursive function, really
<companion_cube>
sugar is bad for your teeth :p
<ggole>
(The main benefit is that you could make it trivial to iterate over multiple things without having to write fold2s for them.)
<ggole>
And for stoppable folds you have to come up with a protocol for stopping and returning a value
<ggole>
You end up with silly explicit booleans and it isn't very readable.
jonludlam has joined #ocaml
<companion_cube>
no, read what I wrote, variants are good for this
avsm has joined #ocaml
<ggole>
That's just booleans with names.
<companion_cube>
sure, but that's readable
<ggole>
(Probably a better choice than true/false, though.)
Ptival has left #ocaml []
avsm has quit [Ping timeout: 246 seconds]
angerman has joined #ocaml
Yoric has quit [Ping timeout: 240 seconds]
ollehar has quit [Ping timeout: 265 seconds]
Simn has quit [Ping timeout: 246 seconds]
Simn has joined #ocaml
<orbitz>
gasche: the size of teh map will be large but the number of items taken per-go will be small
tane has joined #ocaml
<mrvn>
ggole: raise (Result x)
thomasga1 has joined #ocaml
jwatzman|work has joined #ocaml
thomasga has quit [Ping timeout: 245 seconds]
<ggole>
That's even worse: you have to write the try, the raise, and define the exception (oops, no inference for that, and I hope the return value isn't polymorphic). None of which have much to do with iteration.
lostcuaz has quit [Ping timeout: 265 seconds]
Eyyub has quit [Ping timeout: 268 seconds]
lostcuaz has joined #ocaml
nikki93 has quit [Remote host closed the connection]
avsm has joined #ocaml
nikki93 has joined #ocaml
avsm has quit [Ping timeout: 240 seconds]
angerman has quit [Quit: Bye]
angerman has joined #ocaml
AltGr has left #ocaml []
lopho has quit [Quit: Leaving]
Kakadu has quit [Ping timeout: 245 seconds]
S11001001 has joined #ocaml
S11001001 has quit [Changing host]
S11001001 has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
appleby has joined #ocaml
zpe has quit [Ping timeout: 246 seconds]
Yoric has joined #ocaml
jonludlam has quit [Remote host closed the connection]
Yoric has quit [Ping timeout: 246 seconds]
appleby has quit [Ping timeout: 252 seconds]
appleby has joined #ocaml
yacks has quit [Remote host closed the connection]
angerman has quit [Quit: Gone]
appleby has quit [Quit: appleby]
WraithM has joined #ocaml
S11001001 has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
nikki93 has quit [Remote host closed the connection]
angerman has joined #ocaml
Hannibal_Smith has quit [Quit: Sto andando via]
Yoric has joined #ocaml
Yoric has quit [Ping timeout: 255 seconds]
appleby has joined #ocaml
Kakadu has joined #ocaml
angerman has quit [Quit: Gone]
zpe has joined #ocaml
thomasga1 has quit [Quit: Leaving.]
dsheets has quit [Ping timeout: 255 seconds]
Thooms has joined #ocaml
appleby has quit [Quit: appleby]
willy_ has joined #ocaml
angerman has joined #ocaml
divyanshu has quit [Quit: Computer has gone to sleep.]
<jpdeplaix>
hcarty: with ocamlbuild maybe. I think you can play with directories and include directive (as sylvain pointed)
nikki93 has joined #ocaml
maattdd has quit [Ping timeout: 252 seconds]
ygrek has quit [Ping timeout: 264 seconds]
alex_nx_ has quit [Ping timeout: 252 seconds]
amiller_ has quit [Ping timeout: 265 seconds]
smondet has quit [Ping timeout: 255 seconds]
tlockney is now known as tlockney_away
nikki93 has quit [Remote host closed the connection]
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
tlockney_away is now known as tlockney
zpe has quit [Ping timeout: 268 seconds]
claudiuc has joined #ocaml
tlockney is now known as tlockney_away
<hcarty>
jpdeplaix: I'll take a look. Hopefully there is a reasonably simple way to acheive this.
mort___ has joined #ocaml
tlockney_away is now known as tlockney
tristan__ has left #ocaml []
jonludlam has joined #ocaml
maattdd has joined #ocaml
claudiuc has quit [Read error: Connection reset by peer]
claudiuc_ has joined #ocaml
claudiuc has joined #ocaml
S11001001 has joined #ocaml
claudiu__ has joined #ocaml
claudiuc_ has quit [Ping timeout: 265 seconds]
maattdd has quit [Ping timeout: 240 seconds]
S11001001 has quit [Changing host]
S11001001 has joined #ocaml
smondet has joined #ocaml
claudiuc has quit [Ping timeout: 265 seconds]
alex_nx has joined #ocaml
smondet has quit [Ping timeout: 240 seconds]
smondet has joined #ocaml
Guest43376 has joined #ocaml
ddosia has joined #ocaml
lostcuaz has quit [Ping timeout: 264 seconds]
lostcuaz has joined #ocaml
lostcuaz has quit [Read error: Connection reset by peer]
lostcuaz has joined #ocaml
lostcuaz has quit [Read error: Connection reset by peer]
mort___ has quit [Quit: Leaving.]
lostcuaz has joined #ocaml
lostcuaz has quit [Read error: Connection reset by peer]
lostcuaz has joined #ocaml
araujo has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 252 seconds]
Yoric has joined #ocaml
nikki93 has joined #ocaml
bjorkintosh has quit [Ping timeout: 265 seconds]
ggole has quit []
shinnya has joined #ocaml
Yoric has quit [Ping timeout: 264 seconds]
claudiuc has joined #ocaml
Yoric has joined #ocaml
claudiu__ has quit [Ping timeout: 265 seconds]
bjkeller has joined #ocaml
maattdd has joined #ocaml
<mk270>
hcarty: thanks - is it actually a missing feature in ocamlbuild too?
maattdd has quit [Ping timeout: 265 seconds]
ollehar has joined #ocaml
claudiuc_ has joined #ocaml
vpit3833 has quit [Ping timeout: 240 seconds]
Guest43376 is now known as amiller
amiller has quit [Changing host]
amiller has joined #ocaml
thomasga has joined #ocaml
claudiuc has quit [Ping timeout: 265 seconds]
nikki93 has quit [Remote host closed the connection]
dsheets has joined #ocaml
_andre has quit [Quit: leaving]
Don_Pellegrino has joined #ocaml
nikki93 has joined #ocaml
appleby has joined #ocaml
WraithM has quit [Read error: Connection reset by peer]
WraithM has joined #ocaml
Armael has quit [Ping timeout: 246 seconds]
bjorkintosh has joined #ocaml
Armael has joined #ocaml
axiles has quit [Remote host closed the connection]
jwatzman|work has quit [Quit: jwatzman|work]
appleby has quit [Quit: appleby]
maattdd has joined #ocaml
tane has quit [Quit: Verlassend]
Yoric has quit [Ping timeout: 246 seconds]
jwatzman|work has joined #ocaml
jwatzman|work has quit [Changing host]
jwatzman|work has joined #ocaml
angerman has quit [Quit: Gone]
jwatzman|work has quit [Quit: jwatzman|work]
<ousado>
hi all. I'm looking at extlib PMap.iter - the docs say "The order in which the bindings are passed to f is unspecified" - and I don't see how that could be the case
<ousado>
iter does in-order traversal, it's a binary search tree.
<Drup>
"unspecified" doesn't mean there is no order
<Drup>
it means that you are not supposed to rely on it, because it could possibly change between minor versions
<ousado>
true
<ousado>
it's used in the haxe compiler to represent anon types (like records) and I remember having had issues, because the order of fields for the same anon type was different
<ousado>
for several instances of that type
<ousado>
and now I'm starting to think I'm insane
<ousado>
that code hasn't changed for 8 years.
manizzle has joined #ocaml
Yoric has joined #ocaml
michael_lee has quit [Remote host closed the connection]
keen__ has joined #ocaml
keen_ has quit [Ping timeout: 265 seconds]
lostcuaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]