<BigJ>
can anyone recommend an editor for writing ocaml code, or do u just use emacs of vim? if so is there special syntax highlighting specific for ocaml?
<julm>
BigJ: yep, both have specific syntax highlighting for ocaml.
<BigJ>
julm, which is ur personal preference?
<julm>
Vim =)
<julm>
but I just don't know emacs
<julm>
which has an ocaml-mode said to be powerful : tuareg-mode
<BigJ>
how long have u been programming in ocaml?
<julm>
~4 years
slash_ has quit [Client Quit]
rcloud has joined #ocaml
<BigJ>
i am just starting out with it, the syntax takes some getting used to
<julm>
yes indeed
travisbrady has quit ["Computer has gone to sleep"]
rcloud has quit [Read error: 104 (Connection reset by peer)]
rcloud has joined #ocaml
rcloud` has joined #ocaml
rcloud` has left #ocaml []
ski_ has quit ["Lost terminal"]
rcloud` has joined #ocaml
rcloud` has quit [Remote closed the connection]
onigiri has quit []
ski_ has joined #ocaml
bohanlon has joined #ocaml
thrasibule has quit [Read error: 104 (Connection reset by peer)]
thrasibule has joined #ocaml
thrasibule_ has joined #ocaml
thrasibule has quit [Connection reset by peer]
tvn2009 has quit ["Leaving"]
Mr_Awesome has quit ["aunt jemima is the devil!"]
Mr_Awesome has joined #ocaml
thrasibule_ has quit [Read error: 110 (Connection timed out)]
Lomono has joined #ocaml
Lomono has quit [Client Quit]
Lomono has joined #ocaml
bohanlon has quit ["grrr... hald is annoying"]
verte has joined #ocaml
komar_ has joined #ocaml
travisbrady has joined #ocaml
travisbrady has quit ["Computer has gone to sleep"]
rcloud has quit [Remote closed the connection]
Asmadeus has quit [Read error: 60 (Operation timed out)]
Camarade1Tux has joined #ocaml
Asmadeus has joined #ocaml
sgnb has quit [Read error: 104 (Connection reset by peer)]
sgnb has joined #ocaml
Camarade_Tux has quit [Read error: 110 (Connection timed out)]
Lomono has quit []
ttamttam has joined #ocaml
caligula__ has joined #ocaml
tvn2009 has joined #ocaml
caligula_ has quit [Read error: 145 (Connection timed out)]
ttamttam has quit ["Leaving."]
f[x] has joined #ocaml
bohanlon has joined #ocaml
tvn2009 has quit ["Leaving"]
Asmadeus has quit [Read error: 104 (Connection reset by peer)]
Camarade1Tux has quit [Read error: 104 (Connection reset by peer)]
Camarade_Tux has joined #ocaml
Asmadeus has joined #ocaml
knightrage is now known as knight\zzz
ttamttam has joined #ocaml
verte_ has joined #ocaml
hkBst has joined #ocaml
verte has quit [Nick collision from services.]
verte_ is now known as verte
Submarine has joined #ocaml
Asmadeus_ has joined #ocaml
Camarade1Tux has joined #ocaml
dmentre has joined #ocaml
Camarade_Tux has quit [Read error: 145 (Connection timed out)]
Asmadeus has quit [Read error: 110 (Connection timed out)]
Submarine has quit [Client Quit]
Asmadeus_ is now known as Asmadeus
_zack has joined #ocaml
f[x] has quit [Read error: 60 (Operation timed out)]
tmaeda has joined #ocaml
tmaeda0 has quit [Read error: 145 (Connection timed out)]
Camarade1Tux is now known as Camarade_Tux
Ringo47 has joined #ocaml
Ringo48 has quit [Read error: 113 (No route to host)]
rwmjones has quit [Read error: 60 (Operation timed out)]
f[x] has joined #ocaml
ski_ has quit ["Lost terminal"]
f[x] has quit [Read error: 110 (Connection timed out)]
rwmjones has joined #ocaml
julm_ has joined #ocaml
robocop has joined #ocaml
<robocop>
hello
<robocop>
Is godi == ocamlfind ?
<thelema>
hi
_andre has joined #ocaml
<thelema>
no, but they're by the same author
<robocop>
or ocamlfind is a part of godi ?
<robocop>
hum, ok
<robocop>
thanks
<thelema>
and ocamlfind is required for godi
<thelema>
although not the other way around
<robocop>
okey
<robocop>
I'm going de try it.
<thelema>
what?
<robocop>
godi
<robocop>
ha
<robocop>
godi get ocaml 3.10 ...
julm has quit [Read error: 110 (Connection timed out)]
<robocop>
not 3.11
<robocop>
hum
<robocop>
if I want to uninstall it
<robocop>
I had just to remove /prefix/path directory ?
Snark has joined #ocaml
<thelema>
I think so.
<robocop>
ok
f[x] has joined #ocaml
robocop has quit [Remote closed the connection]
komar_ has quit [Read error: 110 (Connection timed out)]
verte has quit ["Lost terminal"]
verte has joined #ocaml
komar_ has joined #ocaml
<thelema>
Type [ `Flat of 'a base * 'a Ean_std.rul Batteries.Vect.t ]
<thelema>
is not compatible with type
<thelema>
'a t =
<thelema>
[ `Clust of 'a base * 'a t Batteries.Vect.t
<thelema>
| `Flat of 'a base * 'a Ean_std.rul Batteries.Vect.t ]
<thelema>
Types for tag `Clust are incompatible
<thelema>
I'm trying to coerce the first to the second.
<flux>
how are you coercing it?
<thelema>
(Vect.fold add_rule Vect.empty rules (* : [`Flat of 'a base * 'a rul Vect.t] Vect.t*) :> 'a t Vect.t)
<thelema>
With the middle section uncommented, it still doesn't work.
<flux>
hmm..
<thelema>
maybe it's because 'a t is recursive in the `Clust case...
* thelema
drops the `Flat in the intermediate values
Lomono has joined #ocaml
orbitz has joined #ocaml
Amorphous has quit [Read error: 113 (No route to host)]
Amorphous has joined #ocaml
<thelema>
okay, removing the `Flat tag off my intermediate values and mapping it back on at the end fixed this.
th5 has joined #ocaml
jimmyb21871 has joined #ocaml
cognacc has joined #ocaml
cognacc has quit [Read error: 145 (Connection timed out)]
jimmyb2187 has quit [Read error: 110 (Connection timed out)]
rjack has joined #ocaml
okagawa has joined #ocaml
okagawa has left #ocaml []
itewsh has joined #ocaml
rjack has quit ["leaving"]
itewsh has quit [Read error: 110 (Connection timed out)]
itewsh has joined #ocaml
itewsh has quit [Client Quit]
th5 has quit []
dmentre has quit ["Leaving."]
smimou has joined #ocaml
julm has joined #ocaml
Lomono has quit ["Don't even think about saying Candlejack or else you wi"]
ttamttam has quit ["Leaving."]
travisbrady has joined #ocaml
travisbrady has quit [Client Quit]
travisbrady has joined #ocaml
BigJ has quit ["Leaving"]
julm_ has quit [Read error: 110 (Connection timed out)]
albacker has joined #ocaml
derdon has joined #ocaml
ttamttam has joined #ocaml
slash_ has joined #ocaml
rcloud has joined #ocaml
BigJ has joined #ocaml
itewsh has joined #ocaml
LeCamarade_ has left #ocaml []
_zack has quit ["Leaving."]
<albacker>
so in school we learned that we should use a ref to an int if for some reason later in the program we intend to change the value of the int, (using := ), but i don't see the usage. we can always do set variable = 12;; and when we change it we just use another let..
<albacker>
instead of doing let variable = ref 12; ; and later variable := 13 (for example)
<albacker>
s/set/let
<flux>
albacker, well, try to write a piece of code that sums numbers from 0 to 10 together with a for-loop by using such a variable?
<albacker>
hm.. i'll just give it a try.
<flux>
(* something here *) for x = 0 to 10 do (* insert code here *) done; Printf.printf "Result is %d\n%!" ((* result here *))
<gildor_>
albacker: with "let variable = " you don't assign value, you create a syntactic override
<albacker>
i cant do, let variable = variable + x : flux ?
<flux>
albacker, you can
<flux>
albacker, but its scope ends at the end of the for loop
<albacker>
well that would be same as variable := !variable + x; ?
<flux>
nope, it would be different
<flux>
it would be the same as: let variable' = variable + x, except variable' is named variable
<albacker>
the resultat at the end would be the same right ?
<flux>
albacker, no
<flux>
albacker, maybe this example will convince you:
<flux>
let value = 42
<albacker>
do you mean that by using ref we just use the same "space" of memory all the time..
<flux>
let print_value () = Printf.printf "value is %d\n%!" value
<flux>
let call1 = print_value ()
<flux>
let value = 44
<flux>
let call2 = print_value ()
<flux>
it worked for the previous guy who had the same problem ;)
<flux>
now, compare that to: let value = ref 42 .. Printf .. !value .. call1 .. let _ = value := 44 .. call2
<flux>
(I hope it's the silence of it sinking in..)
<albacker>
haha it's the silence of not "converting" it :P
<albacker>
sorry for the 5 line paste.
<albacker>
let value = ref 42
<albacker>
let print_value () = Printf.printf "value is %d\n%!" !value
<albacker>
let call1 = print_value ()
<albacker>
value := 44
<albacker>
let call2 = print_value ()
<albacker>
;;
<albacker>
what's wrong here in line 3 ?
<flux>
you need to put ;; after it
<flux>
or alternatively make line 4 let _ = value := 44
<albacker>
ok i see..
<albacker>
i don't know why before it worked without the ;; and why the _ would avoid that problem though.
<albacker>
i see clearly the output is different.
<flux>
compilation units are _either_ a list of statements, or _one_ expression, and the compilation units are separated by ;;
<flux>
let _ = 42 is a statement. let in an expression is "let a = b in c", if you're wondering
<flux>
make that 'let as an expression'
<albacker>
what is _ after that : let _ = value := 44
<albacker>
does := return a unit ?
<flux>
yes
<flux>
_ discards the value
<flux>
alternatives: let random_ignored_name = value := 44
<flux>
or: let () = value := 44
<flux>
that would actually be a good, if not better alternative, as it verifies the right side indeed returns (), in case you write something you didn't intend
<albacker>
i see
<albacker>
thanks flux.
<flux>
happy understanding ;)
<albacker>
at least i understood when do we use ;;
itewsh has quit [Remote closed the connection]
itewsh has joined #ocaml
<albacker>
what's the best editor for caml ? since vim and emacs they dont autoindent my code :/
<flux>
well, emacs can be made to indent your code full automatic, but I personally haven't used that feature
<flux>
I've just learned to press tab at the beginning of each line and it gets indented properly
<flux>
or I can press M-q to reindent current statement
<flux>
if you choose to use emacs, do make sure you use tuareg-mode
<flux>
and that you can have caml-mode installed, so you have caml-types.el around
<flux>
caml-types is one of the nicest feature in ocaml/emacs integration (mind you, you can get similar functionality to vim too, I just don't know how)
<flux>
with it you can compile your files with the switch -dtypes, and in the editor, you can point an expression and press C-c C-t to find its type
<flux>
it might not be apparent why this is useful with simple programs, though
<albacker>
i think i'll get emacs to work with it (even though im more a vim user).. this semester i'll have to use emacs since they want me to in school.
<flux>
well, if you can find auto indenting for vim then I suppose there's not a lot of difference
<flux>
(and that type throwback-thingy)
<_andre>
you can type \t in vim to get the types
<_andre>
iirc i had to edit ocaml.vim for it to work with 3.11... i think that file is not being maintained anymore :(
<albacker>
can you pastebin it somewhere?
<albacker>
please
<_andre>
sure
<_andre>
my edits were just a hack to make it work, as i don't know about the format of the .annot files