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
verte has joined #ocaml
M| has joined #ocaml
tmaedaZ is now known as tmaeda
seanmcl has joined #ocaml
munga has quit [Read error: 113 (No route to host)]
_unK has quit [Remote closed the connection]
_zack has joined #ocaml
seanmcl has quit []
_zack has quit ["Leaving."]
kaustuv_` has joined #ocaml
travisbrady has quit []
kaustuv_ has quit [Read error: 110 (Connection timed out)]
Amorphous has quit [Read error: 113 (No route to host)]
Amorphous has joined #ocaml
tmaeda is now known as tmaedaZ
tmaedaZ is now known as tmaeda
caligula__ has joined #ocaml
travisbrady has joined #ocaml
caligula_ has quit [Read error: 110 (Connection timed out)]
eldragon is now known as ElSuperDragon
Associ8or has quit []
mattam has quit [Read error: 60 (Operation timed out)]
sfmatt has joined #ocaml
<sfmatt> Hi
<sfmatt> Is it possible to declare a variable without initializing it
<sfmatt> let a:string;;
<sfmatt> instead of let a ="";;
<sfmatt> Of course the question makes more sense with complex types
<sfmatt> In other words, I'd like to create a global ref to a big record type without having to initialize it.
<julm> sfmatt: use an [option ref] type
<julm> let a = ref None
<orbitz> or find a better way to structure your code
<sfmatt> I see. It's not my type, it comes from a library but I can encapsulate it in an option type easily. Thanks
<orbitz> remember, python doens't have variables pre se
<sfmatt> I'm using ocamlnet/cgi and I want to keep the connection to the database open between requests which for now will work if I define the db handle glbally
Associat0r has joined #ocaml
meltingw1x is now known as meltingwax
mbishop_ has joined #ocaml
mbishop has quit ["Leaving"]
mbishop_ is now known as mbishop
Ched has joined #ocaml
onigiri has quit []
tmaeda is now known as tmaedaZ
onigiri has joined #ocaml
ikaros has joined #ocaml
Ched has quit [Read error: 113 (No route to host)]
ygrek has joined #ocaml
ikaros has quit ["Leave the magic to Houdini"]
ElSuperDragon has left #ocaml []
Associat0r has quit []
ttamttam has joined #ocaml
ulfdoz has joined #ocaml
ttamttam has quit [Client Quit]
ikaros has joined #ocaml
mfp has quit [Read error: 110 (Connection timed out)]
mfp has joined #ocaml
olegfink_ has joined #ocaml
ikaros has quit ["Leave the magic to Houdini"]
olegfink has quit [Read error: 110 (Connection timed out)]
ttamttam has joined #ocaml
Modius has quit [Read error: 110 (Connection timed out)]
bluestorm has joined #ocaml
lvillani has joined #ocaml
bluestorm has quit [Read error: 104 (Connection reset by peer)]
mfp has quit [Read error: 104 (Connection reset by peer)]
munga has joined #ocaml
mfp has joined #ocaml
ttamttam has quit [Read error: 110 (Connection timed out)]
Ched has joined #ocaml
det- has quit [Read error: 104 (Connection reset by peer)]
det- has joined #ocaml
det has quit [Read error: 104 (Connection reset by peer)]
lutter has joined #ocaml
munga has quit [Read error: 113 (No route to host)]
Yoric[DT] has joined #ocaml
naufraghi has joined #ocaml
mal`` has quit ["Coyote finally caught me"]
mal`` has joined #ocaml
marteo has joined #ocaml
<flux> sfmatt, you need to use something like fastcgi or scgi to make that happen
<flux> sfmatt, because cgi-processes get terminated between requests
<flux> sfmatt, scgi is pretty decent option, if you can use it in your web-server
marteo has quit [Remote closed the connection]
lutter has quit ["Leaving."]
<thelema> flux: or of course mod_ocaml
lvillani has left #ocaml []
M| has quit [Remote closed the connection]
Atol has joined #ocaml
<Atol> Hi, i get an error and im a noob. That function is written in a french manual. I get that error : "# val fact : int -> int = <fun>fact 8 ;;
<Atol> "
<Atol> instead of "- : int = 40320"
<Atol> anyone ?
<Atol> The original function is "
<Atol> # let rec fact n = if n < 2 then 1 else n * fact(n-1) ;;
<Atol> val fact : int -> int = <fun>"
<thelema> yes, that part is ok.
<thelema> then [fact 8;;]?
<thelema> you've defined a function with type [int -> int]
<thelema> now call it
<Atol> Thx for your help, it's a fucking space between 8 and ;; :)
<thelema> that shouldn't matter
<thelema> you could be short one <CR>
<Atol> I just retry and it's work in both case
<Atol> I dont understand ... Anyway, thx you :)
<thelema> you're welcome
<Atol> So "if n < 2 then 1" it mean that "if n < 2, so n = 1 or that the function end and return 1 ?
<thelema> not assignment
<thelema> let foo = (if 2 = 1 then 3 else 5)
<thelema> the whole if statement evaluates to a value, and since that's all that's in the function, the function returns that value
thelema_ has joined #ocaml
<Atol> hmmmn, that's way quicker that in the only one language i know php :D
<thelema_> let foo = (if 2 = 1 then 3 else 5)
<thelema_> the whole if statement evaluates to a value, and since that's all that's in the function, the function returns that value
<thelema_> ocaml is much faster than php
kaustuv_ has joined #ocaml
<thelema_> it's not quite as nice for quick and dirty web pages
<Atol> Can i make web pages with ocaml ?
<thelema_> of course
<Atol> is there a framework like in erlang ?
<thelema_> ocaml works just fine as a cgi app. There's a couple frameworks that go into more wild things
<thelema_> no extra-simple to begin framework like ruby on rails or catalyst, though
<Atol> cgi app ? i heard a bit about cgi but i dont really know what is it? Im gonna search. I come back :D
<Atol> You know im a complete noob as you can be like you just know the dirty language that is php :D
naufraghi has left #ocaml []
tmaedaZ is now known as tmaeda
* thelema_ doesn't have much experience in php - I've just had to fix some bugs in it before
<thelema_> in programs written in it
<Atol> Where have u learn ocaml. My french manual is not clear at all and i think im enough good in english to clearly understand an english manual
olegfink_ has quit [Read error: 60 (Operation timed out)]
<Atol> Nobody know a smart manual to learn ocaml ?
kaustuv_` has quit [Read error: 110 (Connection timed out)]
verte has quit ["~~~ Crash in JIT!"]
thelema has quit [Read error: 110 (Connection timed out)]
_unK has joined #ocaml
<Atol> Same that i have :D
olegfink has joined #ocaml
<thelema_> Atol: I like the oreilly 'applications in ocaml' book
<thelema_> but if you want something more direct, try the reference manual - there's 5 sections at the front that go from basics to quite complex ideas
<Atol> but o'reilly is closed and the documentation is inacessible
h3 has quit [Read error: 104 (Connection reset by peer)]
h3r3tic has joined #ocaml
<Atol> I cannot see the page. Dont know why, i have not acess to it
<julm> inria's site is really slow at the moment
Atol has quit ["Leaving"]
kattla has quit [Read error: 110 (Connection timed out)]
kattla has joined #ocaml
slash_ has quit [Client Quit]
<thelema_> does anyone remember what the consensus was on the findlib package name for camlzip?
thelema_ is now known as thelema
Alpounet has joined #ocaml
h3r3tic has quit [Read error: 54 (Connection reset by peer)]
h3r3tic has joined #ocaml
Narrenschiff_ has joined #ocaml
ofaurax has joined #ocaml
<mfp> thelema: is there any consensus? AFAIK GODI uses one name, Debian and others another, and that's all there's to it
_zack has joined #ocaml
<thelema> I thought there was some consensus arrived at in the last week or so in the channel among the package maintainers
<mfp> thelema: the latest ref to camlzip I can find in my logs is Sep 17 20:41:13 <hcarty> The AUR web site also seems to have a comment about the missing native code build for camlzip
ygrek has quit [Remote closed the connection]
olegfink has quit [Read error: 54 (Connection reset by peer)]
ygrek has joined #ocaml
olegfink has joined #ocaml
ua has joined #ocaml
<thelema> mfp: thanks for checking.
_zack has quit ["Leaving."]
julm_ has joined #ocaml
mpwd has joined #ocaml
<ygrek> mfp, looking at your patch for ocsigen (and other C bindings), isn't there a minimal chance that using Int_val(v) without holding runtime lock is potentially unsafe?
<mfp> how so? Int_val(x) is essentially (x >> 1)
julm has quit [Nick collision from services.]
julm_ is now known as julm
<mfp> pid_req is not a GC root, so it cannot be modified by another thread without us knowing
<ygrek> oh, yes, you are right, thanks
onigiri has quit []
M| has joined #ocaml
ikaros has joined #ocaml
rjones has joined #ocaml
rjones is now known as rwmjones_lptp
Pepe_ has quit ["leaving"]
Ppjet6 has joined #ocaml
h3r3tic has quit [Read error: 104 (Connection reset by peer)]
h3r3tic has joined #ocaml
M| has quit [Remote closed the connection]
<hcarty> Camarade_Tux: Congratulations on the first ocaml-gir announcement
<hcarty> thelema: The Debian folks still think that GODI should change its name for the package
<hcarty> thelema: The work-around I use is to install a "zip" package on GODI which only contains a META file which requires "camlzip"
* rwmjones_lptp too
* rwmjones_lptp means, congratulations to Adrien
<hcarty> thelema: So at this point, I think the issue needs to be taken up with the GODI maintainers, and either an extra "zip-compat" package could be added or the package name can be changed entirely
ua has quit [Read error: 113 (No route to host)]
mpwd has quit []
mpwd has joined #ocaml
peddie has quit [Read error: 60 (Operation timed out)]
mpwd has quit []
mattam has joined #ocaml
h3r3tic has quit [Read error: 104 (Connection reset by peer)]
h3r3tic has joined #ocaml
infoe has quit [Read error: 110 (Connection timed out)]
ua has joined #ocaml
<mfp> any lwt experts around? got what looks like a stack overflow (http://ocaml.pastebin.com/d372c5345 up to many many frames), is it just me, or this is not tail-recursive > http://ocaml.pastebin.com/m3a534c0d
<mfp> with the fix being like http://ocaml.pastebin.com/m1a0372de
raduv has joined #ocaml
ygrek has quit [Remote closed the connection]
<raduv> .wc
raduv has left #ocaml []
infoe has joined #ocaml
Anarchos has joined #ocaml
_JusSx_ has joined #ocaml
Associat0r has joined #ocaml
slash_ has joined #ocaml
mpwd has joined #ocaml
Anarchos has quit ["Vision[0.9.7-H-090423]: i've been blurred!"]
ua has quit ["leaving"]
mishok13 has quit [Read error: 60 (Operation timed out)]
mishok13 has joined #ocaml
Narrenschiff_ has quit []
Yoric[DT] has quit ["Ex-Chat"]
matt__ has joined #ocaml
ikaros has quit [Remote closed the connection]
sfmatt has quit [Read error: 110 (Connection timed out)]
ccasin has joined #ocaml
_zack has joined #ocaml
onigiri has joined #ocaml
monestri has joined #ocaml
<monestri> if I pass in a list to a function and the list is changed inside the function
<monestri> will it be changed outside as well?
<kaustuv_> What do you mean "changed"?
<monestri> change
<flux> monestri, lists cannot be changed
<flux> monestri, I suppose if they contain mutable content and you change that in the function, the contents of the list indeed will be changed regardless where the list is seen
<kaustuv_> However, there is no function f : 'a list -> 'a list and value k : 'a list that will falsify this: (let l = k in ignore (f k) ; l == k)
<monestri> are there an optional parameters in ocaml?
<monestri> or should you use helper functions when you need extra parameters
_zack has quit ["Leaving."]
<monestri> so you have to call the function with the label name?
<flux> optional arguments indeed need to be named
_zack has joined #ocaml
<monestri> i see
<monestri> do optional arguements have to come before requried ones?
_JusSx_ has quit ["leaving"]
<flux> no, but you need to have atleast one non-optional argument after optional ones
<flux> otherwise currying wouldn't work as expected
<kaustuv_> It is generally good style to put optional arguments first
julm has quit [Read error: 60 (Operation timed out)]
julm has joined #ocaml
slash_ has quit [Client Quit]
struktured has quit [Read error: 60 (Operation timed out)]
ccasin has quit ["Leaving"]
fschwidom has joined #ocaml
jdh30 has joined #ocaml
<jdh30> hello
Alpounet has quit ["Leaving"]
jdh30 has quit [Remote closed the connection]
fschwidom has quit [Remote closed the connection]
fschwidom has joined #ocaml
_zack has quit ["Leaving."]
Alpounet has joined #ocaml
<monestri> is list a reservered keyword?
<monestri> it's yellow in vim ;/
h3r3tic has quit [Read error: 104 (Connection reset by peer)]
h3r3tic has joined #ocaml
h3r3tic has quit [Read error: 54 (Connection reset by peer)]
h3r3tic has joined #ocaml
onigiri has quit []
<mfp> monestri: nope
_zack has joined #ocaml
<monestri> do I not have to load modules from the standar library?
<monestri> nevermind
fschwidom has quit [Remote closed the connection]
rwmjones_lptp has quit ["This computer has gone to sleep"]
<monestri> how would I string together one block of code for multiple matches?
<monestri> i.e. | h::t when h = 3 && h::t when h = 4
<olegfink> monestri: when h = 3 || h = 4?
<monestri> would that also work for types?
<monestri> | Circle || Square?
<olegfink> just list the patterns without '->'
<olegfink> e.g. A | B | C -> x
<monestri> oh ok, thanks
<monestri> for optional parameters
<monestri> I can understand why you would need to use f ~label:3 2;; outside of f.. because there might be a var named label
<monestri> but you don't have to use ~label inside of f, you can just use label
<monestri> but if f is recursive you still have to use f ~label:3 2;; inside of f?
<monestri> i.e. when making recursive calls only
_zack has quit ["Leaving."]
kaustuv_` has joined #ocaml
_unK has quit [Remote closed the connection]