<kipi>
how do you step into a function call in ocamldebug, rather than stepping over?
<kipi>
ah
<kipi>
step, silly me
mr_pengy has joined #ocaml
mr_pengy has quit [Remote closed the connection]
kipi has quit ["Leaving"]
zarul has joined #ocaml
psnively has quit []
zarul has quit [Read error: 110 (Connection timed out)]
zarul has joined #ocaml
zarulshahrin_ has joined #ocaml
zarul has quit [Nick collision from services.]
zarulshahrin_ is now known as zarul
laynor has joined #ocaml
<laynor>
hi, I'm trying tuareg mode for emacs, when I M-x tuareg-complete it says caml-complete definition is void. what should i do?
zarulshahrin_ has joined #ocaml
zarul has quit [Nick collision from services.]
zarulshahrin_ is now known as zarul
optikalmouse has joined #ocaml
shawn has joined #ocaml
<optikalmouse>
is there a socket library somewhere?
<optikalmouse>
I googled for that and I found one or two mentions of one but nothing really...usuable
visage has quit []
danly_ has joined #ocaml
danly has quit [Read error: 104 (Connection reset by peer)]
danly_ has quit [Read error: 104 (Connection reset by peer)]
shawn has quit [Connection timed out]
pants1 has joined #ocaml
shawn has joined #ocaml
lde has joined #ocaml
qwwqe has joined #ocaml
shawn has quit [Read error: 110 (Connection timed out)]
optikalmouse has left #ocaml []
G_ is now known as G
shawn has joined #ocaml
shawn has quit [Connection timed out]
shawn has joined #ocaml
shawn has quit [Remote closed the connection]
zarvok has quit ["BitchX-1.1-final -- just do it."]
kelaouch1 has joined #ocaml
pants1 has quit [Read error: 110 (Connection timed out)]
kelaouchi has quit [Read error: 110 (Connection timed out)]
pants1 has joined #ocaml
ygrek has joined #ocaml
rwmjones has joined #ocaml
kelaouchi has joined #ocaml
LeCamarade has joined #ocaml
love-pingoo has joined #ocaml
xavierbot has joined #ocaml
<LeCamarade>
Oh.
<LeCamarade>
xavierbot: Log off.
xavierbot has quit [Remote closed the connection]
<LeCamarade>
:o) I'm the king!
<LeCamarade>
Je suis le roi!
kelaouch1 has quit [Read error: 110 (Connection timed out)]
<rwmjones>
LeCamarade, you've got it working then :-?
beginner has joined #ocaml
<beginner>
I need help understanding this
<beginner>
let name = expression1 in expression2
joshcryer has quit [Read error: 104 (Connection reset by peer)]
<zmdkrbou>
you define a name, and then you write something where you can use this name
<zarul>
something like : let A = 3 in A x A ??
<zarul>
so the result will be 9
<zarul>
but what I am confused is something like this
<zarul>
beginner, go it?
joshcryer has joined #ocaml
<beginner>
<zarul> but what I am confused is something like this <--- forget about this, wrong channel
<zmdkrbou>
(let A = 3 in etc. is not a really good example, since variables can only have names with uncapitalize first letter)
<zarul>
:) maybe you can ask in the channel instead of PM me...
<zarul>
I am not an expert...
<zarul>
zmdkrbou, would be a better person for you to ask
<zarul>
"let A = 3 in etc. is not a really good example" : correct, that is my mistake ..
<beginner>
zarul, ok
<rwmjones>
try:
<rwmjones>
let n = 3 in n * n ;; Printf.printf "n = %d\n" n
<rwmjones>
versus:
<rwmjones>
let n = 3 in Printf.printf "n * n = %d\n" (n * n)
zarul has left #ocaml []
<laynor>
hi, is there someone using tuareg mode in emacs for ocaml development?
<rwmjones>
yup
<laynor>
:)
<laynor>
when I do M-x tuareg-complete it says caml-complete is void. what's the thing?
<laynor>
(of course I'm a (o)caml noob)
smimou has joined #ocaml
<LeCamarade>
rwmjones: Nearly, nearly. It should be my hack for today, before I slip back into other stuff and get caught in the middle of a recursion. :o)
<LeCamarade>
I see the bleeding need for an evaluator. It really slows demonstrations in the channel when we don't have one.
<LeCamarade>
I am making it so that messages that end in ;; are considered OCaml statements.
<LeCamarade>
That's feasible, I think, no?
<beginner>
rwmjones, from the book I got something like : let name = let a = 1 in
<beginner>
let b = 2 in
<beginner>
a + b
<rwmjones>
beginner, sounds like poor indentation. Put it into an editor and hit tab a few times.
<rwmjones>
let name =
<rwmjones>
let a = 1 in
<rwmjones>
let b = 2 in
<rwmjones>
a + b
<beginner>
yes, that's what I don't understand...
<beginner>
the "in", what is it actually means?
joshcryer has quit [Client Quit]
zarul has joined #ocaml
<beginner>
??
<zmdkrbou>
let x = <something> in <an expression> is saying : let us define x as <something> and use it in <an expression>
<zmdkrbou>
because it's convenient to put names on some parts of the expressions
<beginner>
so, let x <something> in <expression 1> in <expression 2>
<beginner>
should means something like: let us define x as <something> and use it in <expression 1> and also <expression 2> ??
<LeCamarade>
let x = "Hello, world!" in print_endline x;;
<zmdkrbou>
no, let x = <something> in <expression 1>, and this <expression 2> can be "let y = <...> in <expression 3>
<LeCamarade>
That prints "Hello, World!"
<zmdkrbou>
LeCamarade: that's not a good example ...... side effects ...
<beginner>
from the book I got it is something like:
<pango>
laynor: caml-complete comes from caml-help, maybe you're lacking that one?
<beginner>
let a =
<beginner>
let b = 1 in
<beginner>
let c = 2 in
<beginner>
b + c ;;
<laynor>
pango: that's the thing! I didn't know I had to install some more scripts... -_- thanks!
<zmdkrbou>
beginner : this is let a = (let b = 1 in (let c = 2 in b + c))
<zmdkrbou>
(the first let is at top level)
<pango>
laynor: np, just found a similar question in archived channel logs
<LeCamarade>
zmdkrbou: Yeah. :o)
<beginner>
zmdkrbou, that is pretty clear, only one thing left..
<beginner>
"let a = "
<beginner>
since a is not assigned...
<zmdkrbou>
there is an implicit "in <the global environment>" after this
<beginner>
how If I did " a + b + c"
<zmdkrbou>
you couldn't have written a + b + c where you wrote b + c, because a is not define here yet (since b + c is the definition of a)
<beginner>
ok
<beginner>
I think I understand now, thank you for helping a noob like me..
zarul has quit ["Leaving"]
Mr_Awesome has quit ["time to impregnate a moth"]
bluestorm_ has joined #ocaml
eroyf has quit [Read error: 110 (Connection timed out)]
ygrek_ has joined #ocaml
ygrek has quit [Remote closed the connection]
mrpingoo has joined #ocaml
xavierbot has joined #ocaml
xavierbot has quit [Remote closed the connection]
mrpingoo has quit [Client Quit]
xavierbot has joined #ocaml
xavierbot has quit [Remote closed the connection]
_JusSx_ has joined #ocaml
shawn has joined #ocaml
shawn has quit [Remote closed the connection]
shawn has joined #ocaml
_blackdog has joined #ocaml
_blackdog has left #ocaml []
tty56_ has joined #ocaml
joshcryer has joined #ocaml
laynor has quit [Read error: 110 (Connection timed out)]
tty56 has quit [Read error: 110 (Connection timed out)]
G_ has joined #ocaml
G has quit [Read error: 110 (Connection timed out)]
eroyf has joined #ocaml
fre has joined #ocaml
shawn has quit [Remote closed the connection]
<LeCamarade>
Do nested functions affect performance? Think in a heavily-recursive function. I think not, but ... ?
slipstream has joined #ocaml
beginner has quit [Read error: 110 (Connection timed out)]
<bluestorm_>
LeCamarade: do you mean nested function declaration (in the source) or nested function call (at runtime) ?
<bluestorm_>
nested function call increase the stack size, and may raise stack error, if they're not tail-recursive
<bluestorm_>
i don't think nested function declarations affect performances
kelaouch1 has joined #ocaml
<LeCamarade>
In source.
<LeCamarade>
:o)
<bluestorm_>
hum
<bluestorm_>
do you have an example of what you call a heavily-recursive nested function ?
<LeCamarade>
Well, the one that listens in at a connection.
<LeCamarade>
The substitute for a while true loop.
<bluestorm_>
hum
<LeCamarade>
With another func there in.
<LeCamarade>
Maybe many. Which may have more in them ...
<bluestorm_>
i never noticed performance problems like that
<LeCamarade>
But I guess they are public'ed for the compiler, and only appear nested to the programmer for convenience.
<bluestorm_>
by the way
<bluestorm_>
i seems like a strange idea to put a lot of your code inside the interaction loop :p
<LeCamarade>
Sometimes the data will only be available in that loop, since I, by style, don't use mutables.
<LeCamarade>
So the loop has to be a rec function.
kelaouchi has quit [Read error: 110 (Connection timed out)]
kelaouchi has joined #ocaml
fre is now known as beginner
joshcryer_ has joined #ocaml
<rwmjones>
LeCamarade, it depends on whether they capture state and form a closure or not
<rwmjones>
in all cases, look at the assembler output (ocamlopt -S)!
<LeCamarade>
rwmjones: Aye. Hoping the assembler output is not ... French. ;o)
<zmdkrbou>
* LeCamarade seems to know enough french to say "i'm the king" in french, why not to read french comments in asm ? :p
<LeCamarade>
zmdkrbou: Parce que je ne comprends pas le français ... :o)
<zmdkrbou>
you liar :)
<LeCamarade>
:o)
kelaouch1 has quit [Read error: 110 (Connection timed out)]
joshcryer has quit [Read error: 113 (No route to host)]
joshcryer_ has quit [Read error: 113 (No route to host)]
eroyf has quit [Remote closed the connection]
eroyf has joined #ocaml
xavierbot has joined #ocaml
<LeCamarade>
Okay.
<LeCamarade>
The evaluator is coming on well ... all it will do to statements is ... send them back to sender. :o)
<LeCamarade>
23;;
<LeCamarade>
Oops.
xavierbot has quit [Remote closed the connection]
xavierbot has joined #ocaml
<LeCamarade>
70;;
<xavierbot>
70;;
<LeCamarade>
:o)
<LeCamarade>
Bon.
<LeCamarade>
3
<LeCamarade>
3;
<LeCamarade>
4;
<LeCamarade>
5;;
<xavierbot>
5;;
<LeCamarade>
:o)
<LeCamarade>
If you want to evaluate a statement, it must have a ;; somewhere on it. That's as it stands. Currently, all the bot does is send back your crap. Now, lemme go try to wire in a sandboxed evaluator.
<xavierbot>
If you want to evaluate a statement, it must have a ;;
<LeCamarade>
:o)
<zmdkrbou>
let rec f n = if n = 0 then 1 else n * (f (n - 1)) ;;
<xavierbot>
let rec f n = if n = 0 then 1 else n * (f (n - 1)) ;;
<zmdkrbou>
super
<bluestorm_>
f 3;;
<xavierbot>
f 3;;
<bluestorm_>
:)
<LeCamarade>
It just takes the lasst ;; and should take everything before it through an evaluator.
<xavierbot>
It just takes the lasst ;;
xavierbot has quit [Remote closed the connection]
<LeCamarade>
Okay.
<LeCamarade>
Maybe that may cause un-necessary attempts at evaluation?
<bluestorm_>
you may want to select only lines beginning with # for example
<LeCamarade>
Like when someone types ;; in a sentence.
<bluestorm_>
# f 3;;
<LeCamarade>
bluestorm_: I was hoping I can skip that, because I wanted to just be able to write a statement and see it evaluated, rather than having to say `Get ready, here's some code'.
<LeCamarade>
Maybe I can't ... :o(
xavierbot has joined #ocaml
<LeCamarade>
# 23;;
<xavierbot>
# 23;;
<LeCamarade>
Responds privately as well, by the way. /msg xavierbot 34;;
<LeCamarade>
123;; Not evaluated.
<LeCamarade>
# 123;; (* Evaluated. *)
<xavierbot>
# 123;;
xavierbot has quit [Remote closed the connection]
xavierbot has joined #ocaml
<LeCamarade>
I now leave you with this utterly-useless song ...
<LeCamarade>
# "OCaml!!!";;
<xavierbot>
# "OCaml!!!";;
<LeCamarade>
Lemme go eat.
<rwmjones>
123 + 456;;
<rwmjones>
# 123 + 456;;
<xavierbot>
# 123 + 456;;
<rwmjones>
isn't it supposed to be evaluating that??
<LeCamarade>
No ... I'm still kicking the sandbox.
<LeCamarade>
That's for slightly-later. Actually, I have the sandbox done. Just to get it to insert code and then run the file and then eat in the STDOUT or someting ...
xavierbot has quit [Remote closed the connection]
xavierbot has joined #ocaml
<LeCamarade>
#23;;
<xavierbot>
23;;
xavierbot has quit [Remote closed the connection]
xavierbot has joined #ocaml
* LeCamarade
goes for a bite ...
_JusSx_ has quit [Read error: 110 (Connection timed out)]
_blackdog has joined #ocaml
xavierbot has quit [Remote closed the connection]
<beginner>
May I ask a question, what does the ' in : val result : int -> 'a -> int = <fun>
<beginner>
means?
<pango>
'a is a type variable, in this context it means "any type" (the function is partially polymorphic)
<Smerdyakov>
Beginner, read thy tutorial.
<beginner>
Smerdyakov, I am reading a tutorial and doing the exercises..
<LeCamarade>
beginner: In OCaml, a name can have the ' on it.
<Smerdyakov>
beginner, if it didn't mention a feature yet, then you shouldn't be worrying about it.
<Smerdyakov>
LeCamarade, that's the wrong answer.
<pango>
LeCamarade: but not as first character
<beginner>
so ' means any type?
<beginner>
"variable a of any type"
<beginner>
is it?
<bluestorm_>
'a mean "any type, let's name it a"
<bluestorm_>
' is not separable from a, 'a has a meaning as a whole
<bluestorm_>
in research papers you will often find the greek letter "alpha" here
<bluestorm_>
beginner: the 'a is important to make distinction between different "any type"
<bluestorm_>
( = ) is 'a -> 'a -> bool, because the first and second argument must have the same type
<beginner>
god, I have been programming in C and some other languages, and today I am learning Ocaml though this is my first day.. I feel so excited, I never know there is a language that is so close to real math, it's not only helping me to improve my programming skills, but also my math !!
<bluestorm_>
hm
<bluestorm_>
what is your math level ?
<beginner>
bluestorm_, why?
<bluestorm_>
curiosity
<beginner>
what made you curious?
<bluestorm_>
i'm always curious
<bluestorm_>
hm
<Smerdyakov>
bluestorm_, I suggest that it is better for beginner to read a well-thought-out tutorial that explains this than to muddle through ad-hoc explanations that you produce now.
<beginner>
lol, there must be a reason for someone to be curious..
<bluestorm_>
beginner: do you read french ?
_blackdog has left #ocaml []
<beginner>
bluestorm_, too bad, nope .. I wish I could :(
<bluestorm_>
:p
<bluestorm_>
(i wrote some introducory thoughts on typing in french)
<beginner>
it's hard to find a good tutorial on ocaml.. the one I am referring to is by Jason Hickey..
<bluestorm_>
i think most of them are "good", but maybe not for everyone
<beginner>
"the Introduction to Objective Calm Programming language"
* rwmjones
is gtk programming now and needs some Objective Calm
<beginner>
It's quite okay for me, just sometimes it doesn't explain in deep to someone like me who is new to the functional programming
<bluestorm_>
lablgtk ? :-°
<rwmjones>
bluestorm_, yeah
<rwmjones>
tree_store ... it's crazy
* rwmjones
thinks the craziness comes mainly from gtk though
<beginner>
bluestorm_, I am trying to understand what you said above: so basically ' means any type and
<beginner>
'a is not the same as 'b
<bluestorm_>
yes
<bluestorm_>
for example, if i were to code an "apply that function to that argument" function
<Smerdyakov>
beginner, please don't continue this. Wait until you come to it in the tutorial.
<bluestorm_>
let apply f x = f x
<bluestorm_>
hm
<beginner>
Smerdyakov, this is how I learn... I know maybe this is not the right way to learn, but this is how I learn things faster..
<Smerdyakov>
beginner, I don't believe you.
<beginner>
bluestorm_, then?
<bluestorm_>
hm
<bluestorm_>
then i got firghtened by Smerdyakov :-°
<bluestorm_>
He must have a better experience of ocaml pedagogy than i do, so you maybe you should try to go away as he says
<beginner>
duh, I am already started to understand it, don't stop halfway..
<bluestorm_>
anyway, you could try to guess apply type
<bluestorm_>
(or ask it to the toplevel, but doing it yourself is better)
pango has quit [Remote closed the connection]
pango has joined #ocaml
ygrek_ has quit [Remote closed the connection]
ygrek has joined #ocaml
buluca has joined #ocaml
eroyf has quit [Remote closed the connection]
eroyf has joined #ocaml
_blackdog has joined #ocaml
_blackdog has left #ocaml []
slipstream-- has joined #ocaml
buluca has quit ["Leaving."]
slipstream has quit [Read error: 110 (Connection timed out)]
descender has joined #ocaml
pango has quit [Remote closed the connection]
pango has joined #ocaml
pango has quit ["I shouldn't really be here - dircproxy 1.0.5"]
pango has joined #ocaml
kelaouchi has quit [Connection reset by peer]
kelaouchi has joined #ocaml
yodafinger_ has joined #ocaml
yodafinger has quit [Connection reset by peer]
yodafinger_ is now known as yodafinger
LeCamarade has quit ["ExitFailure 27"]
tehdeuce has joined #ocaml
<ygrek>
can I use functions defined in one file in another one without creating modules?
<bluestorm_>
"creating modules" ?
eroyf has quit [Remote closed the connection]
<bluestorm_>
file behaves as implicit modules actuallly
<bluestorm_>
so ygrek if your first file is foo.ml, you can use the function "bar" with Foo.bar
<bluestorm_>
(exactly like List.map or Array.length, that come from /usr/lib/ocaml/list.ml and /usr/lib/ocaml/array.ml )
<ygrek>
bluestorm_, thanks, problem solved
<ygrek>
I mean it is solved with your advice
<bluestorm_>
hm
<bluestorm_>
if you compile the files, take care of putting foo.ml before the other file
<bluestorm_>
ocamlc foo.ml bar.ml -o foobar
<ygrek>
I use Ocamlmakefile
<ygrek>
handy
<bluestorm_>
hm
<bluestorm_>
3.10 comes with ocamlbuild, that should be even handier
mnemonic has quit ["Lost terminal"]
<ygrek>
dont want to switch to 3.10 right now
<ygrek>
have to finish this task till monday
<ygrek>
and spent plenty of time compiling ocamlgsl correctly. not sure I want to screw the things up one more time again :)
<bluestorm_>
:p
malc_ has joined #ocaml
<ygrek>
on windows it is still some sort of shaman knowledge for me
eroyf has joined #ocaml
mnemonic has joined #ocaml
eroyf has quit [Remote closed the connection]
eroyf has joined #ocaml
eroyf has quit [Client Quit]
ygrek has quit [Remote closed the connection]
_JusSx_ has joined #ocaml
<tehdeuce>
Which is preferable, using ocamlbuild or omake?
<malc_>
by whom?
<tehdeuce>
What do you mean?
<pango>
do you always answer to questions thru questions ? :)
danly has joined #ocaml
<tehdeuce>
heh. Sorry if the question was a bit unclear. I'm fairly new to ocaml, and I'm wondering which would fit better for small-ish projects I'm doing in ocaml. I have a bit of experience with omake, but if ocaml 3.10 comes with ocamlbuild, it might be a better idea to use it.
eroyf has joined #ocaml
bluestorm_ has quit ["Konversation terminated!"]
* pango
used neither, so can hardly comment
<tehdeuce>
What do you use?
<mbishop>
I just used regular makefiles, myself, course my projects were very simple heh
<tehdeuce>
I guess I'll just stick with omake. It's working for me, and it's pretty simple to use
benny_ has joined #ocaml
cpfr has quit [Read error: 110 (Connection timed out)]
tehdeuce has quit [Remote closed the connection]
G has joined #ocaml
benny has quit [Read error: 110 (Connection timed out)]
thorat has joined #ocaml
G_ has quit [Read error: 110 (Connection timed out)]
smimou has quit ["bli"]
malc_ has quit ["leaving"]
_JusSx_ has quit ["leaving"]
joshcryer has joined #ocaml
Mr_Awesome has joined #ocaml
<mbishop>
er, how do I use ocamlfind with more than one package? -package netclient gtk2 doesn't work, am I giving it the wrong name for gtk?
<mbishop>
ah never mind, I tried lablgtk2 at first, didn't work
<mbishop>
but it wanted a comma with no spaces
<mbishop>
Hmm, GTK errors about a null pointer, I think the problem is that I fetch an image using http_get from netclient, but then GMisc.image screws up when trying to create the object