gl changed the topic of #ocaml to: OCaml 3.07 ! -- Archive of Caml Weekly News: http://pauillac.inria.fr/~aschmitt/cwn , A tutorial: http://merjis.com/richj/computers/ocaml/tutorial/ , A free book: http://cristal.inria.fr/~remy/cours/appsem, Mailing List (best ml ever for any computer language): http://caml.inria.fr/bin/wilma/caml-list | http://icfpcontest.org/ !!
GreyLensman has joined #ocaml
monotonom has quit ["Don't talk to those who talk to themselves."]
buggs|afk has joined #ocaml
buggs^z has quit [Read error: 110 (Connection timed out)]
cjohnson has quit [Remote closed the connection]
brion has joined #ocaml
Connelly has joined #ocaml
<Connelly> Has anyone installed OCaml on HP-UX?
<Connelly> I get an error when trying to build 3.07 from source
<Connelly> ../../../ocamlcomp.sh odyl.cma odyl.cmo -o odyl
<Connelly> Bad directory
<brion> hm, silence :(
<Connelly> whoa
<Connelly> you're an OCaml user? :)
<brion> no i just drop in sometimes :)
<brion> ocaml frightens me, but we've got that one program so i fiddle sometimes with it :)
<Connelly> I guess it's nice for hardcore hackers
<Connelly> Has anyone installed OCaml from source, and gotten a Bad Directory error?
<Smerdyakov> No
GreyLensman has quit ["Leaving"]
vezenchio has quit ["--- reality is that which, when you stop believing in it, doesn't go away ---"]
Connelly has quit []
simon- has joined #ocaml
Herrchen has quit [calvino.freenode.net irc.freenode.net]
Tram has quit [calvino.freenode.net irc.freenode.net]
Herrchen has joined #ocaml
Tram has joined #ocaml
Herrchen has quit [Read error: 60 (Operation timed out)]
tvainika has left #ocaml []
Smerdy has joined #ocaml
Smerdyakov has quit [Read error: 110 (Connection timed out)]
Smerdy has quit [Remote closed the connection]
Smerdyakov has joined #ocaml
anyone has joined #ocaml
Vekza has joined #ocaml
Herrchen has joined #ocaml
Snark has joined #ocaml
<Snark> slt
brion has left #ocaml []
anyone has quit ["To understand recursion, you must first understand recursion."]
bk__ has joined #ocaml
bk__ is now known as bk_
Snark has quit [Read error: 104 (Connection reset by peer)]
Snark has joined #ocaml
gim has joined #ocaml
noss has joined #ocaml
smimou has joined #ocaml
mrsolo has joined #ocaml
mrsolo_ has joined #ocaml
mrsolo has quit [Read error: 104 (Connection reset by peer)]
mrsolo_ has quit ["Leaving"]
nyah has joined #ocaml
tea has quit [Read error: 54 (Connection reset by peer)]
<nyah> is anyone available to take some (probably very basic) questions related to compilation ?
<Snark> nyah: on irc, you generally begin by saying "hi", then ask your question, then wait all day long for an answer :-)
<nyah> i've read thru the manual, have skimmed jason hickey's book, etc. but am still a bit lost (this is my first effort at learning a compiled language since fortran77 back in uni)
<nyah> good point snark
<nyah> :)
<nyah> what's the difference between ocamlc and ocamlopt?
<nyah> why would i use ocamlopt?
<nyah> the manual refers to ocamlc as "batch compilation" and ocamlopt as "native code compilation"
<nyah> Ii'm on win32, btw)
<nyah> i'm on on win32, rather
<Tram> nyah: do you understand how java works with the virtual machine (compared to C)?
<nyah> i'm not well-acquainted with java but i understand that u need to have a vm to run java progs
<nyah> do you mean that the final products compiled w/ocamlc can only run on machines which have ocaml installed?
<Tram> yes, with ocamlc, it will run on a virtual machine
<Tram> whereas using ocamlopt, it will be optimised for your config (like is C/pascal/...)
<nyah> could i distribute the product of ocamlopt compilation to another win32 person who does not have ocaml installed?
<nyah> (and have it work)
<Tram> nyah yes
<nyah> ah, thanks guys ... getting quite a bit clearer
<nyah> in hickey's book, the he shows an ocamlc compilation in 3 steps
<nyah> ocamlc -c x.mli
<nyah> for a module that he's using with his program
<nyah> to produce x.cmi
<nyah> then ocamlc -c x.ml
<nyah> to produce .cmo files
<nyah> then ocamlc -o test x.cmo test.cmo
<nyah> are all compilations w/ocamlc going to be 3 steps like that?
<nyah> (i omitted compilation on test.ml in the 2nd step above, sorry)
<_fab> nyah: no, for small programs with only one module you can compile and link in one step like "ocamlopt -o test test.ml"
vezenchio has joined #ocaml
<nyah> thanQ - that's what i thought ... i did a very simple 2 line prog in one step and it worked so i wondered
<_fab> hhm, acutally you can do this with bigger programs too, but you should use a makefile then
<nyah> another thing ... in some cases, it seems that explicitly specifying a library that ur using in the compilation is necessary but not in others
<nyah> my simple 2 line prog used Printf but i didn't need to specify it in the compilation step
<nyah> but when i tried to compile a short prog that used the Unix library, i got the undefined global error message when i tried to compile
<nyah> and had to specify it in order to get it to go
<nyah> why is that?
<_fab> Printf is in the stdlib, which is always linked, while Unix and for example String is not
<nyah> how can one know whether a lib is in the stdlib or no?t
<nyah> it's not indicated on the index of modules at http://caml.inria.fr/ocaml/htmlman/libref/index_modules.html
<nyah> no?t = not, sorry :)
<vegai> nyah: by undefined global error messages =)
<nyah> lol
<_fab> :)
<nyah> ok, fair enough :)
<nyah> thanks a lot - i'd been pretty confused until i popped on here
<nyah> i'm really grateful
<Tram> :)
noss has quit [Read error: 101 (Network is unreachable)]
Godeke has quit [Read error: 110 (Connection timed out)]
tea has joined #ocaml
Godeke has joined #ocaml
Godeke has quit [Client Quit]
cjohnson has joined #ocaml
Lemmih has joined #ocaml
<_fab> how can i write a negative float constant? (other than "(-.1.0)" )
<mellum> -1.0
<_fab> hhm
<_fab> strange
<mellum> Or -1., if you're desperate for saving bytes
<_fab> # string_of_float -1.0;;
<_fab> This expression has type float -> string but is here used with type int
<gl> try (-. 1.0)
<gl> (-) has type int -> int -> int
<_fab> just (-1.0) works, too
<_fab> but i have no idea why...
<gl> - is a binary operator
<_fab> either - is an unary operator for in or a prefix for a negative float constant
<gl> (-1.0) is the negate
<_fab> yes, but its not "(-) 1.0"
<gl> string_of_float - 1.0;; is equivalent to (-) string_of_float 1.0;;
<gl> that's why you have "This expression has type float -> string but is here used with type int"
<_fab> ah, ok
<_fab> but, why does "(-1.0)" work?
<gl> () forces evaluation
<gl> toto (-1) is not toto - 1
<gl> the first one is the function toto with one argument: -1
<gl> the second one the the substraction
<_fab> yes, but what is "-" in that context? its not the unary operator for integer
<_fab> so what is forced?
<gl> I don't understand you
<_fab> it works, but i think it is strange that "-" works for float and for ints
<_fab> (- 1.0) is float and (- 1) is int, but all other operators are either int or float
<gl> fab it's like >, <, =, etc, I guess
<_fab> yes
<_fab> ok, thank you
farizeo has quit [Client Quit]
fariseo has joined #ocaml
Shammah has joined #ocaml
Godeke has joined #ocaml
Pilot0541 has joined #ocaml
<Pilot0541> hi everyone
<Pilot0541> is there something like static non-constant fields available for ocaml classes?
karryall has joined #ocaml
<Snark> Pilot0541: you mean "shared by all instance and mutable" ?
<Snark> Pilot0541: you mean "shared by all instanceS and mutable" ?
<Pilot0541> exactly
<Snark> I don't know the answer but I find the question interesting :-)
<karryall> _fab: want some more info on the "-" thing with ints and floats ?
<_fab> karryall: yes ;)
<karryall> - can be a binary operator for ints
<karryall> but it's also part of the syntax for literal ints and floats
<karryall> when you write string_of_float - 1.
<_fab> then its the integer binary op?
<karryall> it is parsed os binary operator because it appears in infix posotion
<karryall> but with (- 1.) is is parsed as a single float value
<karryall> now, there are unary operators for negation
<karryall> it's ~- and ~-. for floats
<karryall> they are prefix
<karryall> so you can write string_of_float ~-. 1. ;;
<_fab> ah, but why does (- 1.) work then?
<karryall> because the - appears in a prefix position so it's not the binary operator
noss has joined #ocaml
<_fab> so (- 1.) is not the unaray op "-" applied to "1." but a float constant?
<karryall> yes
<karryall> I think
<Pilot0541> definition:
<Pilot0541> float-literal ::= [-] (0...9) { 0...9| _ } [. { 0...9| _ }] [(e| E) [+| -] (0...9) { 0...9| _ }]
<_fab> hhm, what file in the ocaml sources is the lexer for the language?
<karryall> parsing/lexer.mll
<_fab> but this isn't the one you pastet?
<_fab> err, the one Pilot0541 pastet
<Pilot0541> i copied it from the manual
<_fab> in parsing/lexer.mll floats are without leading sign
<_fab> let float_literal =
<_fab> ['0'-'9'] ['0'-'9' '_']*
<_fab> ('.' ['0'-'9' '_']* )?
<_fab> (['e' 'E'] ['+' '-']? ['0'-'9'] ['0'-'9' '_']*)?
<_fab> strange
<karryall> the minux is in the parser
<karryall> parsing/parser.mly
<karryall> constant:
<karryall> INT { Const_int $1 }
<karryall> | FLOAT { Const_float $1 }
<karryall> and
<karryall> signed_constant:
<karryall> constant { $1 }
<karryall> | MINUS FLOAT { Const_float("-" ^ $2) }
<_fab> ok, that explains why space is allowed between sign and constant
<_fab> do you see any advantage of this aproach over adding signs in the lexer?
<karryall> dunno, I'm no grammar guru
<Pilot0541> strange: toplevel permits any amout of whitespace characters between the sign and the value, which does not comply with the definition
<_fab> yes, thats becase the sign is added in the parser... so any whitespace is allowed...
<Pilot0541> so the implementation is wrong... ;)
<_fab> :)
pattern has quit [Read error: 113 (No route to host)]
Shammah has quit [Read error: 110 (Connection timed out)]
skylan has quit [Read error: 54 (Connection reset by peer)]
noss has quit ["Leaving"]
skylan has joined #ocaml
reltuk has joined #ocaml
sundeep has joined #ocaml
sundeep has quit [Remote closed the connection]
sundeep has joined #ocaml
platypus has joined #ocaml
nyah has quit ["ChatZilla 0.9.52B [Mozilla rv:1.6/20040113]"]
Vekza has quit ["Leaving"]
Pilot0541 has quit ["Miranda IM! Smaller, Faster, Easier. http://miranda-im.org"]
nyah has joined #ocaml
<nyah> are signature (.mli) files necessary? if you have externally visible types or methods, do you have to have a .mli?
Lemmih has quit [Remote closed the connection]
<sundeep> can someone lend a nice vimrc for editing ocaml code?
Dybbuk has quit [Remote closed the connection]
Dybbuk has joined #ocaml
<karryall> nyah: no it's not necessary
karryall has quit ["go"]
<nyah> thanQ karyall !
<nyah> one more q - are .mli files always handwritten? does the compiler every generate a nonempty .mli file for me?
<_fab> nyah: you can use "ocamlc -i foo.ml > foo.mli" to generate a interface file, but you should edit it afterwards to only export the symbols you need
<nyah> ah thanks fab !
nyah has quit ["ChatZilla 0.9.52B [Mozilla rv:1.6/20040113]"]
<async> sundeep: emacs is quite condusive to ocaml development, because you can launch top-levels from within the editor
<async> i'd definately give it a try
CiscoKid has joined #ocaml
<sundeep> bk, thanks! i'll try that
<sundeep> async, i know emacs has that (but i have to learn emacs first;)
<bk_> emacs with tuareg mode is better, yes
<Snark> tuareg mode!?
<Snark> how does one enable this?
<Snark> I seem to have installed it, but M-x tu<tab> doesn't show it
<Snark> (I have a caml-mode, but it doesn't seem nice)
<Snark> (no coloration)
<bk_> M-x tuareg-mode
<bk_> work for me at least
<gl> I think albert cohen is the man who is the fastest speaker in tha world
<Snark> doesn't work here...
<bk_> then perhaps you haven't installed it properly
<gl> (setq auto-mode-alist (cons '("\\.ml\\w?" . tuareg-mode) auto-mode-alist))
<gl> (autoload 'tuareg-mode "tuareg" "Major mode for editing Caml code" t)
<gl> (autoload 'camldebug "camldebug" "Run the Caml debugger" t)
<gl> paste this in your .emacs
<Snark> gl: if meta-x tuareg-mode says "no match", then I guess that won't work?
<bk_> probably not
* Snark dives into emacs' doc
Axioplase has joined #ocaml
<Axioplase> Chat Lu!
<Axioplase> (hi)
<bk_> hi
CiscoKid has quit ["Leaving"]
mattam_ has joined #ocaml
mattam has quit [Nick collision from services.]
mattam_ is now known as mattam
CiscoKid has joined #ocaml
CiscoKid has quit [Remote closed the connection]
CiscoKid has joined #ocaml
<bk_> why would i deliberately want to use polymorphic variant types instead of fixed types ?
<Axioplase> is there something *fast* to copy an array to screen ( else than Graphics.make_image (Graphics.create_image array) x y) ?)
maihem has joined #ocaml
reltuk has left #ocaml []
chimikal has joined #ocaml
<sundeep> bk, i am not sure if i understood what you mean, but a list is an example of a data structure which doesn't need to know the type of its elements
<bk_> have you read section 4.2 of the manual about polymorphic variants ?
<_fab> bk_: for example if you want to define a function which only accepts a subset of variants
<sundeep> i guess not, *time to shut up:)*
Demitar has joined #ocaml
<_fab> bk_: or to map the gtk type system to ocaml ;)
<bk_> yes, i wasn't explicitly thinking about gtk tho, but you're right, its used there, too
<Snark> yes!
<Snark> I should have begun by reading /usr/share/doc/tuareg-mode/README.Debian
<Snark> oh, the wonderful colors!
<bk_> tuaregs indentation is also very nice for readybility
<Demitar> bk_, I tend to modify parts of it to avoid too much indentation.
<bk_> oic
<Snark> how do I ask it to indent the full buffer?
<Demitar> The most annoying thing being indenting two spaces after "in".
<Snark> Demitar: this one doesn't look bad
<bk_> ESC C-\ indent-region
<Snark> bk_: that didn't seem to do the trick...
<bk_> oh
<bk_> have you marked a region ?
<Snark> C-space
<bk_> ya
<Snark> then go to end of the buffer
<Snark> it seems it has little problems with empty lines
<Snark> if I hit tab on an empty lines, it adds spaces there
<bk_> it does
<Snark> ah
<Snark> I had a let something = whatever
<Snark> without ";;"
<Snark> (correct since the next line has begins with "let")
<Snark> that was that that made tuareg try to add spaced
<Snark> that was that that made tuareg try to add spaces
<bk_> he ok
<_fab> if i read less bytes from a Unix.file_descr than available, a Unix.select afterwards, won't put it into the "ready to read" list. is this a ocaml bug or does unix act the same way?
mads has joined #ocaml
<mads> How do I close ocaml...?
<Axioplase> (indenting: gg=G with vim :p)
<mads> I can't.. =(
<Axioplase> mads: exit 0 ?
<mads> thanks :D
<Demitar> mad ^D probably does what you want too.
<Axioplase> is it possible to match a ^D as a char? or should i try for fun ?
<Demitar> Well eof is a valid character in a file sometimes used to trick text viewers from ignoring non-text portions of binary files. But it might be caught by the shell though.
<Axioplase> would i gain speed if i use double buffering with a simple Graphics.draw_image ?
<Axioplase> Demitar: well, it complains little bit, but it works :)
<Demitar> Axioplase, double buffering makes things slower, it avoids flickering nothing else.
<Axioplase> does it?
<Demitar> What happends it that you draw everything into an intermediary buffer and then write all that data to screen at once rather than doing everything directly on the screen.
<Demitar> (There might be some corner cases where writing stuff to the hardware memory is slower.)
<Axioplase> Since i don't know how to create and write in a new buffer, i'm using an array :/
teratorn has joined #ocaml
bk_ has quit ["I'll be back"]
bk_ has joined #ocaml
Phreaze has joined #ocaml
mads has quit [Read error: 110 (Connection timed out)]
noss has joined #ocaml
monotonom has joined #ocaml
Demitar has quit ["Bubbles..."]
Axioplase has quit [Read error: 110 (Connection timed out)]
Snark has quit [Read error: 60 (Operation timed out)]
Phreaze is now known as Axioplase
Snark has joined #ocaml
<Axioplase> argh.. can think of a wave scroller with recursion :)
<Snark> good night
Snark has left #ocaml []
maihem has quit ["Client exiting"]
Dybbuk has quit [Remote closed the connection]
Dybbuk has joined #ocaml
Dybbuk has quit [Remote closed the connection]
Dybbuk has joined #ocaml
Shammah has joined #ocaml
vezenchio has quit ["--- reality is that which, when you stop believing in it, doesn't go away ---"]
Dybbuk has quit [Remote closed the connection]
Dybbuk has joined #ocaml
chimikal has left #ocaml []
Dybbuk has quit [Remote closed the connection]
Dybbuk has joined #ocaml
Dybbuk has quit [Remote closed the connection]
noss has quit ["Leaving"]
Dybbuk has joined #ocaml
gim has quit []
buggs^z has joined #ocaml
buggs|afk has quit [Read error: 104 (Connection reset by peer)]
Dybbuk has quit [Remote closed the connection]
Dybbuk has joined #ocaml
<Axioplase> ++
Axioplase has quit [Remote closed the connection]
smimou has quit ["?"]
cmeme has quit [Read error: 104 (Connection reset by peer)]
skylan has quit [calvino.freenode.net irc.freenode.net]
Tram has quit [calvino.freenode.net irc.freenode.net]
CiscoKid has quit [calvino.freenode.net irc.freenode.net]
sundeep has quit [calvino.freenode.net irc.freenode.net]
tea has quit [calvino.freenode.net irc.freenode.net]
Herrchen has quit [calvino.freenode.net irc.freenode.net]
JPL-Justin-away has quit [calvino.freenode.net irc.freenode.net]
shrimpx has quit [calvino.freenode.net irc.freenode.net]
rox has quit [calvino.freenode.net irc.freenode.net]
Shammah has quit [calvino.freenode.net irc.freenode.net]
Banana has quit [calvino.freenode.net irc.freenode.net]
Hipo has quit [calvino.freenode.net irc.freenode.net]
mellum has quit [calvino.freenode.net irc.freenode.net]
Hipo has joined #ocaml
skylan has joined #ocaml
Tram has joined #ocaml
bk_ has quit ["I'll be back"]
shrimpx has joined #ocaml
mellum has joined #ocaml
Shammah has joined #ocaml
CiscoKid has joined #ocaml
sundeep has joined #ocaml
JPL-Justin-away has joined #ocaml
tea has joined #ocaml
rox has joined #ocaml
cmeme has joined #ocaml
Shammah has quit [Read error: 60 (Operation timed out)]
Banana has joined #ocaml