gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.11.2 released
Amorphous has joined #ocaml
slash_ has quit [Quit: Lost terminal]
enthymeme has quit [Quit: rcirc on GNU Emacs 23.1.1]
segmond has quit [Ping timeout: 260 seconds]
sshc has quit [Quit: leaving]
elehack has quit [Quit: Goodbye...]
travisbrady has quit [Quit: travisbrady]
mfp has quit [Ping timeout: 245 seconds]
mfp has joined #ocaml
derdon has quit [Ping timeout: 240 seconds]
_unK has quit [Remote host closed the connection]
<thelema> wow, colorful
Hodapp has left #ocaml []
<thelema> but no show type at point...
jeddhaberstro has quit [Quit: jeddhaberstro]
enthymeme has joined #ocaml
neorab has joined #ocaml
<thelema> ah, it auto-detects the needed modules nd enables when they're there. if only it hadn't eaten my .emacs.d/ dir
sshc has joined #ocaml
sshc_ has joined #ocaml
sshc has quit [Ping timeout: 245 seconds]
valross has joined #ocaml
sshc_ has quit [Ping timeout: 260 seconds]
thrasibule has joined #ocaml
thrasibule has quit [Ping timeout: 276 seconds]
pad has quit [Remote host closed the connection]
sshc has joined #ocaml
sshc has quit [Read error: Connection reset by peer]
sshc has joined #ocaml
sshc has quit [Remote host closed the connection]
sshc has joined #ocaml
enthymeme has quit [Quit: rcirc on GNU Emacs 23.1.1]
ulfdoz has joined #ocaml
ttamttam has joined #ocaml
Shoggoth has joined #ocaml
ttamttam has quit [Quit: Leaving.]
schmx has quit [Ping timeout: 265 seconds]
schmx has joined #ocaml
ygrek_ has joined #ocaml
ulfdoz has quit [Ping timeout: 240 seconds]
M| has quit [Ping timeout: 252 seconds]
Submarine has joined #ocaml
M| has joined #ocaml
ttamttam has joined #ocaml
oc13 has joined #ocaml
spearalot has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
Submarine has quit [Quit: Leaving]
M| has quit [Ping timeout: 260 seconds]
M| has joined #ocaml
f[x] has joined #ocaml
munga has joined #ocaml
f[x] has quit [Ping timeout: 240 seconds]
f[x] has joined #ocaml
ftrvxmtrx has joined #ocaml
valross has quit [Quit: Ex-Chat]
f[x] has quit [Remote host closed the connection]
M| has quit [Read error: Operation timed out]
ygrek_ has quit [Ping timeout: 245 seconds]
munga_ has joined #ocaml
ygrek_ has joined #ocaml
Guest60603 has left #ocaml []
jcaose-60603 has joined #ocaml
f[x] has joined #ocaml
myu2 has joined #ocaml
myu2 has quit [Remote host closed the connection]
myu2 has joined #ocaml
myu2 has quit [Remote host closed the connection]
myu2 has joined #ocaml
M| has joined #ocaml
ikaros has joined #ocaml
Yoric has joined #ocaml
ygrek_ has quit [Ping timeout: 245 seconds]
ygrek has joined #ocaml
myu2_ has joined #ocaml
myu2 has quit [Ping timeout: 240 seconds]
munga_ has quit [Ping timeout: 252 seconds]
munga has quit [Ping timeout: 264 seconds]
Associat0r has joined #ocaml
avsm has joined #ocaml
Associat0r has quit [Quit: Associat0r]
albacker has joined #ocaml
myu2_ has quit [Remote host closed the connection]
myu2 has joined #ocaml
ygrek has quit [Ping timeout: 245 seconds]
sepp2k has joined #ocaml
oc13 has quit [Quit: oc13]
derdon has joined #ocaml
ftrvxmtrx has quit [Read error: Connection reset by peer]
Associat0r has joined #ocaml
myu2 has quit [Remote host closed the connection]
thrasibule has joined #ocaml
ftrvxmtrx has joined #ocaml
thrasibule has quit [Ping timeout: 258 seconds]
myu2 has joined #ocaml
segmond has joined #ocaml
joewilliams_away is now known as joewilliams
bzzbzz has joined #ocaml
<albacker> I'd like to use the functions found in /usr/local/lib/ocaml/3.10.2/netclient/http_client.mli but i don't see what should i `#require` or `open` in the toplevel? should i do open Http_client?
<orbitz> yes
<albacker> but it says Unbound module Http_client
<orbitz> you probably need to add it to your search path some how
<orbitz> do you have a cmo or cmx?
<orbitz> or cma
<albacker> http_client_mt.cmx
<albacker> it's found in the same directory as the mli file.
<orbitz> try ocaml /usr/local/lib/ocaml/3.10.2/netclient/http_client.cmx
<albacker> if you see the cmx file has an extra _mt before the extension. the http_client.cmx file doesn't exist in that directory.
myu2 has quit [Remote host closed the connection]
<orbitz> ohhh right my bad cmx doesnt' work liekt hat
<orbitz> you need cmo to use in top level i think
<orbitz> sorry i haven't used ocaml in a little
<mehdid> orbitz: see http://tinyurl.com/3ynkvqw (the META file for netclient)
<mehdid> you have to put all what's listed for "mt,byte" (I guess)
<albacker> mehdid, in fact it's me asking for help :)
myu2 has joined #ocaml
<mehdid> oups... sorry :)
spearalot has quit [Quit: Computer has gone to sleep]
<mehdid> albacker: it should be easier for you to use ocamlfind
<mehdid> there is no black magic behind... just invocation with what's written in the META file
<albacker> look what happends this is very weird http://pastebin.org/279007
<albacker> once i'm on that directory it works, otherwise it doesn't.
<mehdid> yeah... but can you use any of its symbols?
<albacker> no
<mehdid> :)
<albacker> Unbound value http_get
<mehdid> you still have to load to cma (or cmo) to be able to access its symbols
spearalot has joined #ocaml
<albacker> i don't really understand how ocaml manages all its libraries :/ .
<mehdid> the standard library path is taken into account by default (/usr/local/lib/ocaml/3.10.2/)
<mehdid> if you have something outside (or even in a subdir), then you have to include it (-I$path)
<mehdid> that's to help to find what's needed
<mehdid> then, you have to tell which cmo (or cma) are you going to use
<mehdid> that's all
<mehdid> findlib helps to do that and manages dependencies. Its verbose mode shows the invoked command, which helps if you want to see what's doing behind the scenes.
<gildor> albacker:
<gildor> #use "topfind";;
<gildor> #require "netclient";;
<gildor> open Http_client;;
<mehdid> that's quite a black-magic for a beginner :)
<albacker> gildor, ok thankyou :)
<gildor> mehdid: you always begin by black magic
<gildor> then you understand
<mehdid> :)
<albacker> gildor, /usr/local/lib/ocaml/3.10.2/netclient/netclient.cma: loaded , this is the only .cma from that directory. I still can't use http_get for example.
<gildor> albacker: output should be http://pastebin.org/279045
<gildor> albacker: do you get something different ?
<mehdid> albacker: what about "Convenience.http_get"?
<albacker> mehdid, oh, that works.
<albacker> thanks gildor, mehdid, orbitz. And sory for disturbing.
<mehdid> see the interface of Http_client, you have a set of classes and a module at the end
<gildor> mehdid: I am fighting with my f... RecDesc lexer/parser with white space indentation (for OASIS)
<gildor> mehdid: have you a good tutorial to menhir/anything else that would simplify my lexer/parser
<mehdid> gildor: no, sorry
<gildor> or a bad tutorial ;-)
<mehdid> I can have a look at it if you tell me which files
* gildor try to find how to remove the op from my nick
<gildor> mehdid: http://darcs.ocamlcore.org/cgi-bin/darcsweb.cgi?r=oasis;a=headblob;f=/src/oasis/OASISRecDescParser.ml
<gildor> test
<mehdid> gildor: ok thanks, I'll have a look at it soon!
myu2 has quit [Remote host closed the connection]
<mehdid> gildor: actually, I though that you already managed to get rid of genlex somehow from oasis
<mehdid> that's why I completely forgot about it
<gildor> mehdid: no, it was working AFAIK
<gildor> mehdid: and then people start using it ;-)
<mehdid> but isn't the bug ticket concerning that issue closed?
<gildor> mehdid: to remove RecDesc parser ?
<gildor> no
myu2 has joined #ocaml
* mehdid shuts up
mehdid is now known as mehdi
mehdi is now known as mehdid
<gildor> mehdid: can I pay you a visit next Thursday to get back my switches?
<mehdid> yes, sure
<gildor> when ?
myu2 has quit [Remote host closed the connection]
<mehdid> as you like
<mehdid> gildor: just let me know when :)
avsm has quit [Quit: Leaving.]
ftrvxmtrx has quit [Quit: Leaving]
myu2 has joined #ocaml
myu2 has quit [Remote host closed the connection]
prince has joined #ocaml
schmx has quit [Ping timeout: 265 seconds]
schmx has joined #ocaml
schmx has quit [Changing host]
schmx has joined #ocaml
th5 has joined #ocaml
spearalot has quit [Quit: -arividerchi]
<hcarty> mrvn: Have you reported the a bug on Mantis related to your recent mailing list thread?
<hcarty> mrvn: I've run in to what seems to be the same bug. I can't offer any further suggestions, but I would like to track its progress if it's been reporte.
<hcarty> reported that is
<mrvn> hcarty: not yet. Still hoping someone might offer a suggestion why it actualy complains
avsm has joined #ocaml
ccasin has joined #ocaml
ikaros has quit [Quit: Leave the magic to Houdini]
wvd has joined #ocaml
<wvd> Are there any preferred recommendations when learning OCaml, and what are the best books?
myu2 has joined #ocaml
<derdon> wvd: the official tutorial, ocaml-tutorial.org, and the o'reilly book
<wvd> but would it be preffered to first learn a functional language such as Haskell?
<derdon> maybe we should put these links to the topic of this channel
<derdon> wvd: it doesn't matter
<wvd> Since I don't have any experience in functional languages so far.
<wvd> Ok
<thelema> wvd: ocaml is a functional language
<hcarty> wvd: Jason Hickey's book is very nice as well - http://www.cs.caltech.edu/courses/cs134/cs134b/book.pdf
<wvd> thelema: I know. But is it as lazy and pure as Haskell?
<wvd> I heard a lot of good things about OCaml, that it could compete with C and such
<wvd> hcarty, that's a 404?
<gildor> wvd: I think OCaml is easier than Haskell for a first functional language
<thelema> wvd: no, it's practical and straightforward (except when it isn't)
myu2 has quit [Ping timeout: 240 seconds]
<hcarty> wvd: Really? That's odd ... it works here
<wvd> hcarty, oh ok, maybe it's just my internet, thanks :)
<hcarty> wvd: It's worth grabbing. It should be the first result from a search on Google for "jason hickey ocaml"
sdschulz` has joined #ocaml
_unK has joined #ocaml
sdschulze has quit [Ping timeout: 276 seconds]
Shoggoth has quit [Read error: Connection reset by peer]
barismetin has joined #ocaml
<albacker> is there a way to get the decimal value of a character in ocaml?
<albacker> int_of_char,
<albacker> :)
<thelema> # Char.code 'a';;
<thelema> - : int = 97
oriba has joined #ocaml
<albacker> thelema, # Char.code 'ë';; gives me Syntax error
<albacker> is there a way to work with extended ascii characters/
<thelema> probably because your terminal is utf8
<thelema> thus that e isn't a single byte
<albacker> what should it be?
<thelema> # Char.code '\190';;
<thelema> - : int = 190
<adrien> - : string = "\195\171"
<thelema> if you can set your terminal to latin-1, that's the kind of input ocaml is expecting
<adrien> albacker: how do you plan to input your characters? terminal read from file... ?
<thelema> that said, I have no idea how to do that
<albacker> adrien, yes
<adrien> bah, I mean: terminal? read from file? something else?
<albacker> read from file
<adrien> well, as you saw, the value isn't always between 0 and 255, so first question is: do you have some kind of guarantee on your inputs?
<albacker> if i read from files, is it important the charset encoding of the terminal?
<thelema> if you're reading from a file, you're fine (depending on what you're trying to do), as you'll get that file's contents one byte at a time
<thelema> no, the terminal's charset doesn't matter, only the file's
<thelema> what do you want to do to the file?
<adrien> as thelema said, locale won't matter but I wanted to be sure you were prepared to handle unicode
<adrien> http://camomile.sourceforge.net/dochtml/index.html probably has the functions you'd want but as far as I'm concerned, I'm too tired to read the doc
<albacker> thelema, i'll have to find its hex value :)
<albacker> adrien, thanks
<thelema> then no problem. you won't find hex values for characters, though - only bytes
<adrien> albacker: where is your input from? web? yourself? what kind of control do you have over it?
<albacker> adrien, myself probably. but as i see i'll have to change the editors charset also, no?
<thelema> if you want accented characters to come out as a single byte, then yes
sepp2k has quit [Remote host closed the connection]
<adrien> ok, and considering murphy law, you better not assert anything about the encoding, camomile sounds here imho
<adrien> albacker: what do you plan to do after? I mean, why do you need the value?
<albacker> adrien, its just a script i wrote some times ago. i just figured out it doesn't work as it should for accented characters (it's a pastebin tool)
<albacker> adrien, http://eni.pr-ing.com/mlpaste.ml here is the source code.
barismetin has quit [Quit: Leaving...]
boscop_ has quit [Read error: Connection reset by peer]
_unK has quit [Remote host closed the connection]
ttamttam has quit [Quit: Leaving.]
sdschulze has joined #ocaml
boscop has joined #ocaml
<adrien> albacker: well, you need to handle the case where chars are stored on more than one byte anyway or you'll be bitten sooner or later (apparently sooner), and you probably don't need camomile
<adrien> but I'm pretty tired right now so I can't even read your code :-)
* adrien fells dead on the floor
<albacker> hehe, it's ok you don't have to read my code. anyways it's not that elegant..
<albacker> any hint on how to handle that case?
<albacker> this is the line that reads characters from the file : let cur = input_char inch in
<thelema> ah, you just want to hex encode anything that needs hex-encoding?
<adrien> albacker: so, what you need is change the encoding before sending it?
<thelema> %XX
<adrien> thelema put it better than me ;p
<albacker> thelema, well yes, but that brought more questions..
<thelema> you're hex-encoding everything but \r and \n?
<thelema> err, \t
<albacker> yes
<albacker> i couldn't see how to hex encode those.
<thelema> let asciivalue = Char.code ch in
sdschulze has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
<albacker> in fact at first i only placed %20 for ' ' and that was it, but later saw that i needed to do the same about '?' and '&' because the tended to fuck up the URL, so i thought.. i'll just hex everything so i won't have to think a lot :P
<thelema> there's a specific list of chars that are recommended to hex encode - in the URL RFC, IIRC
sdschulze has joined #ocaml
sdschulze has quit [Remote host closed the connection]
sdschulz` has quit [Remote host closed the connection]
<albacker> thelema, if you see in the gethex function at the end i have :
<albacker> with
<albacker> Not_found -> string_of_char ch
<albacker> so normally if the char is not there i'll just send a string containing that char. but in my case it wasn't working.
<thelema> ah, yes you do.
<albacker> eni@kira:~$ cat aaaaaa.txt
<albacker> ë
<albacker> eni@kira:~$ mlpaste aaaaaa.txt
<albacker> Location: http://pastebin.org/279652
<albacker> eni@kira:~$
<thelema> you must hex-encode anything outside printable us-ascii: The octets 80-FF hexadecimal are not used in US-ASCII, and the octets 00-1F and 7F hexadecimal represent control characters; these must be encoded.
<thelema> and it looks like it's prefixing % to the unknown character
<thelema> s/character/byte/
myu2 has joined #ocaml
<albacker> so normally if i have a file that contains the same char in latin-1 encoding it should work.. right?
<thelema> no, your current code is broken - it only encodes those characters you have in your string
<thelema> the symbols string
<albacker> yes, otherwise it doesn't encode them, it juse sends it plain (it should still work for characters..)
<thelema> let gethex ch = Printf.sprintf "%%%X%X" (Char.code ch / 16) (Char.code ch mod 16)
<thelema> your current code always prepends % to the characters it should send plain
sepp2k has joined #ocaml
<thelema> if you're going to hexencode everything...
<albacker> oh i see what you mean..
<albacker> thelema, f5 the page :)
<albacker> ok, it still doesn't work but defenitely looks better :P http://pastebin.org/279688
<thelema> your gethex is still wrong, as it only encodes what's in the string, and if you need to url-encode this data, you should do it correctly, and url-encode all control characters (including utf8)
<thelema> but it looks like the problem is now that pastebin doesn't expect UTF8 (or recognize it)
<thelema> I dunno what pastebin is expecting, or if you can set some flag in curl to tell pastebin that your data is UTF8
<albacker> yeah, maybe.. i'll see that. if i copy/paste the char inside the file in pastebin it will show correctly.
<thelema> because there's a ton of conversions going on - when you paste, and when you submit
<thelema> bah, even the source for pastebin is gpl, the download link doesn't go anywhere
segmond has quit [Ping timeout: 248 seconds]
museun has joined #ocaml
<albacker> what i thought doing was create a table like this http://www.asciitable.com/ , compare every char to chars of the table than once i find the char i was searching for convert it, but still im not sure if i can compare chars since not always the files will be in latin.
avsm has quit [Quit: Leaving.]
<albacker> there's a val set_encoding : t -> curlEncoding -> unit
joewilliams is now known as joewilliams_away
<albacker> but i don't think it's this one.
<albacker> i'll start writing everything in latex mode now. even accented characters \'e etc. :P
<thelema> albacker: the set_encoding might work. - try it.
<albacker> type curlEncoding =
<albacker> | CURL_ENCODING_NONE
<albacker> | CURL_ENCODING_DEFLATE
travisbrady has joined #ocaml
<thelema> nope, nevermind
myu2 has quit [Remote host closed the connection]
ttamttam has joined #ocaml
Yoric has quit [Quit: Yoric]
ztfw has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
ikaros has joined #ocaml
ulfdoz has joined #ocaml
ygrek has joined #ocaml
willb has joined #ocaml
ttamttam has quit [Quit: Leaving.]
iratsu has quit [Ping timeout: 240 seconds]
iratsu has joined #ocaml
Submarine_ has joined #ocaml
wvd has quit [Ping timeout: 260 seconds]
oriba has quit [Quit: Verlassend]
ztfw has joined #ocaml
enthymeme has joined #ocaml
_unK has joined #ocaml
ftrvxmtrx has joined #ocaml
joewilliams_away is now known as joewilliams
Submarine_ has quit [Ping timeout: 240 seconds]
ztfw has quit [Remote host closed the connection]
Submarine_ has joined #ocaml
Submarine_ has quit [Ping timeout: 276 seconds]
ulfdoz has quit [Ping timeout: 258 seconds]
ikaros has quit [Quit: Leave the magic to Houdini]
ygrek has quit [Ping timeout: 245 seconds]
fschwidom has joined #ocaml
ccasin has quit [Quit: Leaving]
pad has joined #ocaml
brendan has quit [Ping timeout: 258 seconds]
fraggle_ has quit [Remote host closed the connection]
derdon has quit [Ping timeout: 240 seconds]
somnium has quit [Remote host closed the connection]
brendan has joined #ocaml
brendan has quit [Read error: Operation timed out]
albacker has quit [Quit: .]
brendan has joined #ocaml
sepp2k1 has joined #ocaml
sepp2k has quit [Ping timeout: 276 seconds]
myu2 has joined #ocaml
iratsu has quit [Ping timeout: 248 seconds]
oriba has joined #ocaml
oriba has quit [Client Quit]
myu2 has quit [Remote host closed the connection]
thrasibule has joined #ocaml
rudi_s has quit [Quit: leaving]
rudi_s has joined #ocaml
boscop has quit []
thrasibule has quit [Ping timeout: 252 seconds]
kg4qxk has quit [Quit: So long, and thanks for all the fish!]
sepp2k1 has quit [Quit: Leaving.]
kg4qxk has joined #ocaml
Amorphous has quit [Ping timeout: 245 seconds]