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
maskd has quit [Read error: 60 (Operation timed out)]
maskd has joined #ocaml
BigJ2 has joined #ocaml
BigJ2_ has joined #ocaml
bluestorm has joined #ocaml
<julm> BigJ2_: try it in a fresh toplevel; you may have overloaded the vector type.
<BigJ2_> k
_zack has joined #ocaml
<BigJ2_> I also don't know why I can't use a globaly defined variable in my constructor
eldragon has quit [Connection timed out]
BigJ2 has quit [Read error: 110 (Connection timed out)]
BigJ2_ is now known as BigJ2
<orbitz> BigJ2: can you be more specific?
<BigJ2> let max_seq_length = 100 ;;
<orbitz> a testcase perhps
seanmcl has quit []
<BigJ2> let make_vec_store =
<BigJ2> let v = Array.create max_seq_length 0.0 in
<BigJ2> v ;;
jknick has joined #ocaml
<jknick> #join modblin
<jknick> Er, oops.
<orbitz> BigJ2: compiles fine here
<bluestorm> BigJ2: let make_vect_sore = Array.create max_seq_length 0.0 would work as well
<bluestorm> (and perhaps you tried to define the length _after_ the array ?)
BigJ2 has quit []
<travisbrady> anyone seen this issue when installing bitstring via macports? http://hpaste.org/fastcgi/hpaste.fcgi/view?id=11020#a11020
<bluestorm> looks like the usual 3.11 dynlink issue
<julm> yep
<travisbrady> any known fix?
<bluestorm> travisbrady: yes, you should add "dynlink.cma" somewhere in the compilation command
<bluestorm> eg. ocamlfind ocamlc dynlink.cma ...
<bluestorm> no idea how that goes into the macports building chain though
<bluestorm> it's probably just a makefile fixing matter, and it has possibly be fixed upstream
zaemis has quit []
<travisbrady> thank you. looks like it ought to be fixable in the Makefile
<julm> I remember Camarade_Tux doing a patch for this when he was working with mingw-w64. http://ocaml.pastebin.com/f753b1408
<travisbrady> hmm, i added dynlink.cma to the command but still get the error
<travisbrady> i'm able to #load "dynlink.cma" at the toplevel
<bluestorm> travisbrady: http://ocaml.pastebin.com/mabca18a
<bluestorm> here is a quick&dirty patch to the upstreamMakefile.in
<bluestorm> (now that I think of it, I patched against the SVN, while macports must be using the stable release, but I suppose that don't make much of a difference)
_zack has quit ["Leaving."]
<bluestorm> (recipe : replace every "ocamlc" in the file with a global variable set to "ocamlc dynlink.cma")
<travisbrady> yeah, i saw that, but I've already got the ocamlc dynlink.cma in the spot where it fails and it does not fix it
<bluestorm> well
<bluestorm> did you add dynlink.cma _before_ the camlp4 object file ?
<travisbrady> oh my it seems to have worked
<travisbrady> ahh, that is what did it i guess
<travisbrady> that makes sense
<travisbrady> thanks for your hepl
schme has quit [Read error: 60 (Operation timed out)]
<travisbrady> s/hepl/help
<bluestorm> the real help would be getting a not-so-dirty fix upstream
<bluestorm> you should try to mail rwjones to report the problem
<travisbrady> Ok, I'll send him a report
<travisbrady> dang, now getting preprocessor errors
<travisbrady> shoot
<travisbrady> "Parse error: ":" expected after [patt] (in [patt_field])"
<orbitz> do you guys tend to write programs with ;;? I find it really ugly and just use let () = main .. when I want to make a program
* julm does not use ;;, never;;
<orbitz> ever;;
schme has joined #ocaml
travisbrady has quit []
NYNix has joined #ocaml
eldragon has joined #ocaml
Amorphous has quit [Read error: 110 (Connection timed out)]
Amorphous has joined #ocaml
seanmcl has joined #ocaml
caligula_ has joined #ocaml
caligula__ has quit [Connection reset by peer]
struktured has quit [Remote closed the connection]
kaustuv_ has joined #ocaml
mlh has quit ["new kernel"]
kaustuv_` has quit [Read error: 110 (Connection timed out)]
mlh has joined #ocaml
travisbrady has joined #ocaml
travisbrady has quit []
travisbrady has joined #ocaml
M| has quit [Remote closed the connection]
M| has joined #ocaml
M| has quit [Remote closed the connection]
M| has joined #ocaml
BigJ2 has joined #ocaml
travisbrady_ has joined #ocaml
seanmcl has quit []
travisbrady has quit [Read error: 110 (Connection timed out)]
travisbrady_ is now known as travisbrady
tmaedaZ has joined #ocaml
tmaedaZ is now known as tmaeda
<thelema> orbitz: I sometimes use ;; despite their ugliness as they do limit the scope of various syntax mistakes (extra ; at end of let)
<thelema> actually, I think most of these problems relate to the lack of any close for let .. in .. at the toplevel
<thelema> so using ;; gives better error messages
<orbitz> ah
<thelema> let foo = x1; x2; let bar = y1; y2 let baz = z1
<thelema> Do you see the syntax error? Would you know where the real fix is if each of foo, bar, baz were a screenful in size?
<orbitz> not on one single line, no. I probably would if it were properly idnented and all
<hcarty> thelema: This is not a good excuse - but an editor's automatic indentation helps a lot with that sort of problem.
<thelema> that's the thing - automatic indenting only helps if you haven't deleted x3 off the end of foo.
<hcarty> ;; can hide other errors
<hcarty> thelema: That is very true
<thelema> what can ;; hide?
<hcarty> thelema: Incomplete matches I think? I don't remember what the specific error was, but I ran in to it a few times when I was starting out with OCaml and using ;; after all of my functions.
<thelema> hmmm, curious
travisbrady has quit [Read error: 104 (Connection reset by peer)]
travisbrady has joined #ocaml
travisbrady has quit [Client Quit]
travisbrady has joined #ocaml
travisbrady has quit []
ulfdoz has joined #ocaml
M| has quit [Remote closed the connection]
bluestorm has quit [Read error: 113 (No route to host)]
deavid has quit [Remote closed the connection]
ulfdoz has quit [Read error: 110 (Connection timed out)]
mishok13 has joined #ocaml
julm has quit [Read error: 54 (Connection reset by peer)]
ygrek has joined #ocaml
deavid has joined #ocaml
julm has joined #ocaml
onigiri has quit []
acatout_ is now known as acatout
xcthulhu has quit []
ttamttam has joined #ocaml
verte has joined #ocaml
mpwd has joined #ocaml
det has joined #ocaml
mpwd has quit []
eldragon has left #ocaml []
lutter has joined #ocaml
munga has joined #ocaml
ygrek has quit [Remote closed the connection]
mpwd has joined #ocaml
mpwd has quit []
<Camarade_Tux> oh, svn :)
<julm> bad
<Camarade_Tux> overloading...
<julm> überbad
<Camarade_Tux> so, as far as I can see, several patches to ocaml which were living on their own are now hosted on the ocaml svn, sounds good :)
<Camarade_Tux> (unless they were already when cvs was used but I can't find them)
smimou has quit ["bli"]
munga has quit [Read error: 148 (No route to host)]
kaustuv_` has joined #ocaml
ikaros has joined #ocaml
ikaros has quit [Client Quit]
ikaros has joined #ocaml
bind_return has joined #ocaml
ygrek has joined #ocaml
kaustuv_ 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
ikaros_ has joined #ocaml
Yoric[DT] has joined #ocaml
Yoric[DT] has quit [Client Quit]
Yoric[DT] has joined #ocaml
seanmcl has joined #ocaml
ikaros has quit [Read error: 110 (Connection timed out)]
tmaeda is now known as tmaedaZ
jonafan_ has joined #ocaml
seanmcl has quit []
jonafan has quit [Read error: 113 (No route to host)]
valross has quit [Remote closed the connection]
ygrek has quit [Remote closed the connection]
<Camarade_Tux> mehdid: what do you mean?
<Camarade_Tux> mehdid: ah, I see ;-)
* thelema does a final transfer from the CVS to his git trees and prepares to make a git mirror of the SVN repo
<thelema> this will take a while....
<julm> thelema: for me git-ing the SVN is faster than git-ing the CVS =)
<thelema> yes, it took forever to get the first git checkout of the CVS
<sgnb> the task is more complex with CVS, since one has to first merge commits
<sgnb> (commits are file-based on CVS)
<sgnb> converting svn to git is pretty straightforward
tmaedaZ is now known as tmaeda
Snark has joined #ocaml
ygrek has joined #ocaml
julm has quit [Read error: 60 (Operation timed out)]
<Camarade_Tux> anyone feeling like trying ocaml-gir? :)
jimmyb2187 has left #ocaml []
<Camarade_Tux> the two libraries that are currently known to work are dbus-glib and webkit-gtk (>=1.11), you'll need all development files for them of course
jimmyb2187 has joined #ocaml
_unK has joined #ocaml
<Camarade_Tux> well, if someone feels like trying, see http://git.ocamlcore.org/cgi-bin/gitweb.cgi?p=ocaml-gir/ocaml-gir.git (it has a tarball under "tree" -> "snapshot"), use is: "cd ocaml-gir && ./me.sh" (maybe edit and uncomment one of webkit or dbus), it should generate folders in "ocaml-gir/bindings-directory", you can have a look at the "examples" folder too, it has a test for dbus (run "dbus-monitor --session" in another terminal and run the test program w
munga has joined #ocaml
julm has joined #ocaml
seanmcl has joined #ocaml
smimou has joined #ocaml
ygrek has quit [Remote closed the connection]
bluestorm has joined #ocaml
bluestorm has quit [Client Quit]
<julm> nice, the git-ed ./configure from the SVN does not fail as the git-ed one from CVS due to CVS' vendor branches.
bohanlon has joined #ocaml
tmaeda0 has joined #ocaml
tmaeda has quit [Read error: 145 (Connection timed out)]
tmaeda0 is now known as tmaedaZ
tmaedaZ is now known as tmaeda0
munga has quit [Read error: 148 (No route to host)]
verte has quit ["~~~ Crash in JIT!"]
munga has joined #ocaml
robocop has joined #ocaml
<robocop> hello
<robocop> do you know if a project of a mini ocaml interpreter exist ?
<robocop> like min-caml, but without compilation
<robocop> (in ocaml)
willy_ has joined #ocaml
<willy_> bonjour
<willy_> j'ai un petit problême à faire, je doit calculer la distance euclidienne entre deux points
<willy_> ça correspondrais à racine carrée (point1^2 - point2^2)
<willy_> si je ne me trompe pas
<robocop> oui willy_
<robocop> tu utilises pythagore
_zack has joined #ocaml
<willy_> c'est ça
<willy_> en ocaml ça s'écrit comme ça?
<robocop> willy_: there is a french channel about ocaml, here : #ocaml-fr
<kaustuv_`> robocop: have you checked andrej's "programming zoo" page?
<willy_> sqrt (point1*.point1 -. point2*.point2) ?
<kaustuv_`> robocop: http://andrej.com/plzoo/
<willy_> *. because sqrt has type float
rwmjones_ has joined #ocaml
<robocop> ho, thanks a lot kaustuv_` !
<robocop> willy_: point1 is a integer ?
<willy_> yes
<robocop> so you have to convert it
<willy_> but is use float_in_int to convert it
<willy_> of
<robocop> with float_of_int
<willy_> but my point1 is a type of two parameters
<robocop> so : sqrt((float_of_int point1)**2. -
<willy_> type { xp:int ; yp:int }
<robocop> how
<robocop> ok
rwmjones has quit [Read error: 60 (Operation timed out)]
<robocop> so you had to do : float_of_int (point1.xp)
<kaustuv_`> willy_: have you read http://en.wikipedia.org/wiki/Euclidean_distance ?
<kaustuv_`> esp. section 1.1?
<willy_> and i think i must check my book of math of french "college" for calcul distance in 2D
kaustuv_` is now known as kaustuv
rwmjones_ is now known as rwmjones
ikaros_ has quit ["Leave the magic to Houdini"]
avansc|win has joined #ocaml
<avansc|win> hi, anyone here that can answer a small question?
<avansc|win> hello?
mishok13 has quit [Read error: 110 (Connection timed out)]
<thelema> yes, hello
<avansc|win> hi, thanks for responding
<avansc|win> i was curious to know whether ocaml is interpreted or compiled in any form
<thelema> it can be compiled to bytecode, and interpreted or compiled to native code.
<avansc|win> i might have the syntax wrong. but when you do something like ocaml script
<thelema> The interactive "toplevel" (or REPL) usually does bytecode, but can do native too.
<avansc|win> does that mean its completely interpreted
<thelema> no.
<avansc|win> k thanx
avansc|win has left #ocaml []
smimou has quit ["bli"]
mpwd has joined #ocaml
<willy_> this is my expression : let (distance:point->point-> int) =
<willy_> function point1 -> function point2 ->
<willy_> sqrt ( (float_of_int(point1.xp) -. float_of_int(point2.xp)) ** 2. -. (float_of_int(point1.yp) -. float_of_int(point2.yp) ** 2.) )
<willy_> with my type { xp:int ; yp:int }
<willy_> it is correct do you think?
<willy_> uhm
<thelema> let dx = p1.xp - p2.xp and dy = p1.yp - p2.yp in sqrt (float (d1 * d1 + d2 * d2))
<willy_> with int_of_float (sqrt ... )
mpwd has quit []
<thelema> you're subtracting in the middle, you mean to add dx^2 and dy^2
<willy_> uhm yes
<thelema> and you could speed things a bit by only doing the sqrt in float arithmetic
<thelema> but yes, looks good.
<thelema> "float_of_int" = "float"
<thelema> also you don't need all the type annotations
<thelema> let distance p1 p2 = ...
<willy_> ok
<willy_> i must use float with ** 2
<willy_> 1 ** 2 ;;
<willy_> This expression has type int but is here used with type float
ygrek has joined #ocaml
<willy_> but if i use local defined, i can omited the ** and use d1 * d1
<willy_> it's more clear
<willy_> sqrt must use with float
jonafan_ is now known as jonafan
<willy_> but i can use just one float_of_int before use sqrt
jules has joined #ocaml
_zack has quit ["Leaving."]
_unK has quit [Remote closed the connection]
<thelema> x * x = x ** 2
<thelema> yes
<Camarade_Tux> well, without the types :P
munga has quit [Read error: 145 (Connection timed out)]
<willy_> this is my expression know let (distance:point->point-> int) =
<willy_> function point1 -> function point2 ->
<willy_> let dx = point1.xp - point2.xp and dy = point1.yp - point2.yp in int_of_float( sqrt (float_of_int(dx * dx + dy * dy)))
jules has quit ["Leaving"]
<thelema> willy: ok. You can write [let distance point1 point2 = let dx = ...
<willy_> uhm ?
<thelema> instead of [let foo = function x -> bar] you can write [let foo x = bar]
* thelema goes away for a bit
<willy_> yes i know
<willy_> but my teacher want we use function x ->
<willy_> and let (namefunction:type->type)
<willy_> she say, with that, we know wath we want to do with the function
ttamttam has quit ["Leaving."]
h3 has quit [Read error: 104 (Connection reset by peer)]
h3r3tic has joined #ocaml
lutter has quit ["Leaving."]
aij_ has joined #ocaml
seanmcl has quit []
julm has quit [Remote closed the connection]
julm has joined #ocaml
travisbrady has joined #ocaml
smimou has joined #ocaml
<robocop> haha willy_, you are in prépa ?
<willy_> no
<robocop> in what ?
<willy_> first year of licence in math-info
<robocop> ha ok !
<willy_> semestre 1 in algo-prog we study caml, in the 2nd semestre, C
<robocop> ok
<robocop> In witch fac are you ?
<willy_> and in the 2nd year, langage theory and another algo concept in theory
<willy_> University of Strasbourg in Alsace
<robocop> ok
<willy_> and you?
<robocop> in lycée
<willy_> ok
<willy_> in BAC ? wath kind?
<robocop> S series
mattiase has joined #ocaml
<willy_> ok
<willy_> and where you want's to go after?
<willy_> i must go
<willy_> thanks for help
<willy_> ciao
willy_ has quit ["Leaving"]
ulfdoz has joined #ocaml
seanmcl has joined #ocaml
ttamttam has joined #ocaml
julm has quit [Read error: 60 (Operation timed out)]
ikaros has joined #ocaml
julm has joined #ocaml
Submarine has joined #ocaml
Yoric[DT] has quit ["Ex-Chat"]
_JusSx_ has joined #ocaml
_JusSx_ has quit [Client Quit]
ttamttam has quit ["Leaving."]
_unK has joined #ocaml
julm_ has joined #ocaml
nimred has quit ["leaving"]
nimred has joined #ocaml
razel has joined #ocaml
<razel> how do i identify an int array inside a record
<razel> errr
<razel> how do i assign
<mattiase> razel: assign to an array element you mean?
julm has quit [Read error: 60 (Operation timed out)]
<razel> for example type x = { field : int Array };;
<razel> what would i change that to
<mattiase> razel: What are you trying to do? Changing an element in the array?
<razel> declaring a type record.
<mattiase> razel: array, not Array
<razel> aaah
<razel> ok thank you
<mattiase> Array is the module
hyperboreean has quit [Read error: 145 (Connection timed out)]
julm has joined #ocaml
julm_ has quit [Read error: 54 (Connection reset by peer)]
Associat0r has joined #ocaml
meltingwax has joined #ocaml
<razel> how do i remove an element of an array
<razel> maybe blit
Submarine has quit ["Leaving"]
<hcarty> razel: You would have to re-create the array with that specific element removed.
<hcarty> razel: Unless you simply want to replace that element, in which case Array.set or "my_array.(i) <- new_value" will do what you want.
ulfdoz has quit [Read error: 60 (Operation timed out)]
kaustuv_ has joined #ocaml
ygrek has quit [Remote closed the connection]
Snark has quit ["Ex-Chat"]
onigiri has joined #ocaml
robocop has quit ["Leaving."]
kaustuv has quit [Read error: 110 (Connection timed out)]
mpwd has joined #ocaml
Mr_Awesome has quit [Read error: 104 (Connection reset by peer)]
razel has quit ["leaving"]
julm_ has joined #ocaml
mpwd has quit []
julm has quit [Read error: 148 (No route to host)]
h3r3tic has quit [Read error: 104 (Connection reset by peer)]
h3 has joined #ocaml
slash_ has joined #ocaml
travisbrady has quit []
julm_ has quit [Read error: 60 (Operation timed out)]
mpwd has joined #ocaml
BigJ3 has joined #ocaml
BigJ has quit [Nick collision from services.]
BigJ has joined #ocaml
BigJ has quit [Nick collision from services.]
BigJ3 is now known as BigJ
aij_ is now known as aij
julm has joined #ocaml
Narrenschiff has joined #ocaml
as has joined #ocaml
as has quit [Client Quit]
travisbrady has joined #ocaml
seanmcl has quit []
Mr_Awesome has joined #ocaml
julm has quit [Read error: 104 (Connection reset by peer)]
julm has joined #ocaml
seanmcl has joined #ocaml
BigJ2 has quit [Read error: 110 (Connection timed out)]
BigJ2 has joined #ocaml
Narrenschiff has quit []
verte has joined #ocaml
verte has quit ["~~~ Crash in JIT!"]
thrasibule has joined #ocaml
struktured has joined #ocaml
M| has joined #ocaml
M| has quit [Read error: 104 (Connection reset by peer)]
M| has joined #ocaml
smimou has quit ["bli"]
M| has quit [Remote closed the connection]