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/
<pippijn> scanning the file system doesn't take much time (but it's not O(1)), but building a graph and running the whole logic does take time
<mrvn> I have 1 makefile with a fixed number of pattern rules. So the time stays constant irespective of the number of files it watches.
<pippijn> ok, one question
Simn has quit [Quit: Leaving]
<pippijn> how do you know that file.o needs to be rebuilt when file.ml changed?
<mrvn> if you have a complex dependency structure that grows then you need more time though
<mrvn> pippijn: the inotify rules knows what files *.ml generates
<pippijn> I see
<pippijn> and it knows that when dependency.ml changed, then dependent.ml needs to be recompiled?
<mrvn> not in my simple case.
<pippijn> and also library.cma?
<pippijn> and also everything that depends on library.cma
<mrvn> If you make the inotify smart enough then it does
<pippijn> right
<pippijn> you need to teach inotify about the complete make DAG
<pippijn> at which point you have a new make
<mrvn> at that point you would probably want something that uses the ocamldepends syntax as input
osa1 has quit [Remote host closed the connection]
<pippijn> sure
<pippijn> still, you'd have a make
<pippijn> because that's exactly what make does
osa1 has joined #ocaml
<pippijn> and when you use inotify with that, you have a make with integrated file system monitoring
<pippijn> and tup is that
<pippijn> and omake also has that
<pippijn> gmake could have it, if you integrate it
<pippijn> any make can have it
<mrvn> never said otherwise
<pippijn> your make kind of has it, but in a very limited way
<mrvn> I just said I have it
<pippijn> not really
<mrvn> works for me[tm]
<pippijn> yes :)
<pippijn> that's likely
<pippijn> I have a lot of tools that implement half or less of something and it works for me
<pippijn> ®©™
<mrvn> anyway, using inotify with make is a nice idea but not something I would call a revolutionary new concept
<pippijn> the revolutionary new concept was "inverting the arrows"
<pippijn> so instead of having a dependency of foo.o -> foo.c
<pippijn> you have a "can build" arrow for foo.c -> foo.o
<pippijn> omake has both
<pippijn> my build system (makequick) has the inverted arrow, too
<pippijn> it's useful to have an idea of everything that can be built, because you can do wildcard operations on non-existant but buildable files
osa1 has quit [Remote host closed the connection]
<mrvn> The .c -> .o makes actually more sense I think. In make you have .o being build from 100 different sources and then you have to search and search till you find one that actually exists or is buildable through any number of rules.
osa1 has joined #ocaml
Xom has quit [Quit: ChatZilla 0.9.90.1 [Firefox 22.0/20130618035212]]
<pippijn> right
chrisdotcode has quit [Remote host closed the connection]
<pippijn> and producing the complete "buildable" graph is reasonably fast
<pippijn> but anyway, that can be saved in a db
<mrvn> Also the patterns I can think of right now are not "can build" but "does build".
<pippijn> so you only need to do it once
<pippijn> most things that can be built are in fact built
<mrvn> hmm, *.ml files have a "can build". They can .cmo or .cmx depending on what you use.
<pippijn> more interestingly, they can build .cmi
<pippijn> but not if a .mli exists
<mrvn> yeah, that is even more complex
<mrvn> They can build .mli too with -i
<pippijn> the .cmo/.cmx thing is just a parse time conditional
<pippijn> but the mli thing is at runtime
<pippijn> ocamllex produces .ml from .mll, ocamlyacc produces .ml and .mli from .mly
<pippijn> you can't trivially know whether you want to build a .cmi from .ml or from .mli
<mrvn> but those are simple again. it always produces exactly those
<pippijn> my point was the last sentence
<pippijn> it's a runtime thing, you can't decide it at makefile parse time
<pippijn> you need to build the graph to know it
<mrvn> If you have an .mll file then .cmi is build from .ml. With .mly it is produced from .nli
<pippijn> yes
<pippijn> and you know this only after building the graph
<mrvn> I call that parse time
<pippijn> I disagree
<pippijn> but if you like that, fine
<pippijn> then I'll introduce a preprocessing time
<pippijn> which evaluates the if/ifdefs
<pippijn> because that is what decides whether a .cmx or .cmo or both are built
<mrvn> graph building time is probably better
<pippijn> that was the point of my distinction
<pippijn> whether .cmx is built is known before the graph has been built
<mrvn> but you said you would save that in a db so later at runtime you don't have to build it again
<mrvn> lets call that build time
<pippijn> ok, so we have a parse time, a graph building time, and a build time
<mrvn> and then we all agree
<pippijn> :)
<mrvn> Now tell me how to get oasis / myocamlbuild to output "ocamlc -i" stuff for each .ml file
<mrvn> I hate writing .mli files.
<pippijn> ocamlbuild $(find . -name "*.ml" | sed -e 's/\.ml/.inferred.mli/')
<pippijn> or something :)
<pippijn> you may want to exclude _build
<pippijn> after that, you can copy the .inferred.mli to your source tree and rename them to .mli
avsm has quit [Quit: Leaving.]
<mrvn> Ocamlbuild knows of no rules that apply to a target named gui/src/widget.infered.mly. This can happen if you ask Ocamlbuild to build a target with the wrong extension (e.g. .opt instead of .native) or if the source files live in directories that have not been specified as include directories.
<pippijn> mli, not mly
<mrvn> That is the error from % ocamlbuild gui/src/widget.infered.mli
<pippijn> inferred, not infered
<mrvn> ahh, much better
osa1 has quit [Remote host closed the connection]
<mrvn> thx. that helps a lot.
chrisdotcode has joined #ocaml
wmeyer has quit [Ping timeout: 264 seconds]
chrisdotcode has quit [Remote host closed the connection]
Drup has quit [Quit: Leaving.]
oriba has quit [Quit: oriba]
xuser has joined #ocaml
madroach has quit [Ping timeout: 264 seconds]
madroach has joined #ocaml
darkf has joined #ocaml
dsheets has quit [Read error: Operation timed out]
oriba has joined #ocaml
oriba has quit [Read error: Connection reset by peer]
manud has joined #ocaml
djcoin has quit [Quit: WeeChat 0.4.0]
q66 has quit [Quit: Leaving]
xuser has left #ocaml []
ygrek has joined #ocaml
Xom has joined #ocaml
manud has quit [Ping timeout: 245 seconds]
manud has joined #ocaml
manud has quit [Ping timeout: 256 seconds]
manud has joined #ocaml
Xom has quit [Quit: ChatZilla 0.9.90.1 [Firefox 22.0/20130618035212]]
ygrek has quit [Ping timeout: 245 seconds]
MarcWebe1 has joined #ocaml
yroeht2 has joined #ocaml
gereedy has quit [Ping timeout: 240 seconds]
MarcWeber has quit [Ping timeout: 240 seconds]
yroeht1 has quit [Ping timeout: 240 seconds]
gereedy has joined #ocaml
manud has quit [Ping timeout: 264 seconds]
yacks has quit [Quit: Leaving]
shinnya has quit [Ping timeout: 260 seconds]
gereedy has quit [Ping timeout: 240 seconds]
gereedy has joined #ocaml
ollehar has joined #ocaml
manud has joined #ocaml
ollehar has quit [Ping timeout: 264 seconds]
manud has quit [Ping timeout: 276 seconds]
Kakadu has joined #ocaml
ben_zen has joined #ocaml
wmeyer has joined #ocaml
<wmeyer> hello
<adrien> \o
<wmeyer> o/
ygrek has joined #ocaml
<wmeyer> [ 5 of 19] Compiling Data.Vector.Fusion.Stream.Monadic ( Data/Vector/Fusion/Stream/Monadic.hs, dist/build/Data/Vector/Fusion/Stream/Monadic.o )
<wmeyer> ghc: panic! (the 'impossible' happened)
<wmeyer> (GHC version 7.4.1 for arm-unknown-linux):
<wmeyer> Cant do annotations without GHCi
<wmeyer> {Data/Vector/Fusion/Stream/Monadic.hs:104:19-33}
<wmeyer> i suppose i need ghci, and it's not ported yet on ARM
<wmeyer> ghc panics, impossible happen
<Kakadu> It could be worse (s/ghc/kernel/)
<wmeyer> it can be always worse Kakadu
<wmeyer> I need to thik how to get working agda before the course
<wmeyer> maybe i will just grab a stick with my configuration
<rks`> :-)
<wmeyer> hi rks` 1
<wmeyer> s/1/!/
<rks`> hello
<rks`> (sorry, really bad wifi here)
<wmeyer> :)
<wmeyer> ough nothing better than sunny morning
* wmeyer is thinking about going maybe to caffe
ggole has joined #ocaml
<wmeyer> hi ggole !
Simn has joined #ocaml
* wmeyer needs get some beer and/or coffee and start coding for real today!
<ggole> o/
<wmeyer> \o
<ggole> beer and coffee O_o
<ggole> ...at the same time?
<ggole> Might taste a bit too interesting
<wmeyer> not really, if coffee then it would be first in a long time
<whitequark> beer coffee!
<wmeyer> i got one whitequark last week!
<wmeyer> belgium beer
<wmeyer> exactly with coffee and cocoa
<wmeyer> looks good to me, thanks ggole
<whitequark> things people do...
<whitequark> :)
<ggole> I'm gonna stick with normal coffee for now :)
<ggole> Haha, no
<wmeyer> :D
<ggole> There's a good "reduction" joke in there somewhere
<wmeyer> should have a lambda picture on the bottle ideally
<wmeyer> "moderate malty" nice
Kakadu has quit [Ping timeout: 268 seconds]
* adrien sends a crate of stouts to wmeyer
<adrien> beer + coffee :P
<wmeyer> i'd prefer just beer with little bit of coffee flavour
<wmeyer> actually in small bottles, that's good, crate is good from time to time (once we finish commiting cross compiler patches I definitely need a crate of stout)
<adrien> working on them :P
<adrien> but some of the code is more than a decade old, with all the organic growth around it that you can imagine :P
<adrien> and Jacques Garrigue made driver/ocamlcomp.sh.in, an ugly hack :P
<wmeyer> :)
<adrien> I'm pretty sure it killed build times on windows though
<adrien> basically it's a shell script that will redirect to either ocamlc or ocamlc.opt and either ocamlopt or ocamlopt.opt
<adrien> somewhere in the makefiles, there are calls to sed to set that
<adrien> so, quite dirty global effect
<adrien> and on windows, it means spawning an intermediate bash
<wmeyer> :O
<adrien> and it's from 2002; not even sure it still brings any improvement
<wmeyer> actually the only thing which is worries are these complicated shell scripts
<adrien> that one is going to disappear :P
<adrien> instead it'll be complicated makefile :P
<adrien> like this:
<adrien> CAMLC_BIN_BYTE = $(CAMLRUN) $(ROOTDIR)/boot/ocamlc
<adrien> # CAMLC_BIN_OPT = $(CAMLRUN) $(ROOTDIR)/ocamlc.opt
<adrien> CAMLC_BIN = $(CAMLC_BIN_BYTE)
<adrien> and then I use $(CAMLC_BIN)
<adrien> hmmm
<adrien> forgot one line
<adrien> CAMLC_BIN ?= $(CAMLC_BIN_OPT)
<wmeyer> yes, that's nicer
<adrien> so, I use $(CAMLC_BIN); when ocamlc.opt is available, it'll use it automatically
<adrien> and once that is done, I'll add the ability to use the compiler executables from the system too (for cross)
<wmeyer> nice
<wmeyer> so we will have cross compiler prefix?
<adrien> that could be done but I'm not there yet
<adrien> nothing prevents it
<adrien> I have to say that my biggest issues are with the ocamlbuild bits by far
<adrien> myocamlbuild.ml is very dirty
<adrien> I'll fix it but it's quite frustrating because it seems highly specialized and therefore not flexible
<adrien> when something doesn't fit, typically I completely throw it away: no way to "fix" or "improve" it
<adrien> cthuluh: hi, does openbsd's sed support -i? I know freebsd's does
<adrien> but openbsd, I'm not sure
wwilly has joined #ocaml
<adrien> myocamlbuild_config.sh is also completely crazy
<adrien> (and wrong)
avsm has joined #ocaml
<adrien> it's completely read-only, it's awful
wmeyer has quit [Ping timeout: 264 seconds]
ygrek has quit [Ping timeout: 264 seconds]
<whitequark> read-only? :D
Ngazu has joined #ocaml
<adrien> a dozen lines of big sed expressions
<adrien> impossible to change
Ngazu has quit [Ping timeout: 250 seconds]
mort___ has joined #ocaml
ben_zen has quit [Ping timeout: 264 seconds]
structuralist has quit []
ygrek has joined #ocaml
yacks has joined #ocaml
osa1 has joined #ocaml
yacks has quit [Quit: Leaving]
Kakadu has joined #ocaml
pango has quit [Remote host closed the connection]
yacks has joined #ocaml
zpe has joined #ocaml
Kakadu has quit []
q66 has joined #ocaml
zpe has quit [Ping timeout: 245 seconds]
Simn has quit [Quit: Leaving]
osa1 has quit [Ping timeout: 240 seconds]
manud has joined #ocaml
mort___ has quit [Quit: Leaving.]
amiller has quit [Ping timeout: 264 seconds]
avsm has quit [Quit: Leaving.]
gautamc has quit [Read error: Connection reset by peer]
gautamc has joined #ocaml
Guest84602 has joined #ocaml
tane has joined #ocaml
introom has joined #ocaml
osa1 has joined #ocaml
introom has quit [Remote host closed the connection]
yacks has quit [Quit: Leaving]
yacks has joined #ocaml
ulfdoz has joined #ocaml
osa1 has quit [Ping timeout: 256 seconds]
<bernardofpc> whitequar> beer coffee! -> coffee beer (yes, that does exist)
zpe has joined #ocaml
introom has joined #ocaml
<introom> hi, how to solve this problem. http://paste.debian.net/plain/22377
zpe has quit [Ping timeout: 264 seconds]
tianon has quit [Ping timeout: 264 seconds]
tianon has joined #ocaml
<introom> has anyone ever done the exercises of "introdution to OCaml" by john hicky?
dsheets has joined #ocaml
<adrien> (gah, ocaml's build system rebuilds the compilers several times...)
osa1 has joined #ocaml
cdidd has quit [Read error: Operation timed out]
osa1 has quit [Quit: Konversation terminated!]
<introom> to re-illustrate my previous question, how to convert this imperative style python code into ocaml? http://bpaste.net/show/gPc4IMWagh98vnmHE6AU/
cdidd has joined #ocaml
<adrien> a recursive function which returns i if "f i" is true, or does a recursive call
yacks has quit [Quit: Leaving]
<dsheets> let search f n = let rec loop k = if k = n then n else if f k > 0 then k else loop (k+1) in loop 0;;
yacks has joined #ocaml
<bernardofpc> wouldn't an exception be a "more direct" imperative OCaml translation ?
<adrien> if you want imperative, yes
<adrien> but typical ocaml would be with a list and a (tail)rec function
ulfdoz has quit [Ping timeout: 245 seconds]
wwilly has quit [Remote host closed the connection]
<adrien> I think that removing the ocamlcomp{,opt}.sh kludge reduced build times (without ocamlbuild and camlp4 and with ccache) from 5m20s to 4m20s \o/
<adrien> (and on windows it should save 5 minutes)
<mrvn> introom: you wouldn't write such code in python in the first place
<introom> mrvn: what?
<mrvn> introom: 1) you would use xrange, 2) return n is bad, raise Not_found, 3) you probably would have an enumeration to search instead of f
<mrvn> i=0; for x in f: if x > 0: return i; i +=1; raise
<introom> mrvn: haha. 1) I use python3 for personal coding. 2) an exercise, logically requires that 3) f is a function
<mrvn> introom: It's always surprising how bad execises are
<introom> mrvn: no, the exercise requires to write ocaml. For simplicity, I translated it into python first and then ask here.
<mrvn> In python3 range == xrange, right?
<introom> yes.
<mrvn> I would return None if not found and Some x if something is found. Or raise Not_found.
<adrien> mrvn: I think the only purpose is to show some simple imperative code that is easy to read
<adrien> and then convert it to functional/recursive
<introom> yeah.
<adrien> and I believe it managed to do that
<introom> I am kinda not familiar with ocaml syntax.
<mrvn> adrien: yeah, your code is fine. It translates the python code.
manud has quit [Ping timeout: 264 seconds]
<adrien> my code? :P
<introom> dsheets's code
<mrvn> exception Found of int let search f n = try for i = 0 to n -1 do if f(i) > 0 then raise (Found i); done; n with Found i -> i;;
<mrvn> adrien: sorry dsheets's code
<mrvn> introom: ^^ if you want imperative style
<introom> mrvn: for i to is also supported.
<introom> I may encounter that later in the tutorial.
<mrvn> It's too bad ocamls for/while loops don't have a break statement.
<mrvn> using an exception to escape the loop always feels wrong for me.
<adrien> isn't there going to be support to do this in a light way?
<bernardofpc> yeah, intriguing that the imperative style is a bit "cramped"
<mrvn> well, imperative style has for/while not returning a value. So "break i" to return a result doesn't quite fit. Would be damn usefull in practice though.
<bernardofpc> well, for/while serve to side-effects
<bernardofpc> break stops the side-effects early
<mrvn> bernardofpc: raise too
<bernardofpc> yeah, but raise looks like an "error" to me
<mrvn> The only difference would be that break would have no (visible) try block and could be cheaper sinec you wouldn't need a stack backtrace and such.
<ggole> How would for return a (non-unit) value? Seems like an strange idea.
<ggole> And what happens if you fall off the end, do you get an exception?
<ggole> I guess it would make short-circuiting search a bit easier to program
transfinite has quit [Quit: transfinite]
yacks has quit [Quit: Leaving]
<introom> how to implement a dict with ocaml?
<ousado> you can use Map or Hashtbl
<introom> if I want to implement it on my own?
<ggole> Either write a functor and take hash/eq operations as an argument, or use the built-in polymorphic operations
<ousado> uhm.. look at their implementations? Or google for functional datastructures?
<introom> the Introduction to OCaml doesn't provide answers publicly is really a pain.
<introom> ot, what are you doing with ocaml?
<bernardofpc> a log parser, for me
<bernardofpc> (mostly I'm learning, ocmpared to the guys here developping ocaml environment ;-))
<introom> I am learning it these days. so, it's also a ocaml-dev channel here.
<adrien> question about ocamlbuild: what does this do: ["stdlib/std_exit"-.-C.o] ,
<adrien> ?
zpe has joined #ocaml
<introom> where can I find square root function?
<adrien> there's "sqrt", for floats
<ggole> It's in Pervasives. You should download or bookmark the reference, it is useful for answering such questions.
<introom> yeah. thanks.
zpe has quit [Ping timeout: 264 seconds]
Drup has joined #ocaml
fds has quit [Read error: Operation timed out]
<adrien> I think I'm going to put an electric collar on wmeyer to make him come back to IRC :P
fds has joined #ocaml
habnabit has joined #ocaml
leroux_ has joined #ocaml
gereedy has quit [Ping timeout: 240 seconds]
cdidd has quit [Ping timeout: 240 seconds]
leroux has quit [Ping timeout: 240 seconds]
_habnabit has quit [Ping timeout: 240 seconds]
gereedy has joined #ocaml
leroux_ is now known as leroux
cdidd has joined #ocaml
wmeyer has joined #ocaml
zpe has joined #ocaml
<adrien> wmeyer: \o/
<adrien> wmeyer: it looks like ocamlbuild expects (or expected) ocamlc.opt, ocamlopt.opt, stdlib/, ... to be in _build/
<adrien> wmeyer: any idea why/what for?
shinnya has joined #ocaml
<introom> what's the unary addition for, ~+
<adrien> wmeyer: also, how do I regenerate boot/myocamlbuild.boot?
<introom> ~+3 is just 3, any use scenario?
zpe has quit [Ping timeout: 240 seconds]
<ggole> Just there to match ~- afaik.
wmeyer has quit [Ping timeout: 264 seconds]
zpe has joined #ocaml
zpe has quit [Ping timeout: 264 seconds]
Kakadu has joined #ocaml
gnuvince- has joined #ocaml
gnuvince- has quit [Changing host]
gnuvince- has joined #ocaml
ben_zen has joined #ocaml
introom has quit [Remote host closed the connection]
zpe has joined #ocaml
introom has joined #ocaml
zpe has quit [Ping timeout: 264 seconds]
ollehar has joined #ocaml
Neros has joined #ocaml
gautamc has quit [Read error: Connection reset by peer]
Neros has quit [Read error: Connection reset by peer]
gautamc has joined #ocaml
Neros has joined #ocaml
introom has quit [Remote host closed the connection]
Guest84602 is now known as amiller
amiller has quit [Changing host]
amiller has joined #ocaml
gnuvince- has quit [Ping timeout: 276 seconds]
manud has joined #ocaml
ulfdoz has joined #ocaml
Nahra has quit [Ping timeout: 264 seconds]
introom has joined #ocaml
dsheets has quit [Ping timeout: 264 seconds]
Neros has quit [Remote host closed the connection]
Neros has joined #ocaml
introom has quit [Remote host closed the connection]
ben_zen has quit [Ping timeout: 264 seconds]
Xom has joined #ocaml
osnr has quit [Quit: leaving]
omar_ has joined #ocaml
omar_ has quit [Client Quit]
darkf has quit [Quit: Leaving]
osnr has joined #ocaml
iZsh has quit [Quit: Coyote finally caught me]
wmeyer has joined #ocaml
<adrien> wmeyer!
<adrien> you broke trunk! :P
<wmeyer> I broke trunk? :P
<wmeyer> <wmeyer> hey adrien, sorry afternoon nap
<wmeyer> <wmeyer> well, [make boot] will generate it
<wmeyer> <wmeyer> and we want to get rid of this code [18:07]
<wmeyer> <wmeyer> and actually use just plain makefiles to compile ocamlbuild
<wmeyer> <wmeyer> without *any* bootstrapping
<wmeyer>
<adrien> I believe you didn't re-generate boot/myocamlbuild.boot after you've enabled -use-ocamlfind by default
<adrien> which made you not notice an issue
<adrien> and when I've wanted to re-generate that file, I did notice the issue :P
<wmeyer> :D
<adrien> wmeyer: ocamlbuild/ocaml_specific.ml has this code:
<adrien> let () = if !Options.use_ocamlfind then begin
<adrien> [ do some stuff relying on ocamlfind ]
<adrien> but since it's a toplevel statement, it's executed when the module is loaded
<adrien> and before Options.use_ocamlfind has had a chance to be set to "false" by -no-ocamlfind
<adrien> that's a guess but it seemed pretty liekly
<adrien> likely
<adrien> I didn't look at why but only the A"-linkpkg" stuff was causing an issue
<wmeyer> OK, let me check it
<adrien> I had "ocamlc" called with "-linkpkg"
<adrien> thanks :-)
Neros has quit [Read error: Operation timed out]
avsm has joined #ocaml
wmeyer has quit [Ping timeout: 264 seconds]
tane has quit [Quit: Verlassend]
madroach has quit [Quit: leaving]
ollehar has quit [Ping timeout: 264 seconds]
contempt has quit [Ping timeout: 264 seconds]
madroach has joined #ocaml
contempt has joined #ocaml
gnuvince- has joined #ocaml
Nahra has joined #ocaml
Nahra has quit [Changing host]
Nahra has joined #ocaml
<chris2> for a simple fixed string -> fixed string replacement with ocaml-core, do i really need re2?
<adrien> I don't know core but if you're worried about regexps being "too much", iirc, re is very fast
<adrien> like _very_
<chris2> yeah, but i just want to replace '' with '
<chris2> it seems like overkill :)
ollehar has joined #ocaml
<orbitz> shoudl be pretty easy to write inefficeinclty
ulfdoz has quit [Ping timeout: 245 seconds]
<chris2> i think i can just use String.escape
<chris2> erm unescape
avsm has quit [Quit: Leaving.]
ggole has quit []
ygrek has quit [Ping timeout: 268 seconds]
Neros has joined #ocaml
avsm has joined #ocaml
dsheets has joined #ocaml
mfp has quit [Ping timeout: 245 seconds]
wormphlegm has quit [Ping timeout: 256 seconds]
wormphlegm has joined #ocaml
habnabit is now known as _habnabit
mfp has joined #ocaml
wormphlegm has quit [Ping timeout: 268 seconds]
wormphlegm has joined #ocaml
Xom has quit [Quit: ChatZilla 0.9.90.1 [Firefox 22.0/20130618035212]]
speredenn has joined #ocaml
Neros has quit [Remote host closed the connection]
Kakadu has quit []
tane has joined #ocaml
ulfdoz has joined #ocaml
wmeyer has joined #ocaml
<wmeyer> hello adrien
wmeyer has quit [Remote host closed the connection]
contempt has quit [Ping timeout: 268 seconds]
contempt has joined #ocaml
ta`e has joined #ocaml
malo has joined #ocaml
tane has quit [Ping timeout: 240 seconds]
contempt has quit [Ping timeout: 264 seconds]
contempt has joined #ocaml
dsheets has quit [Ping timeout: 256 seconds]
speredenn has quit [Quit: Leaving]
yacks has joined #ocaml
pango has joined #ocaml
dsheets has joined #ocaml
iZsh has joined #ocaml
iZsh has quit [Excess Flood]
iZsh has joined #ocaml
jdoles has joined #ocaml
<jdoles> Is it possible to define structures in expressions in OCaml? So, let x = structure Foo...
<mrvn> jdoles: that would be a module and they are first class now.
<mrvn> or do you mean a record?
<levi> OCaml's treatment of records and modules is leaving me a bit unsettled.
<jdoles> mrvn: what I really want is to have a single initialization of a module from a run-time variable such that the scope of this module is global.
<levi> What do you mean by the scope of the module?
<levi> You mean you can access its members via Module.member from anywhere in the program?
<jdoles> levi: yes
<mrvn> then you need to 1) pass the module around as agrument, 2) initialize it before other modules needs it or 3) make a module option ref
<mrvn> or module ref initialized to a dummy module at first
<mrvn> Initializing global state is quite difficult in ocaml.
<mrvn> at runtime at least
<levi> jdoles: Does the module itself need initialization, or just an instance of a data type managed by that module?
<jdoles> mrvn: yes, never mind.
<mrvn> jdoles: note that a module is just wrapping. a golbal int needs exactly the same method as a varian, record, module or whatever
watermind has joined #ocaml
<levi> The base module system provides two things, namespace structuring and controlled information hiding/sharing.
<levi> When you add in functors, you get an extra degree of flexibility, but it's essentially a concise way of describing a set of related modules and allowing you to select only the ones you need from that set.
<levi> And I have not yet wrapped my brain around first-class modules, so I won't say anything about them.
malo has quit [Quit: Leaving]
pango_ has joined #ocaml
pango has quit [Ping timeout: 240 seconds]
osa1 has joined #ocaml
ulfdoz has quit [Read error: Operation timed out]
osa1 has quit [Ping timeout: 240 seconds]
ben_zen has joined #ocaml
osa1_ has joined #ocaml
avsm has quit [Quit: Leaving.]
osa1_ has quit [Remote host closed the connection]
ben_zen_ has joined #ocaml
ben_zen has quit [Ping timeout: 276 seconds]
ben_zen_ is now known as ben_zen
ta`e has quit [Quit: Verlassend]
avsm has joined #ocaml
osa1__ has joined #ocaml
osa1__ has quit [Client Quit]
avsm has quit [Ping timeout: 268 seconds]
avsm has joined #ocaml