flux changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 4.00.1 http://bit.ly/UHeZyT | http://www.ocaml.org | Public logs at http://tunes.org/~nef/logs/ocaml/
darkf has quit [Client Quit]
darkf has joined #ocaml
darkf has quit [Client Quit]
darkf has joined #ocaml
darkf has quit [Client Quit]
darkf has joined #ocaml
cdidd has joined #ocaml
ulfdoz has quit [Ping timeout: 240 seconds]
q66 has quit [Remote host closed the connection]
madroach has quit [*.net *.split]
emias has quit [*.net *.split]
jonafan has quit [*.net *.split]
othiym23 has quit [*.net *.split]
jon-shape has quit [*.net *.split]
nicoo has quit [*.net *.split]
troydm has quit [*.net *.split]
lopex has quit [*.net *.split]
fraggle_ has quit [*.net *.split]
clog has quit [*.net *.split]
jlouis has quit [*.net *.split]
bacam has quit [*.net *.split]
smango has quit [*.net *.split]
TaXules has quit [*.net *.split]
SuperNoeMan has quit [*.net *.split]
cthuluh has quit [*.net *.split]
pippijn has quit [*.net *.split]
adrien has quit [*.net *.split]
Derander has quit [*.net *.split]
Leonidas has quit [*.net *.split]
milosn has quit [*.net *.split]
jbrown has quit [*.net *.split]
sgnb has quit [*.net *.split]
orbitz has quit [*.net *.split]
vpm has quit [*.net *.split]
stephendwyer has quit [*.net *.split]
pr has quit [*.net *.split]
pippijn has joined #ocaml
cthuluh has joined #ocaml
ollehar has quit [Ping timeout: 255 seconds]
tane has quit [Quit: Verlassend]
eikke has quit [Ping timeout: 264 seconds]
yacks has quit [Read error: Connection reset by peer]
eikke has joined #ocaml
milosn has joined #ocaml
yacks has joined #ocaml
weie_ has joined #ocaml
weie has quit [Ping timeout: 248 seconds]
emmanuelux has quit [Quit: emmanuelux]
darkf has quit [Changing host]
darkf has joined #ocaml
madroach has joined #ocaml
Leonidas has joined #ocaml
troydm has joined #ocaml
jbrown has joined #ocaml
sgnb has joined #ocaml
SuperNoeMan has joined #ocaml
jonafan has joined #ocaml
lopex has joined #ocaml
fraggle_ has joined #ocaml
orbitz has joined #ocaml
vpm has joined #ocaml
othiym23 has joined #ocaml
jlouis has joined #ocaml
jon-shape has joined #ocaml
bacam has joined #ocaml
smango has joined #ocaml
nicoo has joined #ocaml
emias has joined #ocaml
TaXules has joined #ocaml
pr has joined #ocaml
eikke has quit [Ping timeout: 264 seconds]
Leonidas is now known as Guest38321
sgkim126l has quit [Quit: leaving]
Tekk_ has joined #ocaml
<Tekk_> anyone know why the ocaml.org 99 problems example 1 is the way it is? "get the last element of a list" is 4 lines long with conditionals
<Tekk_> (well, kinda conditionals)
<Tekk_> oh, because mine doesn't handle [], nevermind
<bernardofpc> in most cases you really want your matches to be total
<bernardofpc> how you do that (exceptions or options) could depend
<Tekk_> hmm. is it possible to open modules in subdirectories from the repl?
<Tekk_> at least in debian, ocamlnet is split into subdirectories in /usr/lib/ocaml
<Tekk_> I can't seem to find anything about using it interactively though
clog has joined #ocaml
walter has joined #ocaml
walter has quit [Client Quit]
leoncamel2 has joined #ocaml
yacks has quit [Read error: Connection reset by peer]
yacks has joined #ocaml
TDJACR has quit [Quit: Leaving :D]
tootooroo has joined #ocaml
tootooroo has quit [Read error: Connection reset by peer]
frogfoodeater has joined #ocaml
tootooroo has joined #ocaml
frogfoodeater has quit [Ping timeout: 260 seconds]
Kakadu has joined #ocaml
gnuvince has quit [Remote host closed the connection]
breakds has joined #ocaml
tootooroo has quit [Ping timeout: 256 seconds]
tootooroo has joined #ocaml
tootooroo has quit [Ping timeout: 245 seconds]
frogfoodeater has joined #ocaml
tootooroo has joined #ocaml
mattrepl has quit [Quit: mattrepl]
<orbitz> Tekk_: use ocamlfind
Yoric has joined #ocaml
Remjey_ has joined #ocaml
Remjey_ is now known as Remjey
frogfoodeater has quit [Ping timeout: 256 seconds]
breakds has quit [Quit: Konversation terminated!]
frogfoodeater has joined #ocaml
frogfoodeater has quit [Ping timeout: 264 seconds]
ttamttam has joined #ocaml
yacks has quit [Ping timeout: 256 seconds]
yacks has joined #ocaml
ollehar has joined #ocaml
<Remjey> hey, i'm new to ocaml and wanted to have a look at sources of a medium-sized ocaml application with good practices and comments included. i've tried to explore mldonkey a little but it's mostly uncommented and the code seems doesn't seem to be very homogenous
<Remjey> what application would you recommend ?
<Remjey> (background: i'm a java developper working with large industrial-quality applications, and did some haskell and lambda calculus in university)
<Kakadu> maybe ocaml-java will be interesting to u but I have never looked at its code
<flux> remjey, have you also looked at unison, or is it too small?
<flux> although I fear most of the code does have few comments :)
frogfoodeater has joined #ocaml
<flux> but, in my opinion, the most important thing is that the interfaces are clear and properly documented - even the internal ones
frogfoodeater has quit [Ping timeout: 264 seconds]
<Remjey> i'm downloading both, thanks :)
Snark has joined #ocaml
adrien_ is now known as adrien
<wmeyer> Remjey: I'd advise for many reasons not to look at mldonkey
<adrien> it's not _that_ ugly :P
<wmeyer> Remjey: even maintainers says that mldonkey is a bit special, in terms of quality
<adrien> 8000 lines of code mixing tabs and spaces can only be good imho
<adrien> (8000 in a single file)
<wmeyer> adrien: that's what I was actually told by ygrek
<wmeyer> Remjey: I'd suggest some literate code, maybe ocaml-burg? it's complicated but that's the one example I know that does in lterate way
<adrien> I can only agree: I gave up doing some changes I wanted to do...
<wmeyer> :-)
Nahra has quit [Remote host closed the connection]
Nahra has joined #ocaml
ollehar has quit [Ping timeout: 246 seconds]
tootooroo has quit [Quit: Brain.sys has encountered a problem and needs to close. We are sorry for the inconvenience.]
tane has joined #ocaml
ttamttam has left #ocaml []
<wmeyer> Remjey: you can also always look at some libraries, my advise would be: cmdliner
<wmeyer> or you can have a look at ocaml source code itself
<wmeyer> ocamlgraph if you want some advanced usage of functors
tootooroo has joined #ocaml
ontologiae has joined #ocaml
frogfoodeater has joined #ocaml
mathieui has quit [Ping timeout: 252 seconds]
mathieui has joined #ocaml
frogfoodeater has quit [Ping timeout: 256 seconds]
frogfoodeater has joined #ocaml
tootooroo has quit [Ping timeout: 248 seconds]
ggole has joined #ocaml
contempt has quit [Ping timeout: 255 seconds]
tootooroo has joined #ocaml
contempt has joined #ocaml
tootooroo has quit [Client Quit]
anderse has quit [Read error: Connection reset by peer]
anderse has joined #ocaml
anderse has quit [Client Quit]
ulfdoz has joined #ocaml
gustav_ has joined #ocaml
q66 has joined #ocaml
ousado has quit [Ping timeout: 255 seconds]
Yoric has quit [Ping timeout: 246 seconds]
ousado has joined #ocaml
<ousado> anyone seen this? /tmp/camlasm712ade.s: Error: .size expression for camlSwf__to_float16_1011 does not evaluate to a constant
<ousado> ocaml 3.11.2-1, OS Ubuntu 10.04 LTS
<ousado> when building the haxe compiler
<ousado> x86_64 architecture
ttamttam has joined #ocaml
yacks has quit [Read error: Connection reset by peer]
smerz has joined #ocaml
<Remjey> wmeyer: thanks
frogfoodeater has quit [Ping timeout: 246 seconds]
<Remjey> it's funny how modules can do lots of things classes do
anderse has joined #ocaml
Anarchos has joined #ocaml
emmanuelux has joined #ocaml
frogfoodeater has joined #ocaml
yacks has joined #ocaml
<wmeyer> Remjey: they are strictly more powerful. However classes can do different things, that modules can't without some boilerplate
<wmeyer> ousado: I think I saw it
mort___ has joined #ocaml
<ousado> ah, when searching for "size expression does not evaluate to a constant ocaml" I get a few hits
<ousado> wow, anyone using Marionnet?
<wmeyer> never heard about Marionnet to be honest
<ousado> I've been looking for such a thing for long, and found some but written in languages I didn't like
<ousado> haha :)
<ousado> always good to search for bugs for other people
<wmeyer> Fan time
anderse has quit [Quit: anderse]
<ousado> wmeyer: \o/
ollehar has joined #ocaml
yacks has quit [Read error: Connection reset by peer]
mort___ has quit [Quit: Leaving.]
ontologiae has quit [Ping timeout: 245 seconds]
frogfoodeater has quit [Ping timeout: 245 seconds]
yacks has joined #ocaml
ontologiae has joined #ocaml
ontologiae has quit [Ping timeout: 245 seconds]
tane has quit [Quit: Verlassend]
ollehar has quit [Ping timeout: 255 seconds]
anderse has joined #ocaml
ollehar has joined #ocaml
smerz has quit [Read error: Operation timed out]
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
zpe has joined #ocaml
tane has joined #ocaml
zpe has quit [Remote host closed the connection]
Neros_ has joined #ocaml
Pantoufle has quit [Ping timeout: 255 seconds]
ulfdoz has quit [Quit: kernel-upgrade]
ulfdoz has joined #ocaml
Cyanure has joined #ocaml
<companion_cube> https://github.com/mjambon/memories hey, amusing
Yoric has joined #ocaml
<wmeyer> it's so cold here, and the heater behaves undetermistically. I have mastered OCaml but haven't found yet how to make use these *two* knobs to get heating straigth away.
<wmeyer> and worse there is no manual for these two knobs
<wmeyer> (even if I was today in a mood of reading manuals at all)
<companion_cube> write an infinite loop, and use it to heat with your CPU
<wmeyer> lol
<wmeyer> thank you, I have intel so it should work without hitch
<wmeyer> if that was ARM situation wouldn't be so simple
<companion_cube> :D
<wmeyer> companion_cube: I see people are busy today, extremely busy
<wmeyer> last comment was ousado 2 hours ago
<wmeyer> today i can't even focus on anything in particular
<pippijn> I always feel hostile when someone says they "mastered" something
<wmeyer> ok i have not, but no longer begginer :-)
<wmeyer> sorry, i should not say that
<wmeyer> but feel natural, that's what i meant
<pippijn> yeah
<wmeyer> so the problem with "mastered" is that implies the best skills ever which is subjective
tane has quit [Quit: Verlassend]
<wmeyer> nobody is able to say about her/him/self that have done it, otherwise it's a nice compliment from somebody elese
<pippijn> right
<wmeyer> i am a bit brain dead today :-) maybe the temperature in my flat
* ousado oh noes
<ousado> wmeyer: take a walk, maybe, or a nap. you can't be brain dead today, it's Fan time
ttamttam has left #ocaml []
<wmeyer> ousado: thanks, but have no idea if i want to go outside today actually. However, I am getting better at the moment, it's getting hotter. I have some idea what to do with Fan.
<wmeyer> and i should really shut ERC and just do this :-)
* ousado shuts up
UncleVasya has joined #ocaml
<companion_cube> I'm totally useless today
<wmeyer> feel the same
<wmeyer> maybe it's spring
<companion_cube> or just the weekend
yezariaely has quit [Excess Flood]
yezariaely has joined #ocaml
yezariaely has quit [Max SendQ exceeded]
yezariaely has joined #ocaml
yezariaely has quit [Max SendQ exceeded]
yezariaely has joined #ocaml
zpe has joined #ocaml
yezariaely has quit [Max SendQ exceeded]
yezariaely has joined #ocaml
yezariaely has quit [Excess Flood]
<bernardofpc> companion> write an infinite loop, and use it to heat with your CPU -> emerge -e system on a Prescott
yezariaely has joined #ocaml
yezariaely has quit [Max SendQ exceeded]
yezariaely has joined #ocaml
yezariaely has quit [Max SendQ exceeded]
yezariaely has joined #ocaml
yezariaely has quit [Max SendQ exceeded]
<companion_cube> bernardofpc: or libroffice
_yezariaely has joined #ocaml
UncleVasya has quit [Ping timeout: 256 seconds]
zpe has quit [Ping timeout: 276 seconds]
* wmeyer with Andreas Schiff tour
_yezariaely has quit [Excess Flood]
yezariaely has joined #ocaml
yezariaely has quit [Max SendQ exceeded]
yezariaely has joined #ocaml
yezariaely has quit [Max SendQ exceeded]
* wmeyer hesistates to have a cup of coffee after 2 weeks of coffee break
yezariaely has joined #ocaml
yezariaely has quit [Max SendQ exceeded]
yezariaely has joined #ocaml
yezariaely has quit [Max SendQ exceeded]
<bernardofpc> don't do drugs ^^
yezariaely has joined #ocaml
yezariaely has quit [Max SendQ exceeded]
<wmeyer> bernardofpc: I don't, caffeine is socially approved :-)
Yoric has quit [Ping timeout: 256 seconds]
<wmeyer> but i try to stay away from that
Neros__ has joined #ocaml
Neros_ has quit [Ping timeout: 258 seconds]
<Tekk_> orbitz: how would the package manager help in this case?
<wmeyer> Tekk_: [#require "package"];; will set it up for you
<Tekk_> wmeyer: oh, I thought he meant that I wouldn't have to worry about it if I installed through ocamlfind
<wmeyer> otherwise [#directory "directory";;] will also do, and you have to #load *.cm[oa] file and have possibly cmi file on path
<Tekk_> wmeyer: and that's all still interactive? that's the bit I'm most interested in. ocamlfind doesn't seem to have a command to drop me into a repl
<Tekk_> (bit of a python/lisp workflow of just trying things out interactively, then actually coding it)
<wmeyer> Tekk_: yes, it will be interactive
<wmeyer> you can use ocamlmktop tool too
<Tekk_> hmm
<Tekk_> wmeyer: with what option to ocamlfind? I'm not seeing anything that fits in the man page
<wmeyer> ocamlmktop takes the usual compiler options and produced a toplevel
<wmeyer> that you can execute, and evaluate your expressions
<wmeyer> looking at the best options for you, I'd suggest strongly uTop
<wmeyer> as a toplevel, it has a lot of nice enhacements and user interface is quite nice, does work pretty well with Emacs and console, and (I think) have some interface with VIM
<Tekk_> ocamlmktop is an interesting way to do it
<wmeyer> maybe because in Lisp community it's common to dump image and load it later, I suppose
<wmeyer> and it a bit reflects that work flow
<Tekk_> mhm
<wmeyer> however I don't use it very often
<Tekk_> still not working :/ ocamlmktop -I /usr/lib/ocaml/netclient still says that Http_client isn't found
<orbitz> Tekk_: I'm confsued about what you want
<orbitz> you want to be in a REPL where yo ucan use your lib
<orbitz> but wmeyer gave you repl commands to open your lib
<orbitz> and you say that isn't what you want
<Tekk_> oh, okay
<Tekk_> orbitz: I want what you thought I wanted
<orbitz> Tekk_: if the package is setup as something that works with ocamlfind
<orbitz> then in ocaml you can do #use "topfind";; #require "yourlib";;
<orbitz> now you can use it
<Tekk_> oh, okay. thanks
<Tekk_> I was a bit confused as to what you meant by "use ocamlfind"
<orbitz> topfind is part of ocamlfind
<wmeyer> ocamlfind is our library manager, it's widely used to manage the structure of file system and feed the options to the compiler. However then the library you use need to be packaged with ocamlfind, some of them are not, then instead you have to supply each option by yourself
<wmeyer> is that clearer picture?
<wmeyer> :-)
<wmeyer> it does not preclude of using toplevel however
<Tekk_> yeah. it's more like a hybrid of pkgconfig and a package mananger than just a package manager :)
<wmeyer> but it's awkward to setup this options unfortunately
<wmeyer> it's more like pkgconfig
<wmeyer> on top of that you have OPAM too, where you can manage also other parameters
<Tekk_> that's weird..
<wmeyer> like compiler used or version of the package
<Tekk_> #use "toplevel";; #require "netclient";; open Http_client;; http_get;; <- http_get not found
<wmeyer> it's not, it works, it's layered abstraction
<Tekk_> all the other commands seem to be fine though
<wmeyer> maybe it's deprecated value
<Tekk_> maybe
<wmeyer> the problem is that, if you use ocamlfind you will not learn ever at some point compiler options ;-)
<Tekk_> wmeyer: nope, include Http_client;; shows a http_Get in there
yezariaely has joined #ocaml
<Tekk_> http_get*
<orbitz> Tekk_: what about Http_client.http_get;;?
<Tekk_> same unbound value
<orbitz> so it's not in Http_client then :)
<wmeyer> while I agree that toplevel would be better with some additional directives, I think I am quite happy what is now
<orbitz> Tekk_: http_Get or http_get?
<Tekk_> oh
<Tekk_> hold on
<Tekk_> it's under the convenience submodule :)
<wmeyer> Tekk_: OCaml is quite strict about how you write identifiers
<orbitz> Tekk_: http_get is not in the docs i just found
<wmeyer> and that's the biggest chalenge at the begining
<orbitz> there is val get
<Tekk_> it's in there
<orbitz> yep, submodule
<orbitz> Hrm, writing a wrothy followup to mfp's ocamlmq could be fun
<orbitz> a decent amount of tiem and money thouhg
<wmeyer> Tekk_: so I think we don't have much command in terms of introspection of the exisiting entities.
tane has joined #ocaml
<orbitz> So far the state of ocaml repl hasn't been a problem for me, minus that i have to do rlwrap
<wmeyer> some systems have toplevel directives like: "print" or "check", where you can see exactly what's being defined and how is defined
<orbitz> but, i've never tasted the sweet delight of a goodrepl, so maybe i'd hate it
<wmeyer> we don't have it
<wmeyer> at the moment
<Tekk_> orbitz: either common lisp or scheme with slime :)
<orbitz> I tend to be minimilastic for these thigns though. I like to be able to jump to a machine I didn't setup and not have to reload things
<wmeyer> Tekk_: #check Http_client;; should be able to show you the module signature, perhaps even with docs
<wmeyer> or open a browser with a doc
<wmeyer> #print Http_client.http_get should show you (if available) a listing of the function
ollehar has quit [Ping timeout: 240 seconds]
<wmeyer> remember OPAM is a source based manager, so in principle we should be doing these things
<orbitz> opam supporting build artifacts would be a great addition
<wmeyer> exactly, I don't know why OPAM & ocamlfind threats the sourcecode as a surrogate
<wmeyer> it should install the code with everything
<wmeyer> s/surrogate/component that should be thrown away/
<orbitz> wmeyer: i'm under the impression opam doesn't know much about what it's installing, since it's just runningcommands
<orbitz> (infact i wonder how easy it would be to refactor opam for other languages)
<wmeyer> so ocamlfind and oasis should install these
<wmeyer> and now we get to the moment where I started thinking about guess what orbitz, of course namespaces
<orbitz> wmeyer: ocamlfind installs what you tell it to, no more, so packages should do it
<wmeyer> however the source code not nesercailly is flat
<orbitz> wmeyer: (AFAIK)
<wmeyer> and packs spoil the joy
groovy2shoes has joined #ocaml
RagingDave has joined #ocaml
<orbitz> anyone have time for an API design question?
ttamttam has joined #ocaml
tootooroo has joined #ocaml
malc_ has joined #ocaml
darkf has quit [Quit: Leaving]
ggole has quit []
Cyanure has quit [Read error: Operation timed out]
ttamttam1 has joined #ocaml
tootooroo has quit [Quit: b(not so)rb]
ttamttam1 has quit [Quit: ttamttam1]
tootooroo has joined #ocaml
<wmeyer> orbitz: go on
<orbitz> wmeyer: figured it out on my own :)
<wmeyer> good :-)
mattrepl has joined #ocaml
mattrepl has quit [Read error: Operation timed out]
mattrepl has joined #ocaml
tootooroo has quit [Quit: Brain.sys has encountered a problem and needs to close. We are sorry for the inconvenience.]
<orbitz> is | Some foo -> Some foo optimized away in Ocaml?
<orbitz> or do I haveto use 'as'
<thizanne> you can replace your "function" by "match ... with"
<thizanne> and tada you have a name
<orbitz> thizanne: is that directed at me?
iZsh has quit [Quit: Coyote finally caught me]
<thizanne> orbitz: yes
<thizanne> "match x with | Some _ -> x" is same (well, I believe, and it seems rather logical) as "function | Some _ as x -> x"
<orbitz> no, my question isn't that, it's about if the reconsturtio nis actually optimized out
Yoric has joined #ocaml
iZsh has joined #ocaml
<malc_> # let x = Some 1 in let y = match x with Some y -> Some y in x == y;;
<malc_> Warning 8: this pattern-matching is not exhaustive.
<malc_> Here is an example of a value that is not matched:
<malc_> None
<malc_> - : bool = false
<malc_> iow - no
<wmeyer> orbitz: I don't believe so, it looks can be done but it's not worth
<wmeyer> malc_: when you are here, I use llpp and seems like I don't like the layout of the page when using vertical aligment of the monitor
<orbitz> malc_: that doesn't tell you if ocamlopt does something
<wmeyer> I need to press several times z to position that in a right way
tootooroo has joined #ocaml
<wmeyer> orbitz: ocamlc -dlambda would do
<wmeyer> is there any fix for that malc_
<wmeyer> ?
<malc_> wmeyer: z changes the physical window dimensions (i.e. reshapes it)
<malc_> wmeyer: i don't see how it helps with anything
<malc_> or simply am to obtuse and don't understand what is the problem
<wmeyer> ok, so how can i use llpp with vertically positioned display?
<malc_> orbitz: so compile it with ocamlopt and get the same result?
<wmeyer> well, the pages are not optimally placed, when I scroll them with page down, they next page will be moved a bit up
<orbitz> malc_: I'll test in a bit, thank you for the code snippet
<malc_> wmeyer: what's an verically positioned display? rotated wide screen one?
<wmeyer> yes
<malc_> wmeyer: you want to have one page visible on the screen at a time?
<wmeyer> try it yourself, if you give me a way of using llpp and having a nice page placed in the centre I'd be happy
<wmeyer> exactly
<wmeyer> evince does it
<malc_> press 'p' press 'ctrl-3'
<wmeyer> not working
<wmeyer> nothing happens
<malc_> get git version of llpp? :)
eikke has joined #ocaml
tootooroo has quit [Quit: Brain.sys has encountered a problem and needs to close. We are sorry for the inconvenience.]
<wmeyer> that answers my question malc_ and thanks for llpp!
<malc_> da rien
<wmeyer> (not sure if it will work still but it looks promising as C-3 was not on menu)
groovy2shoes has quit [Quit: Computer has gone to sleep]
groovy2shoes has joined #ocaml
<wmeyer> ok works
<wmeyer> there is a bug however
<wmeyer> if I use this mode
<wmeyer> backspace is not working for the previous page
<malc_> backspace never worked for previous page.. delete is the key
groovy2shoes has quit [Quit: Computer has gone to sleep]
eikke has quit [Ping timeout: 256 seconds]
<wmeyer> it works except the page is positioned on the top of my display
<wmeyer> but i want this to have to margins in the bottom and top
<malc_> press ctrl-- a couple of times
ttamttam1 has joined #ocaml
<malc_> what you did is this 'p' - turns on "presentation" mode i.e. one page per screen, ctrl-3, fit page model
<Remjey> just curious, is there some nice ide to work with ocaml projects ?
tootooroo has joined #ocaml
tootooroo is now known as Guest31898
ttamttam1 has quit [Client Quit]
ttamttam has quit [Quit: ttamttam]
<wmeyer> ok it was 'P' not 'p' i tried
Guest31898 has quit [Ping timeout: 246 seconds]
<malc_> wmeyer: erm.. and you were correct 'P' is the right key
<malc_> wmeyer: if you want to navigate to the next page/previous page while keeping things centered you either use space/delete or up/down arrow, not page up/down
<wmeyer> I figured that out
<wmeyer> there is help, i tried to use with the previous version of llpp, but the search wasn't working on the help page
<wmeyer> so it wasn't not immediataly useful
<malc_> wmeyer: it does work
<malc_> in a bizzare way but it does work indeed
<wmeyer> I think it's a useful feature
<wmeyer> often i want to find something on a help page like 'crop'
<wmeyer> so I pressed / and then typed 'crop' and nothing
<wmeyer> but now it actually works
<malc_> wmeyer: just type crop without /
<malc_> ctrl-s/r to search forward/backwards after that
<wmeyer> ok that seems to operate correctly
emmanuelux has quit [Read error: Connection reset by peer]
<wmeyer> i almost dropped llpp, after i changed my screen to vertical position, but the new git version is way better
walter has joined #ocaml
<malc_> good to hear that
Kakadu has quit [Ping timeout: 258 seconds]
mattrepl has quit [Quit: mattrepl]
Kakadu has joined #ocaml
mattrepl has joined #ocaml
walter has quit [Quit: This computer has gone to sleep]
smondet has joined #ocaml
answer_42 has joined #ocaml
anderse has quit [Ping timeout: 276 seconds]
smondet has quit [Ping timeout: 246 seconds]
groovy2shoes has joined #ocaml
tootooroo has joined #ocaml
<wmeyer> Remjey: Emacs with tuareg and optionaly caml-type or caml-spot, Emacs with typerex, Emacs with caml-mode, VIM with some mode (Markus Mottl has done excellent support for VIM AFAIK), Eclipse with OCaide or ODT (haven't tried), Camelia (abandonded), Cameleon (interesting and active).
<wmeyer> I use tuareg
<wmeyer> bare tuareg
<wmeyer> and don't forget about toplevel, the best one is uTop, works in console or Emacs
<bernardofpc> why are there many toplevels ?
<orbitz> there aren't that many
<orbitz> afaik only ocaml and utop
<bernardofpc> oh
<bernardofpc> and utop is more "moving" while ocaml is more stable ?
cdidd has quit [Read error: Operation timed out]
<wmeyer> bernardofpc: yes
derek_c has joined #ocaml
<wmeyer> bernardofpc: to be precise ocaml toplevel is just enough to run testing scripts
derek_c has quit [Client Quit]
derek_c has joined #ocaml
malc_ has quit [Quit: leaving]
derek_c has quit [Quit: Lost terminal]
derek_c has joined #ocaml
<ousado> wmeyer: sorry for pestering, but how's Fan?
<wmeyer> so I try to implement theorem prover in Fan, but haven't finished the rudimentary support for that. Maybe I will start with a parser at first.
<wmeyer> Means a simple one :-) but not prolog.
<wmeyer> another idea to put into demos directory maybe less ambitious, is to write a LOGO interpreter
<wmeyer> orbitz: try uTop :-)
<wmeyer> it's a great tool
<wmeyer> do you use Emacs or VIM?
<ousado> wmeyer: you're very inspired by Coq it seems :)
<wmeyer> don't say it, please no coq in the mean time
<wmeyer> i got it over my head for too long
<wmeyer> and eventually i discovered that i want just to write some ML code, to help myself not forget about OCaml
<wmeyer> ousado: LOGO isn't anything like this at all
<wmeyer> it's a language to teach children programming
<ousado> yes, I know - but I was referring to the theorem prover
<Guest38321> http://caml.inria.fr/pub/docs/manual-ocaml-4.00/manual033.html can someone explain to me why the complete example in 19.6 does not use CAMLprim?
mattrepl has quit [Quit: mattrepl]
Guest38321 is now known as Leonidas
Leonidas has quit [Changing host]
Leonidas has joined #ocaml
<wmeyer> Leonidas: CAMLprim?
<wmeyer> hi btw :-)
<Leonidas> wmeyer: hi
<Leonidas> 19.1.2 says user primitives are created with CAMLprim value …
<Leonidas> but the example in 19.6 does not use CAMLprim at all
<wmeyer> I don't think it's needed.
<wmeyer> or maybe, for bytecode compiler?
<Leonidas> also, I think there's another documentation error in the example, because the examples use external … = "curses_…" but the functions in the C file are "caml_curses_…"
<Leonidas> I haven't tried compiling it, though.
<wmeyer> no, there might be bugs, and I don't like it
<wmeyer> but it's because I don't think the examples get compiled
<Leonidas> I'll try that later, but at the moment I'm fighting with the gc :-(
ocp has joined #ocaml
<Leonidas> ok, another question: when do I need CAMLlocal?
tianon has joined #ocaml
<Leonidas> am I right in assuming that I only need CAMLlocal if I want to have a local variable of type 'value'?
<wmeyer> Leonidas: always for values, and always first in the function, before any other
<wmeyer> variables
<wmeyer> and always use CAMLreturn and CAMLparam
<wmeyer> for values
<Leonidas> I'm learning about CAMLreturn the hard way now
<Leonidas> since if you use regular return and leave out CAMLparam it looks like things are fine
<Leonidas> untill the GC kicks in
<wmeyer> use pastebin :-)
<Leonidas> wmeyer: what about functions I use internally without exposing them to OCaml code?
<wmeyer> one rule: if you don't allocate memory in them it's fine
<wmeyer> if you do any runtime interaction, then you have to tell the gc about stack
<wmeyer> the basic interaction is allocation, that may trigger collections or compatification
<wmeyer> of course use these macros only for the Caml values
<wmeyer> otherwise of course surely some bad things happen
Snark has quit [Quit: leaving]
<Leonidas> wmeyer: oh, that explains why sometimes functions just work. so it is only when I allocate stuff.
<Leonidas> I think if I just use CAMLreturn everywhere I return a 'value' type, I should be on the safe side
<wmeyer> yes Leonidas, it only happens when GC kicks in, and that's on entry points to gc
<wmeyer> sure use macros you are safe
<wmeyer> another rule
<wmeyer> don't do any allocations using small_alloc when you prior allocated a block and didn't finish updating it
<Leonidas> now that you mention it, it makes sense and is quite obvious.
nimred has joined #ocaml
nimred has quit [Changing host]
nimred has joined #ocaml
<Leonidas> I only do caml_copy_string and caml_alloc_custom
<wmeyer> the best is to allocate all the stuff assign to values and then put into your data structure
<wmeyer> so you are then safe just by using macros
mattrepl has joined #ocaml
<Leonidas> wmeyer: thanks :-)
<wmeyer> Leonidas: you are welcome :-)
<Leonidas> wmeyer: expect maybe another bug report later about the example code, I'll try compiling it.
<wmeyer> it will be fixed immediately
<wmeyer> (almost)
<Leonidas> :D
<Leonidas> one can always depend on wmeyer :-)
<wmeyer> but maybe tomorrow :-)
<wmeyer> sure, the documentation bugs are important
<wmeyer> especially small typos, are easy to fix, and help people
<Leonidas> maybe later I can write some additions to explain CAMLprim, CAMLlocal etc. so people won't need to repeat my mistakes
<wmeyer> write a blog post :-)
<wmeyer> we have a manual
<orbitz> speaking of blog posts, anyone see the post on Hydra (not ocaml related). So jealous.
<wmeyer> and sorry that I am proposing it, but yes we have a decent manual at the moment
<Leonidas> or that, yeah. Should probably ask someone to proofread it.
<Leonidas> wmeyer: well, the C part is kinda confusing :-/
<wmeyer> maybe telling what I told you would just be enough ;-)
<Leonidas> yes, maybe.
<wmeyer> people that designed runtime are real experts on that matter, and they don't realise obvious topics
<wmeyer> looks good, thanks
<wmeyer> actually 10 bullet points of what to and what not to do would be great
<wmeyer> and below, the rough explanation why is that
<Leonidas> yup, good idea.
<wmeyer> providing some sample template of function, with HTML arrows and annotations explaining
<wmeyer> well, this bit is for this, and when that happens it does that
<wmeyer> I've never seen that before
<wmeyer> and it would be useful
* wmeyer will order a pizza now.
yacks has quit [Quit: Leaving]
<wmeyer> actually what would be good, is to code a special DSL for interactive blogs
<wmeyer> that would be executed in a browser
<Leonidas> wmeyer: bin appetit!
<wmeyer> you know it's silly, we lived for so many years we syntax highlighed snippets
<wmeyer> Leonidas: thank you very much.
<wmeyer> maybe this is a good Fan project
<Leonidas> talking about food got reminded me that I am hungry as well. gotta get some food :)
<Leonidas> wmeyer: well, there are a number of solutions to run code in a browser. golang.org is maybe one of the more prominent examples.
<wmeyer> Leonidas: Enjoy, but don't overdo this german drink :-)
<Leonidas> heh, thanks :)
<wmeyer> ousado: Fan looks very good
<wmeyer> I highly appreciate Hongbo's work on this
answer_42 has quit [Read error: Operation timed out]
<ousado> wmeyer: the more I read about it, the more I do too
<ousado> there won't be no way around looking at the sources to learn how to use it, for now, but then I'm sure that's not a bad thing
cthuluh has quit [Ping timeout: 258 seconds]
cthuluh has joined #ocaml
<wmeyer> as usually the sources are dense
<wmeyer> Camlp4 in general is dense
q66 has quit [Ping timeout: 256 seconds]
<ousado> wmeyer: it's Fan already, isn't it?
q66 has joined #ocaml
<wmeyer> ousado: yes, I just look at the code really.
Kakadu has quit []
osa1_ has joined #ocaml
derek_c has quit [Ping timeout: 245 seconds]
ocp has quit [Quit: Leaving.]
ocp has joined #ocaml
<osa1_> hmm, am I missing something or do we really not have a regex library in both stdlibs and batteries ?
<osa1_> ah, I was looking for a regexp module
<osa1_> thanks
Tekk_ has left #ocaml []
<orbitz> ocaml-re is good too
<wmeyer> orbitz: yeah
<orbitz> Str has kind of a crappy interfaec if you write concurrent code
<osa1_> I wish we have typerex for vim too :o
<wmeyer> pippijn wrote re2ml some time ago
<osa1_> anyone here using typerex ?
<wmeyer> it was faster than anything else
<wmeyer> but not sure if he is planning to release it
<wmeyer> osa1_: I tried
<wmeyer> and succeeded
<wmeyer> but there many quirks
<osa1_> wmeyer: what are you using now ?
ocp has quit [Quit: Leaving.]
<wmeyer> Str if I need to, but in general ocamllex
<wmeyer> osa1_: oh
<osa1_> :)
<wmeyer> tuareg
<wmeyer> and caml-types
<osa1_> wmeyer: is there a "plug and play" .emacs.d distribution for ocaml editing ? I don't really know emacs but I want to try a good OCaml IDE (I'm writing OCaml with vim full-time for 3,5 month now)
<wmeyer> add marmalade to your repo list in Emacs
<wmeyer> then M-x list-packages
<wmeyer> should give you the list includint tuareg
<wmeyer> or just add it manually
<wmeyer> (the marmalade seems to be just sligthly outdated)
ocp has joined #ocaml
<wmeyer> ousado: try testr/ in Fan
ousado has quit [Ping timeout: 256 seconds]
ousado has joined #ocaml
<ousado> wmeyer: testr/ ?
<ousado> ah the directory
RWan has joined #ocaml
RWan has left #ocaml []
<ousado> wmeyer: do you have any example in mind in particular?
<wmeyer> I tried macro.ml but it looks like a bit outdated
<wmeyer> the parser looks Ok
<ousado> I tried all of loc/*
Wan has joined #ocaml
<ousado> I might be missing something, but fan complains about all of them
<wmeyer> I don't try to compile
<wmeyer> just looking at the code
mattrepl has quit [Quit: mattrepl]
tootooroo has quit [Ping timeout: 256 seconds]
<ousado> wmeyer: meta.ml hasn't been written in a good mood :)
Wan is now known as RWan
<RWan> Hi
<RWan> I have a problem with the graphics library, it seems it doesn't want to load.
RagingDave has quit [Quit: Ex-Chat]
<RWan> When I type open Graphics;; it returns nothing, but when I want to use it, it says "Reference to undefined global 'Graphics'
<bernardofpc> Graphics.x should be available under the name x
ocp has quit [Quit: Leaving.]
<RWan> Does it means I have to type open graphics.mli?
<RWan> The problem is tha I have multimple graphics.(something) in my lib folder (useing Windows 7)
HaikuUser has joined #ocaml
HaikuUser has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
<Cypi> If the file graphics.mli is visible, and it declares a name x, then you can use Graphics.x anywhere in your program
<Cypi> Typing "open Graphics" just allows you to use 'x' directly, and not 'Graphics.x', as bernard*fpc said
osa1_ has quit [Ping timeout: 252 seconds]
<RWan> Sorry, I don't understand what you're trying to tell me
<RWan> Maybe the root of the problem is that I can't see graphics.mli
<wmeyer> ousado: yeah ;-)
<Cypi> When you type "open Graphics;;", it should complain if it didn't work (I get "Error: Unbound module Graphics"). So it works
<Cypi> Now, what it does : each time you would have typed "Graphics.x" or "Graphics.y", you can now just type "x" or "y" and it will be the same.
<Cypi> (except if you redefine later x or y, of course)
ollehar has joined #ocaml
<RWan> Ok, I think I got it
<RWan> Well, seems it doesn't want...
<RWan> I got the code from the ocaml tutorial
<Cypi> Ok, I think I see the problem
<Cypi> If you want to execute this in the toplevel
<Cypi> you have to type each statement (ending with ";;") seperataly
<Cypi> maybe
<bernardofpc> I have his same errors
<bernardofpc> the open seems to work
<Cypi> I can't properly test, don't have "Graphics" here :/
<bernardofpc> I do have graphics.mli installed in my machine
<bernardofpc> but it complains about global variable Graphics in his same way
<RWan> Cypi: still doesn't works o_o
<Cypi> bernardofpc : how did you execute this code?
<bernardofpc> in the toplevel
<bernardofpc> open Graphics ;;
<RWan> I type open Graphics;; then open_graph "640x480";; Error: Reference to undefined global `Graphics'
<bernardofpc> RWan: same here
<bernardofpc> I sort of dislike automatic module guessing
<Cypi> (that's kind of strange, it should just say "Error: unbound module Graphics" if the module wasn't opened
<Cypi> )
Yoric has quit [Ping timeout: 246 seconds]
<bernardofpc> Error: Unbound module InvalidModuleInMyComputer -> right so Cypi
<bernardofpc> probably some bug in Graphics
<Cypi> bernardofpc : I guess you aren't on Windows?
<bernardofpc> no I aren't
<Cypi> Ok
<bernardofpc> open format ;; open_box 42 ;;
<bernardofpc> -> this works for me
<bernardofpc> Unix.environment () ;;
<bernardofpc> Error: Reference to undefined global `Unix'
tane has quit [Quit: Verlassend]
<bernardofpc> RWan: we were missing #load "graphics.cma" ;;
<bernardofpc> you have to type the # before the #load
<Cypi> Yes, I just read that (the error is actually documented)
<bernardofpc> Exception: Graphics.Graphic_failure "Cannot open display 640x480".
<bernardofpc> blih
<bernardofpc> oh, with "" it works
<bernardofpc> oh, psychadelic
<RWan> Yay, it works!
<RWan> Where can I signal the error in the tutorial?
<Cypi> There is a github link at the bottom of the website, so I guess you can post an issue on github
<bernardofpc> is there *any* reason that the toplevel does not issue a #load for a module that is opened but not already "compiled-in" ?
mattrepl has joined #ocaml
ulfdoz has quit [Ping timeout: 258 seconds]
<RWan> bernardofpc: where did you find the fix?
<Cypi> bernardofpc: I don't really know, but you could also ask why a C compiler doesn't compile the .c when you include the .h
<Cypi> (I know it's not really relevant, since it's a toplevel :/ )
<bernardofpc> Cypi: there's a HUGE difference in toplevel vs compiler
<Cypi> ^
<bernardofpc> (I particularly have the google-fu for olden messages... have undig something of 2005 about LaTeX just before)
<RWan> Issue submitted
<bernardofpc> and in both cases I find it very intriguing that people defending "how it's done" are unable to understand why people had their problem in the first place
<bernardofpc> (nobody that's a begginer would think that open "just opens" and does not allow you to use whatever you just wanted to use...)
tootooroo has joined #ocaml
<Cypi> Maybe the explanation is that "open" isn't a toplevel directive, whereas "#load" is.
<bernardofpc> I couldn't care less... the toplevel should be able to modify in sensible ways the meaning of compiler directives
<bernardofpc> it already does that with let a = 5 ;;
<bernardofpc> (hum, lemme test)
<bernardofpc> oh, interesting... let a = 5;; is valid in a .ml file
<Cypi> Hmm, yes it is
<bernardofpc> why does everybody use let .. in ?
<ousado> if anything the toplevel does more than the compiler, but it certainly compiles
<ousado> that's not such a HUGE difference
<bernardofpc> ousado: do you know something that toplevel does more than just compiling ?
<thizanne> bernardofpc: you probably use things like "let a = 5" in almost every .ml file you write
<Cypi> bernardofpc : it just limits the visibility of local variables
<Cypi> "let a = 5" is no different than "let f a b = a + b"
<bernardofpc> Hum, syntax as ever...
<bernardofpc> I did not understand that let a = 5 \n\n is the same thing as let a = 5 ;;
<Cypi> " ;; " is just for the toplevel
<bernardofpc> but the toplevel cannot know that, so you have to give it
<Cypi> (and for Caml, but we're talking about OCaml, right? ^^ )
<bernardofpc> In some sense, I still find it very strange that statements don't have an explicity boundary
<RWan> Is the indentation important in Ocaml?
<bernardofpc> RWan: no, thanks goodness
<bernardofpc> it is probably important for readability, and most editors will help you
<bernardofpc> but the compiler gracefully ignores them
<ousado> there's an alternative syntax if you want the whitespace thing
<Cypi> bernardofpc : the boundary isn't "\n" actually
<Cypi> it's the "let" keyword
<Cypi> You can write "let a = 4 let b = 5" in a .ml file
<bernardofpc> of the *next* stataement
<bernardofpc> I know
<bernardofpc> (or sort of discovered that again today...)
<bernardofpc> but this looks like some evil-master-mind plan to make a minimalistic syntax
<RWan> Thanks! (thought I got an error because of indent, but I started a function with int instead of let, C habits...)
<bernardofpc> RWan: ;-)
tootooroo has quit [Ping timeout: 276 seconds]
<bernardofpc> (thinking out loud: lisp has () for delimiting statements, C has ; for terminating them, maple has ; and : according to the verbosity level
<Cypi> "let" isn't so minimalistic, so.
<bernardofpc> want to talk about if ?
<bernardofpc> I think it was cc that never knew how it worked
<bernardofpc> and I have another example from my own sufferings
<Cypi> Whad do you mean? (about "if"?)
<bernardofpc> I think he never knew where were its boundaries
mattrepl has quit [Quit: mattrepl]
<bernardofpc> I mean, of course he knows where an if starts
<bernardofpc> the problem is figuring out where the conditionnal ends, etc, etc
<Cypi> (Oh, by "cc", you mean comp*nion_cube actually? ^^ )
<bernardofpc> in a non-hl fashin
<bernardofpc> anyway
<bernardofpc> simple syntax question
<thizanne> actually the if in OCaml works quite exactly as the if in C
<thizanne> except you replace { } by begin end or ( )
<bernardofpc> i have let f = function [] -> 42 | [x] -> function a -> a * x | x::s -> ...
<bernardofpc> the second | is for which function ?
<thizanne> I think it's for f
<bernardofpc> (or even better: could I write a nested matching ?
<ousado> thizanne: expr vs statement is an important distinction
<thizanne> since you have to put begin ... end to write nested mtch
<Cypi> thizanne : and what about "if false then v1 else v2 ; v3", too? :-°
<thizanne> ousado: yes, I talked about the boundaries
<RWan> let foo bar in tells "Replace all occurences of foo by bar", am I right?
<thizanne> Cypi: I guess it's exactly the same in C
<thizanne> it will become v2; v3
<Cypi> Indeed, but I don't think it's so obvious in OCaml, because of the meaning of ";"
<thizanne> it's obvious once you know it, I believe
<bernardofpc> thizanne: in fact, I think I have to put begin..end even to write -> function ...
<Cypi> bernardofpc : the second | is for the internal matching
<thizanne> let f = function [] -> 42 | [x] -> begin function a -> a * x | x :: xs -> ... end
<Cypi> indeed
<Cypi> (or just parenthesis)
<Cypi> But you can't write that anyway, "function ..." isn't an integer like 42 :-°
<bernardofpc> yep
<bernardofpc> but the idea was to have many functions on the RHS
<bernardofpc> (different functions)
<bernardofpc> at the end, I decided to give them names and put outside of f
<Cypi> You could match the couple instead of one value, then the other (but I don't know at all the cost of this in term of performances)
<bernardofpc> good question
<bernardofpc> but I'm not anymore that much into asm-performance of OCaml
<Cypi> :p
<bernardofpc> I'll do what everybody does: wait for an optimizing inliner and assembler
<Leonidas> thizanne: as I see you here, do you have any idea why so many ocaml-* packages got orphaned on AUR?
<ousado> bernardofpc: is there something that makes you think ocaml doesn't produce optimized code?
<bernardofpc> some asm I read in the past that shifts back and forth ints from OCaml to machine and vice-versa inside a function
<bernardofpc> not having gcd + remainder in one single operation
<bernardofpc> not being able to detect tail-recursion and compile it that way
<bernardofpc> in particular, tree-tail-recursion with more than one branch, which is just horrible to write explicitly