gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.1 http://bit.ly/nNVIVH
<thelema> flush_all ()
<dgbaley27> It looks like I can do i with %! too?
<thelema> yes
<thelema> although that only flushes just the channel it's "printed" to
sebz has quit [Quit: Computer has gone to sleep.]
sebz has joined #ocaml
junsuijin has joined #ocaml
dnolen has quit [Quit: dnolen]
dnolen has joined #ocaml
dnolen has quit [Client Quit]
virtuoussin13 has joined #ocaml
<virtuoussin13> Is there a good way to have a list that can be modified in place that I can append to, not prepend to?
<virtuoussin13> Array's don't seem to grow on demand...
lopex has quit []
<kurtosis> I run some command that returns a huge list but when its printed in the toplevel ocaml only shows part of it and a ..., is there any way to make it output all of it?
<virtuoussin13> kurtosis: not that I know of
dgbaley27 has left #ocaml []
<_habnabit> virtuoussin13, what are you using it for?
emmanuelux has quit [Ping timeout: 244 seconds]
<virtuoussin13> _habnabit: er...a list that grows?
<virtuoussin13> I'm not trying to be sarcastic, I'm not really sure what you're asking
<_habnabit> virtuoussin13, what will you do with the list?
<_habnabit> virtuoussin13, if you're not going to do anything but append to it, why keep a list at all?
<virtuoussin13> I mean, I'll read off the results afterwards
virtuoussin13 has quit [Quit: ChatZilla 0.9.87 [Firefox 7.0.1/20110930100559]]
lusory has joined #ocaml
dnolen has joined #ocaml
dnolen has quit [Client Quit]
dnolen has joined #ocaml
bobry has quit [Ping timeout: 260 seconds]
sebz has quit [Quit: Computer has gone to sleep.]
bobry has joined #ocaml
junsuijin has quit [Quit: Leaving.]
sebz has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
sebz has joined #ocaml
rks has quit [Read error: Operation timed out]
rks has joined #ocaml
ulfdoz has joined #ocaml
sebz has quit []
dnolen has quit [Quit: dnolen]
ygrek has joined #ocaml
ulfdoz has quit [Ping timeout: 255 seconds]
hto has joined #ocaml
dirkD has joined #ocaml
avsm has joined #ocaml
ttamttam has joined #ocaml
avsm has quit [Quit: Leaving.]
ttamttam has quit [Quit: ttamttam]
edwin has joined #ocaml
ttamttam has joined #ocaml
ygrek has quit [Ping timeout: 248 seconds]
lusory has quit [Ping timeout: 260 seconds]
thomasga has joined #ocaml
Cyanure has joined #ocaml
avsm has joined #ocaml
avsm has quit [Remote host closed the connection]
avsm has joined #ocaml
<raphael-p> kurtosis: iirc #print_length is the way
avsm has quit [Quit: Leaving.]
dirkD has quit [Ping timeout: 258 seconds]
seafood has joined #ocaml
serpentologist has left #ocaml []
ikaros has joined #ocaml
seafood has quit [Ping timeout: 260 seconds]
milosn has quit [Ping timeout: 252 seconds]
larhat has joined #ocaml
kizzx2 has joined #ocaml
kizzx2 has quit [Read error: Connection reset by peer]
kizzx2 has joined #ocaml
kizzx2 has quit [Read error: Connection reset by peer]
lopex has joined #ocaml
milosn has joined #ocaml
Kakadu has joined #ocaml
avsm has joined #ocaml
ygrek has joined #ocaml
ygrek has quit [Ping timeout: 248 seconds]
_andre has joined #ocaml
Mocus has joined #ocaml
<Mocus> hello :)
<Kakadu> Ave Mocus! Morituri te salutant!
<Kakadu> :-)
emmanuelux has joined #ocaml
mfp has quit [Read error: Connection reset by peer]
<adrien> errrr, no!
avsm has quit [Quit: Leaving.]
mfp has joined #ocaml
<Mocus> what editor do you use for ocaml ? at school we used emacs + tuareg, but I'm vim addicted
<Mocus> but with emacs, I love to have the possibilty to split into 2 screens, one for editor, one to test the code
<edwin> I use vi
<edwin> vim*
<edwin> there are 2 syntax plugins for ocaml
<edwin> the builtin one usually works just fine though
<adrien> I use vim
<adrien> you don't have the tuareg mode but it works fine
<edwin> I don't think there is anything like the ocaml toplevel integration in emacs though
<larhat> you can use utop in emacs
<Kakadu> there are two Eclipse plugins, but I use emacs
mjonsson has joined #ocaml
<Mocus> in fact I don't want to use emacs, if I have to use it, tuareg is perfect
<Mocus> but I love the top-level feature :p
joelr has joined #ocaml
<joelr> moin
<joelr> gildor: should i use oasis 0.2.1 alpha?
oriba has joined #ocaml
<adrien> 15:02 @ gildor : adrien: go for 0.2.1~alpha, it is quite safe
avsm has joined #ocaml
<joelr> coo
<joelr> cool
<joelr> how do you use oasis-db these days? can you?
<raphael-p> Mocus: you can use Conque
<raphael-p> Mocus: install http://www.vim.org/scripts/script.php?script_id=2771 then do :ConqueTermSplit ocaml
sebz has joined #ocaml
mjonsson has quit [Remote host closed the connection]
<thelema> joelr: I use oasis-db with odb: https://github.com/thelema/odb
<joelr> thelema: so first build odb and then use it to bring in packages, right? how do i tell oasis to use these? do i at all or are they just installed normally?
<Mocus> raphael-p: I'll give a look, thx :)
<thelema> no build needed to use odb, just `ocaml odb.ml <args>` or chmod 755 odb.ml
<thelema> and packages are installed normally.
<joelr> scratching my head here, where does type-conv.syntax come from/
<joelr> thelema: thanks
<joelr> ocamlfind: Package `type-conv.syntax' not found - Required by `odn.with.syntax'
<joelr> i just installed type-conv
<thelema> If you don't --sudo or have access to the system-wide package dir, it'll install to its own dir
<thelema> and you'll have to add that to the path
<thelema> joel: `ocamlfind list | grep type-conv`
<thelema> if there's no type-conv.syntax, maybe you have the wrong version of type-conv, maybe you need to install differently
<joelr> thelema: i downloaded type-conv from jane st, version 2.3.0 and did it per installation instructions, configure, build install
<thelema> what's your final goal - to build oasis?
<joelr> thelema: yep. a bit of a pain in the ass, it looks like. need to update all sorts of packages.
<joelr> maybe it's for the greater good
<thelema> try just using odb to install it and all its deps
<thelema> `ocaml odb.ml oasis` should just work
<joelr> thelema: let me try that. the issue, i think, is that i upgraded ocaml from 12.0 to 12.1
<thelema> no worries
<joelr> and the magic moment...
<joelr> thelema: Problem with installed package: oUnit / Installed package is not available to the system / Make sure /Users/joelr/.odb/bin is in your PATH and /Users/joelr/.odb/lib is in your OCAMLPATH
<joelr> thelema: what does that mean? it successfully built oUnit
<joelr> and installed it, e.g. Installed /Users/joelr/.odb/lib/oUnit/OUnit.mli
<joelr> do i have to tell ocamlfind about ~/.odb/lib?
<thelema> means it's using a local package library. Under bash, you can do `export OCAMLPATH=~/.odb/lib` to inform ocamlfind
<thelema> and similarly for your path
<joelr> thelema: isn't there a global ocamlfind config file?
<thelema> there is - findlib.conf
<joelr> thelema: wait, how do i tell odb to install everything in a standard location? run as root?
<joelr> trying that
thomasga has quit [Quit: Leaving.]
<thelema> If you have access to this, you can probably use --sudo or --have-perms
<thelema> --sudo if you need to sudo, --have-perms if you already have permission to the global package dir
<joelr> ok
<joelr> Installed /usr/local/lib/ocaml/site-lib/odn/META
<joelr> Exception: Sys_error "/Users/joelr/.odb: No such file or directory".
<joelr> thelema: why does it still want to use ~/.odb?
<joelr> ok, after creating ~/.odb it's going much better
<thelema> that's odd, maybe a bug.
redsteg has joined #ocaml
<joelr> thelema: i used --force to reinstall but still
<joelr> ocamlfind: Package oasis is already installed
<joelr> - (file /usr/local/lib/ocaml/site-lib/oasis/META already exists)
<joelr> Exception: Failure "Could not install package oasis".
<joelr> removing manually
<thelema> okay, another bug - thanks for finding these. --force used to work.
<joelr> glad to be of help
<joelr> ok, i think i successfully installed oasis
<thelema> it still needs ~/.odb for its installs - why didn't it work...
<thelema> why didn't it auto-create...
<joelr> thelema: it should have created ~/.odb. right. i had to create it manually.
<joelr> and run --force a few times
<joelr> manually removing some packages
<thelema> there's a --force-all that forces more.
<thelema> maybe that would have worked better - force is only for named deps
<thelema> maybe force should do force-all
<joelr> thelema: well, if i use force, i sort of assume it will force everything. maybe force-this and force-all?
<thelema> ah, found the bug with .odb not being created.
<thelema> as to force, I'll think more on that.
<joelr> ok
<thelema> Maybe better error messages to indicate --force-all is needed if force doesn't suffice
<joelr> ok
sebz has quit [Quit: Computer has gone to sleep.]
surikator has joined #ocaml
emmanuelux has quit [Ping timeout: 244 seconds]
seafood has joined #ocaml
Mocus has quit [Quit: Page closed]
<joelr> how do you extract from a string the sub-strings matching a regexp?
sebz has joined #ocaml
<joelr> Str.split (Str.regexp "(\\d+)\\s+(\\d+)") "111 334";;
sebz has quit [Client Quit]
<joelr> this doesn't do it, obviously
<joelr> e.g. does not give me ["111"; "334"]
<raphael-p> joelr: would Str.full_split do?
<sgnb> the Str module is pretty well documented
<joelr> checking
<joelr> # Str.full_split (Str.regexp "(\\d+)\\s+(\\d+)") "111 334";;
<joelr> - : Str.split_result list = [Str.Text "111 334"]
<joelr> no
<raphael-p> you'd just need to get either the Delims or the Texts depending on what you want
<joelr> does not do it
<joelr> i want the texts
<sgnb> you don't want splitting here
<thelema> joelr: matched_group
<raphael-p> Str.full_split (Str.regexp "(\\d+)") smthg;;
<thelema> raphael-p: no, you split on the delimiter - "\\s+"
<raphael-p> if you use full_split you can either get the Delims or the Texts
<thelema> joelr: odb.ml uses Str for this kind of thing - see lines 96-98
<thelema> raphael-p: oops, sorry. you're right. you probably want the other way, though
<joelr> thelema: thanks!
<raphael-p> thelema: yes, probably.. But in some cases it's easier to do that than to invert the regexp
<thelema> raphael-p: I hadn't considered the difficulty of inverting the regexp. Yes, sometimes this might be useful
seafood has quit [Quit: seafood]
fracek has joined #ocaml
everyonemines has joined #ocaml
Kakadu has quit [Quit: Page closed]
dirkD has joined #ocaml
<joelr> # Str.string_match (Str.regexp "\\d+") "111 334" 0;;
<joelr> - : bool = false
<joelr> why?!
<adrien> (because mikmatch is seriously nice)
<joelr> mikmatch?
<adrien> I don't think character classes are handled by Str (might be wrong though)
<adrien> yup, no class I think
<thelema> joelr: look at string_partial_match
<adrien> but maybe Scanf would work better for you in this case
<thelema> and agreed with adrien - regexp is probably the wrong tool for this job
<adrien> mikmatch is a syntax extension which can use Pcre of Str and gives a nice syntax
<joelr> thelema: i can't seem to be able to install mikmatch usign odb
<thelema> joelr: it's not uploaded to oasis-db, is it?
<raphael-p> joelr: adrien is right, \\d isn't available in Str
<joelr> darn
<raphael-p> you have to use [0-9]+
<joelr> ok
<joelr> # Str.string_match (Str.regexp "[0-9]+\\s+[0-9]+") "111 334" 0;;
<joelr> - : bool = false
<joelr> i must be an idiot
<raphael-p> joelr: \\s
<raphael-p> it's not supported either
<joelr> haha
<joelr> ok, time for mikmatch
<raphael-p> alternatives: pcre, lex+parse, regexp
<adrien> joelr: \\+ too maybe
<adrien> mikmatch is a bit hard at first, it takes some time, but it's quite nice to read again and the code is quite clean
<adrien> plus you can use : ([0-9] as some_var_name)
surikator has quit [Quit: Scientific discovery is just maximal compression of strings. Nothing more, nothing less.]
<adrien> (approximate syntax)
<adrien> and it binds the number to "some_var_name"
<raphael-p> adrien: str uses +
<adrien> no more \\1, \\2, ...
<adrien> raphael-p: ok; I never know which one use which =/
* joelr is installing mikmatch
<joelr> can you use mikmatch from the toplevel? (trying...)
<adrien> yup
<adrien> there's a section about that in the doc
<joelr> argh… required tophide
<joelr> back in a few
lopex has quit []
oriba_ has joined #ocaml
oriba has quit [Ping timeout: 258 seconds]
larhat has quit [Quit: Leaving.]
<joelr> back
<joelr> looks like mikmatch doesn't work in the 3.10 (and later?) toplevel
fracek has left #ocaml []
ygrek has joined #ocaml
lopex has joined #ocaml
ulfdoz has joined #ocaml
<joelr> adrien: how does backreferencing work with mikmatch?
<joelr> i don't see an example that looks like mine
<joelr> # match "abcabc" with RE _* as x !x -> x;;
<joelr> - : string = "abc"
<joelr> that's not very helpful
<joelr> hmm… i think i'm catching a drift… slowly...
<ulfdoz> Ihr seid eklig.
<ulfdoz> ewin, ihr seid nicht eklig. sorry.
ankit9 has quit [Quit: Leaving]
ztfw has joined #ocaml
junsuijin has joined #ocaml
joelr_ has joined #ocaml
joelr has quit [Read error: Connection reset by peer]
joelr_ is now known as joelr
<joelr> how do you map over a string?
<joelr> e.g. i need to apply a function to every character and collect results into a list
joelr_ has joined #ocaml
<thelema> String.fold_left
<joelr_> oh...
<thelema> or explode and list.map
<joelr_> thelema: that (fold_left) doesn't seem to be in themanual
_andre has quit [Ping timeout: 252 seconds]
_andre has joined #ocaml
<thelema> it's in batteries.
<joelr_> thelema: there you go ;-)
<thelema> If you want to make your own, use iter and a mutable output list
<joelr_> mutable output list… that would be a list ref, right?
<thelema> yes
<thelema> or a stack or queue or something else
<joelr_> ok
joelr has quit [Ping timeout: 252 seconds]
joelr_ is now known as joelr
<mfp> joelr: Buffer might be of use...
<joelr> mfp: buffer?
<mfp> Buffer, as in, the module with that name :)
<joelr> ok
sepp2k has joined #ocaml
sepp2k has quit [Quit: Leaving.]
tac-tics has joined #ocaml
ankit9 has joined #ocaml
oriba_ is now known as oriba
junsuijin has quit [Quit: Leaving.]
lpereira has joined #ocaml
<joelr> thelema: how do i tell odb to build native versions as well as bytecode?
everyonemines has quit [Quit: Leaving.]
avsm has quit [Quit: Leaving.]
<thelema> joelr: odb just runs the normal configure; make; make install (modulo oasis/omake/makefile)
<thelema> joelr: if there's a package that's building only bytecode, we need to fix that in oasis-db to have the right scripting
<joelr> thelema: extlib
<joelr> Error: Cannot find file /usr/local/lib/ocaml/site-lib/extlib/extLib.cmxa
<thelema> bah, by default it only compiles bytecode.
<thelema> for this case, maybe easiest to just go to ~/.odb/install-extlib/extlib-1.5.2/
<thelema> and run make all uninstall install
<thelema> err, make opt uninstall install
<joelr> thelema: will do
<thelema> hmm, maybe I should oasis-ify their code for them
<joelr> ./odb.ml extlib
<joelr> Package extlib already installed, use --force to reinstall
<joelr> thelema: ^
<joelr> it's not in ~/.odb
<joelr> ls ~/.odb/
<joelr> bininstall-oasis
<joelr> install-expect.strlib
<thelema> if you're using --sudo, odb uses a temp dir
<joelr> ah, right
<joelr> i'll install it manually then
<thelema> rather, *the* temp dir, as detected by ocaml
<thelema> for me, it's /tmp
<thelema> so /tmp/install-extlib/extlib...
<thelema> gildor: not a high priority, but it'd be nice to de-uglify the admin odb page
tac-tics has left #ocaml []
avsm1 has joined #ocaml
oriba has quit [Quit: oriba]
zorun has quit [Ping timeout: 244 seconds]
zorun has joined #ocaml
_andre has quit [Quit: leaving]
dirkD has quit [Ping timeout: 244 seconds]
lpereira has quit [Quit: Leaving.]
ztfw has quit [Remote host closed the connection]
edwin has quit [Quit: Leaving.]
avsm1 has quit [Quit: Leaving.]
<joelr> how do you get stack traces in the toplevel?
<thelema> joelr: no such thing - no line numbers
<joelr> right...
<thelema> you can get a run trace by doing ...
<thelema> #trace <function-name>
<joelr> cool
Modius has joined #ocaml
lopexx has joined #ocaml
lopex has quit [Ping timeout: 258 seconds]
lopexx is now known as lopex
fraggle_ has quit [Read error: Connection reset by peer]
seafood has joined #ocaml
fraggle_ has joined #ocaml
seafood has quit [Quit: seafood]
Julien_T has joined #ocaml
Cyanure has quit [Ping timeout: 276 seconds]
hto has quit [Quit: Lost terminal]
joelr has quit [Quit: joelr]
ygrek has quit [Ping timeout: 248 seconds]
Amorphous has quit [Ping timeout: 255 seconds]
sebz has joined #ocaml
Amorphous has joined #ocaml
emmanuelux has joined #ocaml
lopexx has joined #ocaml
lopex has quit [Ping timeout: 258 seconds]
lopexx is now known as lopex
schme has joined #ocaml
schme has quit [Changing host]
schme has joined #ocaml
brendan has quit [Quit: leaving]
brendan has joined #ocaml
bzzbzz has joined #ocaml
Julien_T has quit [Ping timeout: 244 seconds]