Alpounet changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | 3.11.1 out now! Get yours from http://caml.inria.fr/ocaml/release.html - Answer OCaml Meeting 2010 poll https://forge.ocamlcore.org/survey/survey.php?group_id=77&survey_id=1
ulfdoz has quit [Read error: 110 (Connection timed out)]
kaustuv_ has quit [Read error: 110 (Connection timed out)]
_zack has joined #ocaml
struktured has joined #ocaml
ofaurax has quit ["Leaving"]
_zack has quit ["Leaving."]
_unK has joined #ocaml
tmaeda0 has joined #ocaml
tmaeda0 is now known as tmaedaZ
tmaedaZ is now known as tmaeda0
h3r3tic has quit [Read error: 104 (Connection reset by peer)]
h3r3tic has joined #ocaml
tmaeda has quit [Read error: 110 (Connection timed out)]
<monestri> anyone know how'd i'd go about generating a power set in ocaml?
<Alpounet> do you have a beginning ?
<monestri> I have a list of elements
travisbrady_ has joined #ocaml
travisbrady has quit [Connection reset by peer]
travisbrady_ is now known as travisbrady
struktured has quit [Read error: 110 (Connection timed out)]
<monestri> thanks!
<monestri> is there an exponential operator?
<monestri> I don't understand Pervasives.exp 2.0;;
<monestri> exponential with only one arguement?
<monestri> I also see **, but no integer exponentials
struktured has joined #ocaml
verte has joined #ocaml
thrasibule has joined #ocaml
Amorphous has quit [Read error: 110 (Connection timed out)]
h3r3tic has quit [Read error: 104 (Connection reset by peer)]
h3r3tic has joined #ocaml
<monestri> let rec plus_two ?(index = 0) = match index with 0 | 1 -> 1 + plus_two (index + 1) | 2 -> 1 | _ -> 0;;
<monestri> what's wrong with this?
h3r3tic has quit [Read error: 104 (Connection reset by peer)]
h3r3tic has joined #ocaml
<monestri> well, my main concern is incrementing index, having problems with that in another function
Amorphous has joined #ocaml
h3r3tic has quit [Read error: 104 (Connection reset by peer)]
struktured has quit [Read error: 110 (Connection timed out)]
h3r3tic has joined #ocaml
struktured has joined #ocaml
seanmcl has joined #ocaml
M| has joined #ocaml
thrasibule_ has joined #ocaml
thrasibule has quit [Read error: 104 (Connection reset by peer)]
<monestri> floor (log (float_of_int n) / (log 2.))
<monestri> why does that first log think n is an integer?
seanmcl has quit []
<monestri> # floor (log (float_of_int 17) / (log 2.));;
<monestri> This expression has type float but is here used with type int
<monestri> # log (float_of_int 18);; by itself works
<monestri> this is so annoying ;/
<monestri> ohhh, fogot there was a seperate thing for floating point devision
h3r3tic has quit [Read error: 54 (Connection reset by peer)]
h3r3tic has joined #ocaml
h3r3tic has quit [Read error: 104 (Connection reset by peer)]
h3r3tic has joined #ocaml
Modius has joined #ocaml
_unK has quit [Remote closed the connection]
meltingwax has quit [Read error: 60 (Operation timed out)]
meltingwax has joined #ocaml
julm has quit [Read error: 104 (Connection reset by peer)]
julm has joined #ocaml
struktured has quit [Read error: 110 (Connection timed out)]
Modius has quit [Read error: 145 (Connection timed out)]
julm has quit [Read error: 60 (Operation timed out)]
julm has joined #ocaml
thrasibule_ has quit [Read error: 110 (Connection timed out)]
Alpounet has quit [Read error: 113 (No route to host)]
Modius has joined #ocaml
Modius has quit [Client Quit]
mpwd has quit []
ygrek has joined #ocaml
mpwd has joined #ocaml
travisbrady has quit [Read error: 104 (Connection reset by peer)]
travisbrady has joined #ocaml
ttamttam has joined #ocaml
slash_ has joined #ocaml
verte has quit ["~~~ Crash in JIT!"]
ulfdoz has joined #ocaml
ttamttam has quit ["Leaving."]
verte has joined #ocaml
fschwidom has joined #ocaml
olegfink has quit [Read error: 60 (Operation timed out)]
olegfink has joined #ocaml
Yoric[DT] has joined #ocaml
rjones has joined #ocaml
det- has quit [Read error: 104 (Connection reset by peer)]
det has joined #ocaml
<mfp> monestri: the / operator works on integers, you have to use /.
munga has joined #ocaml
M| has quit [Remote closed the connection]
ulfdoz has quit [Read error: 60 (Operation timed out)]
ulfdoz has joined #ocaml
julm has quit [Read error: 131 (Connection reset by peer)]
julm has joined #ocaml
kaustuv_ has joined #ocaml
munga has quit [Read error: 113 (No route to host)]
Ched has quit [Read error: 110 (Connection timed out)]
kaustuv_` has quit [Read error: 110 (Connection timed out)]
Ched has joined #ocaml
Associat0r has quit []
fschwidom has quit [Remote closed the connection]
tmaeda has joined #ocaml
<Camarade_Tux> bah, I hate firefox !
<julm> you do well :P
tmaeda0 has quit [Read error: 110 (Connection timed out)]
olegfink has quit [Read error: 60 (Operation timed out)]
olegfink has joined #ocaml
bluestorm has joined #ocaml
<bluestorm> flux: I've been working on default values in Macaque this weekend, and I've got something more-or-less working
<flux> bluestorm, oooh
<bluestorm> flux: http://pastebin.be/21546
<flux> bluestorm, \o/
<flux> bluestorm, it's not on darcs yet? (truth to be told I don't think I yet have time to play with it, though)
<bluestorm> no it's not, i'd like to test it a bit more and write some documentation
<bluestorm> but I'll probably push the working state before tomorrow
rjones is now known as rwmjones-lptp
ikaros has joined #ocaml
Asmadeus has quit [Read error: 110 (Connection timed out)]
<flux> bluestorm, I suppose it cannot be avoided that default columns still need to be listed in inserts?
<bluestorm> hm
<bluestorm> i'm not exactly sure (maybe I could work a hack in the case were the inserted tuple structure is known stactically, eg. {..} instead of $..$, like in the UPDATE case)
<bluestorm> but the syntaxic sugar I'm considering right now is to allow {foo = ?} instead of {foo = table?foo} in the specific INSERT case
<bluestorm> (but it's not completely obvious to implement as it's relatively context dependent)
<flux> I suppose that'd be almost as good
<flux> I'm thinking that adding a new optional column means that you also need to modify all insert sites
<flux> not that big a task, as the compiler is sure to tell you where you're missing them, though
verte has quit ["~~~ Crash in JIT!"]
thrasibule has joined #ocaml
rwmjones-lptp has quit ["This computer has gone to sleep"]
seanmcl has joined #ocaml
Alpounet has joined #ocaml
<Camarade_Tux> hmmm, is gforge's BSD license 2-clause or 3-clause?
Asmadeus has joined #ocaml
seanmcl has quit []
_unK has joined #ocaml
thrasibule has quit [Read error: 110 (Connection timed out)]
julm_ has joined #ocaml
julm has quit [Nick collision from services.]
julm_ is now known as julm
ttamttam has joined #ocaml
Xteven has joined #ocaml
ttamttam has quit ["Leaving."]
ofaurax has joined #ocaml
M| has joined #ocaml
<kaustuv_> Camarade_Tux: gforge is not open source
<kaustuv_> Camarade_Tux: If you mean fusionforge, it's mostly GPL with bits of MPL, etc.
<Camarade_Tux> kaustuv_: no, I mean, once you've registered an opensource project on the forge, with the "BSD license", is that license 2 or 3 clauses (no attribution or attribution)?
<kaustuv_> the attribution (commonly called "advertising") clause was the *fourth* clause. The third clause says roughly that the names of the devs cannot be used for promotion
<kaustuv_> If you remove even that clause, then it's basically the MIT license
<Camarade_Tux> kaustuv_: ah ok, thanks :)
<Camarade_Tux> I had completely forgotten that part
<kaustuv_> But as to your question, I have no idea, although the 4 clause BSD license is very rare today
h3 has joined #ocaml
<Camarade_Tux> I was looking for the "New BSD License" which is the three-clauses one :)
h3r3tic has quit [Read error: 104 (Connection reset by peer)]
struktured has joined #ocaml
bluestorm has quit [Read error: 110 (Connection timed out)]
travisbrady_ has joined #ocaml
travisbrady has quit [Read error: 104 (Connection reset by peer)]
travisbrady_ is now known as travisbrady
rjones has joined #ocaml
h3r3tic has joined #ocaml
h3 has quit [Read error: 104 (Connection reset by peer)]
seanmcl has joined #ocaml
ikaros has quit ["Leave the magic to Houdini"]
bluestorm has joined #ocaml
struktured has quit [Read error: 110 (Connection timed out)]
tmaeda is now known as tmaedaZ
tmaedaZ is now known as tmaeda
BiDOrD has joined #ocaml
c0m has joined #ocaml
bluestorm has quit ["Leaving"]
rjones has quit ["This computer has gone to sleep"]
ttamttam has joined #ocaml
rjones has joined #ocaml
rjones has quit ["This computer has gone to sleep"]
rjones has joined #ocaml
rjones is now known as rwmjones
rwmjones has quit ["This computer has gone to sleep"]
<monestri> how would I sum up the elements of two lists into one list such that l1 = [1;1;1..], l2 = [1;1;1...], sum(l1,l2) = [2;2;2...]
<monestri> I'm a bit confused, I want to try using two match statements in one function
<monestri> not quite sure how to do that or if that's the right approach
tmaeda is now known as tmaedaZ
<olegfink> monestri: you might want to look at [List.map2] and its implementation in the ocaml standard library.
<olegfink> it's generally a good idea to consult the standard library code, it's simple and contains many useful idioms.
<monestri> so the first arguement is some sort of iteratory?
h3r3tic has quit [Read error: 104 (Connection reset by peer)]
h3r3tic has joined #ocaml
<olegfink> iteratory?
<monestri> itorator*
<olegfink> the first argument to [List.map2] is a function applied to corresponding elements of the two lists
<olegfink> have you read the description in the manual?
<monestri> hmm.. i read..
<monestri> List.map2 (fun x y -> x + 1) [1;2;3] [1;2;3];;
<monestri> - : int list = [2; 3; 4]
<monestri> oh..
<monestri> x + y :).. ok.. that makes sense. thanks
<monestri> is there some place with more description i'm supposed to be reading?
<flux> nope, that's it
tmaedaZ is now known as tmaeda
tmaeda has quit [Read error: 54 (Connection reset by peer)]
<monestri> fun a b -> F a b;; i'm confused as to why this is a syntax error
tmaeda has joined #ocaml
ttamttam1 has joined #ocaml
olegfink has quit [Read error: 104 (Connection reset by peer)]
olegfink has joined #ocaml
<Camarade_Tux> monestri: what is the definition of F?
<monestri> Let F x y = x + y;;.. is what i was trying
<monestri> guess you can't use capital functions?
<Camarade_Tux> exactly
<monestri> oh, Let is capital too
<Camarade_Tux> let f x y = x + y;;
<olegfink> also the function you're defining is named (+).
<monestri> +?
<monestri> the former or latter?
<olegfink> with parens outside of the infix context.
<Camarade_Tux> you can run the following: (+) 3 4;;
ttamttam has quit [Read error: 110 (Connection timed out)]
ztfw has joined #ocaml
<monestri> so let's say that I want to do something like List.map2, but I want to do it recursively
<monestri> mainly because i'm not building a list
<monestri> would I then have to use some sort of nested match statements?
ttamttam has joined #ocaml
<olegfink> if you looked at the [List.map2] implementation as I suggested, you could see that it uses match on a tuple of two lists.
<monestri> I looked at, and used List.map2 to implement an earlier function
<monestri> At least the description, not sure where you said to look at the implementation
<monestri> oh, the standard library code
lutter has joined #ocaml
<monestri> i'm looking at the link i posted above.. but I dont' see any code
ttamttam1 has quit [Read error: 110 (Connection timed out)]
<flux> monestri, well, you could grab the ocaml sources
<monestri> oh, right
<monestri> thanks
<monestri> oh, ok.. touple of lists.. clever
<olegfink> monestri: the library source code should be in there in default ocaml install
<olegfink> on unices it's usualy $prefix/ocaml/lib, on Nt %prefix%\Objective Caml\lib
struktured has joined #ocaml
<monestri> found it, thanks
matt__ has quit [Read error: 104 (Connection reset by peer)]
matt__ has joined #ocaml
rjones has joined #ocaml
lutter has quit ["Leaving."]
matt__ has quit [Remote closed the connection]
_zack has joined #ocaml
Associat0r has joined #ocaml
rjones is now known as rwmjones
rwmjones has quit ["Leaving"]
rwmjones_lptp has joined #ocaml
bzzbzz has quit [Read error: 110 (Connection timed out)]
seanmcl has quit []
mpwd has quit []
mpwd has joined #ocaml
ikaros has joined #ocaml
BiDOrD has quit [Read error: 110 (Connection timed out)]
BiDOrD has joined #ocaml
kaustuv_` has joined #ocaml
kaustuv_ has quit [Read error: 110 (Connection timed out)]
Ched has quit [Remote closed the connection]
_zack has quit ["Leaving."]
stan__ has joined #ocaml
h3r3tic has quit [Read error: 54 (Connection reset by peer)]
h3r3tic has joined #ocaml
munga has joined #ocaml
stan__ has quit [Client Quit]
dzlk has joined #ocaml
seanmcl has joined #ocaml
mpwd has quit []
mpwd has joined #ocaml
mellum_ has left #ocaml []
_zack has joined #ocaml
dzlk has left #ocaml []
_zack has quit ["Leaving."]
seanmcl has quit []
h3r3tic has quit ["Segmentation Fault"]
rwmjones_lptp has quit ["This computer has gone to sleep"]
rwmjones_lptp has joined #ocaml
monestri has quit [Remote closed the connection]
ttamttam has quit ["Leaving."]
_zack has joined #ocaml
seanmcl has joined #ocaml
Ched has joined #ocaml
h3r3tic has joined #ocaml
mjonsson has joined #ocaml
<mjonsson> Hi, I'm wondering how to get ocaml to automatically load referenced modules like ghci does
<Camarade_Tux> I don't think it's possible, not with stock ocaml
<flux> the best you can get is use topfind (#use "topfind";;), after which you can #require "modules";;
<flux> I thought you needed to somehow load or add modules to use them in ghci, but perhaps not then?
meltingwax has quit ["leaving"]
<mjonsson> ghci finds them automatically
<mjonsson> if your module imports another module, ghci will load the other module
<thelema> loading the modules isn't hard for compilation, but for linking, ocaml uses a c-like model
<thelema> (which probably makes it easy to link with C)
<Camarade_Tux> automatic loading would be a problem if two modules have the same name (most usually when you are coding on one/are using a different version)
<flux> mjonsson, #require will handle dependencies also
<mjonsson> I'll investigate topfind
<mjonsson> thanks
<Camarade_Tux> it comes with findlib/ocamlfind
<mjonsson> trying to use it now but it seems to work at a package level, not module level?
<thelema> yes, findlib defines packages which get inclued at compile time.
<thelema> Camarade_Tux: module versioning is a problem no matter what linking model you use.
<thelema> It's just that OCaml doesn't have much of a default search path / strategy for finding dependent .cmo/cmx files
<flux> camarade, I suppose those cases could be detected (ambitious package) and expected to be resolved manually
<flux> camarade_tux, on the other hand instaling more system packages could make it more difficult to compile packages..
<flux> camarade_tux, in practice packages with same modules names (or installing multiple versions) is quite rare, don't you think?
BigJ2 has quit [Read error: 110 (Connection timed out)]
<flux> hm, ambiguous :)
_zack has quit ["Leaving."]
<Camarade_Tux> thelema: I wasn't really thinking about linking but just toplevel
<mjonsson> Is there anywhere I can read/see how experienced ocaml developers manage their projects and toplevel?
Ppjet6 is now known as Pepe_
<Camarade_Tux> flux: yeah, that's really uncommon, that's why I mentionned working on a module that is already installed ;-)
<flux> I don't know of such a resource, but I'm thinking most of them use the toplevel via emacs
<flux> it allows for easy sending of code fragments or buffers to toplevel
<flux> (buffers as in whole files)
<mjonsson> I'm using tuareg
<flux> indeed, tuareg's the way to go
<mjonsson> it works fine for me as long as I have only one .ml file
<mjonsson> after that it needs manual #load commands and building outside emacs
<flux> otherwise I've managed bigger projects with ocamlfind too
<flux> so I write META-files and install them with ocamlfind install etc
* mjonsson reading about META-files
mfp has quit [Read error: 104 (Connection reset by peer)]
sramsay_ has joined #ocaml
ygrek has quit [Remote closed the connection]
_zack has joined #ocaml
mfp has joined #ocaml
mfp has quit [Read error: 110 (Connection timed out)]
mfp has joined #ocaml
_zack has quit ["Leaving."]
<hcarty> mjonsson: I second ocamlfind
<Camarade_Tux> hcarty: btw, thanks :)
mfp has quit [Read error: 104 (Connection reset by peer)]
<hcarty> Camarade_Tux: You're welcome! For what? :-)
<Camarade_Tux> ^^
<Camarade_Tux> 17:54 hcarty : Camarade_Tux: Congratulations on the first ocaml-gir announcement
<Camarade_Tux> ;)
<hcarty> Camarade_Tux: Ah, right
M| has quit [Read error: 104 (Connection reset by peer)]
M| has joined #ocaml
_unK has quit [Remote closed the connection]
mfp has joined #ocaml
_unK has joined #ocaml
shazam has joined #ocaml
<shazam> hmmm
shazam is now known as palomer
<palomer> anyone know how to uniquely identify a type in a type declaration when using camlp4?
raduv has joined #ocaml
<palomer> I want to have some kind of type equality, so I need to encode my type in a datatype, and I don't want two types with the same name in different modules to have the same identifier
raduv has left #ocaml []
<palomer> or even two types with the same name in the same module
<palomer> oh wait, that can't happen
<palomer> so yeah, uniquely identify a type
slash_ has quit [Client Quit]
ztfw has quit [Remote closed the connection]
ztfw has joined #ocaml
onigiri has joined #ocaml
BigJ2 has joined #ocaml
ulfdoz has quit [Read error: 110 (Connection timed out)]
<BigJ2> i was wondering if anyone can give me advice on the syntax to access the i th position in the array based on this code.
<Camarade_Tux> BigJ2: just s.seq.(i)
<BigJ2> k
<BigJ2> I wasn't sure how to connect it all
<Alpounet> gildor, here ?
<Camarade_Tux> there are two other things however: first you don't need to specify the type of the function arguments, and you don't need a separate value to store the length of an array: see Array.length
<Camarade_Tux> it's basically free
<BigJ2> k thanks I'll take a look
ikaros has quit ["Leave the magic to Houdini"]
h3r3tic has quit [Read error: 104 (Connection reset by peer)]
h3r3tic has joined #ocaml
_unK has quit [Remote closed the connection]
rwmjones_lptp has quit ["This computer has gone to sleep"]
_unK has joined #ocaml
<BigJ2> for emacs, the indentation command, does anyone know the shortcut?
monestri has joined #ocaml
<monestri> is there a do_until f x (some boolean expression) function?
<Camarade_Tux> while expr do expr2 done
<Alpounet> while (not expr)