__DL__ changed the topic of #ocaml to: OCaml 3.09.0 available! Archive of Caml Weekly News: http://sardes.inrialpes.fr/~aschmitt/cwn/ | A free book: http://cristal.inria.fr/~remy/cours/appsem/ | Mailing List: http://caml.inria.fr/bin/wilma/caml-list/ | Cookbook: http://pleac.sourceforge.net/
<mlh_> phase of the moon
<Raziel> or ambiental noise
premchai21 has joined #ocaml
Bigbang is now known as Bigb[a]ng
chs_ has quit []
premchai21 has quit ["Hey! Where'd my controlling terminal go?"]
pango_ has joined #ocaml
pango has quit [Read error: 110 (Connection timed out)]
exa has quit [Read error: 110 (Connection timed out)]
threeve has quit []
vezenchio has joined #ocaml
mlh_ has quit [Client Quit]
pango_ has quit [Remote closed the connection]
smimou has joined #ocaml
pango has joined #ocaml
Snark has joined #ocaml
albertelegance has quit [Read error: 104 (Connection reset by peer)]
albertelegance has joined #ocaml
albertelegance has quit [Read error: 104 (Connection reset by peer)]
Revision17 has joined #ocaml
revision17_ has quit [Read error: 110 (Connection timed out)]
albertelegance has joined #ocaml
mercurylala has joined #ocaml
albertelegance has quit [Read error: 104 (Connection reset by peer)]
exa has joined #ocaml
albertelegance has joined #ocaml
mercurylala has quit [Read error: 104 (Connection reset by peer)]
mercurylala has joined #ocaml
mercurylulu has joined #ocaml
albertelegance has quit [Connection reset by peer]
mercurylala has quit [Read error: 104 (Connection reset by peer)]
Bigb[a]ng is now known as Bigbang
mercurylulu has quit [Read error: 104 (Connection reset by peer)]
albertelegance has joined #ocaml
albertelegance has quit [Read error: 104 (Connection reset by peer)]
kubano has quit [Remote closed the connection]
kubano has joined #ocaml
Bigbang is now known as Bigb[a]ng
Bigb[a]ng is now known as Bigbang
clear_doubt has joined #ocaml
clear_doubt has quit []
m3ga has joined #ocaml
m3ga has quit ["disappearing into the sunset"]
ramkrsna has joined #ocaml
batdog is now known as batdog|gone
batdog|gone is now known as batdog
khaladan has quit []
pango has quit ["brb"]
mrsolo has joined #ocaml
ramkrsna has quit [Read error: 110 (Connection timed out)]
pango has joined #ocaml
vodka-goo has joined #ocaml
quamaretto has joined #ocaml
Submarine has joined #ocaml
Submarine has left #ocaml []
Tachyon76 has joined #ocaml
mrsolo has quit [Read error: 104 (Connection reset by peer)]
vodka-goo has quit []
Snark has quit ["Parti"]
vodka-goo has joined #ocaml
albertelegance has joined #ocaml
pango has quit [Read error: 113 (No route to host)]
pango has joined #ocaml
Tachyon76 has quit [Read error: 110 (Connection timed out)]
lindi- has joined #ocaml
vodka-goo has quit ["X"]
vodka-goo has joined #ocaml
mlh_ has joined #ocaml
m3ga has joined #ocaml
vezenchio has quit ["http://www.nanowrimo.org/"]
m3ga has quit [Client Quit]
<dylan> Is there a nicer way of allocating caml lists in C than building cons cells?
OtherAlfie has joined #ocaml
quamaretto has quit ["Chatzilla 0.9.68.5 [Firefox 1.0.7/20050915]"]
descender has joined #ocaml
nocte____ has joined #ocaml
nocte____ has left #ocaml []
qknight has joined #ocaml
<qknight> hey
<qknight> let listchen = ["hallo", "asdf"];;
<qknight> how can i print the first entry?
<qknight> hallo
<qknight> it's a list of strings as i suppose
<smimou> print_string (List.fst listchen);;
<mauke> haha, no
smimou has quit ["bli"]
<mauke> val listchen : (string * string) list = [("hallo", "asdf")]
<mauke> print_string (List.hd ["hallo"; "asdf"]);;
<qknight> thanks
exa has quit [Remote closed the connection]
<qknight> mauke: val listchen : (string * string) list = [("hallo", "asdf")] does not work
<qknight> Syntax error
<pango> qknight: it's compiler output, not input
<pango> qknight: that's what gets displayed if you type your
<pango> <qknight> let listchen = ["hallo", "asdf"];;
<pango> btw it's a list is string * string tuples, did you mean a list of strings ?
<qknight> oh of course
<qknight> pango: i meant a list of strings
<qknight> as
<pango> so use ; instead of ,
<qknight> ["hallo"; "asdf"; [asdf]]
<qknight> so [0] = hallo; [1] = asdf ...
<qknight> tnx
Demitar has joined #ocaml
<pango> qknight: your first example won't work (even after adding quotes, as in ["hallo"; "asdf"; ["asdf"]])
<pango> qknight: all the elements of a list must have the same type, here some elements are strings while another is a string list
<pango> qknight: and second, lists don't efficiently allow random access, so [0], [1], etc. are at best a notation. If you want random access, see arrays, or other data types
<qknight> pango: i know that lists don't allow random access
<qknight> that was just pseudo-code
<qknight> thanks anyway
<pango> fine then
Raziel has quit ["Yo soy goma. Tú eres cola."]
<qknight> let listchen = ["1: Das weisse Haus"; "2: Pentagon"; "3: Atta"; "4: Muha"];;
<qknight> let rec listcat l =
<qknight> match l with
<qknight> | [e] -> print_string e;
<qknight> | [] -> invalid_arg "list is empty"
<qknight> | h :: q -> print_string h; print_string "\n"; let qq = listcat q in print_string "";;
<qknight> what can i do to remove the >>in print_string ""<<?
<qknight> i don't need it but somehow i always need the >>in<< word or i get compile errors
<Bigbang> | h :: q -> print_string h; print_string "\n"; listcat q;;
<Bigbang> ?
<qknight> oh
<qknight> of course
<qknight> sorry
<qknight> Bigbang: ;-)
<Bigbang> :)
<pango> for completeness, you could have used String.concat "\n" l
<Revision17> Is there a name for a data structure that's like an associative array (map, hashtbl type deal) except both ways?
threeve has joined #ocaml
<Revision17> hmm, I guess I could just tie to hashtbls together
<Revision17> eh, I guess the dataset I'll be using is small enough that a linked list of records should do fine