dark_light changed the topic of #ocaml to: OCaml 3.09.2 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/
<zmdkrbou> youknow365: you have to give unix.cma to ocamlc
<zmdkrbou> (ocamlc unix.cma blabla)
<youknow365> zmdkrbou: whats the syntax error though
<youknow365> i keep getitng a syntax error
<zmdkrbou> what is the error message ?
<zmdkrbou> undefined blabla Unix ?
<zmdkrbou> if you don't use "open Unix" then you have to write Unix.socket Unix.PF_INET Unix.SOCK_STREAM 0
<youknow365> File "tcp.ml", line 12, characters 47-49:
<youknow365> zmdkrbou: http://phpfi.com/139788
<youknow365> all im trying to do is send that message to that port on my computer
<youknow365> zmdkrbou: any ideas ?
<zmdkrbou> the error message is " Error while linking tcp.cmo: Reference to undefined global `Unix'" ?
<zmdkrbou> or what is it if it's a syntax error ?
<zmdkrbou> ahah, "Syntax error"
* zmdkrbou slaps ocaml
Nanoman has quit ["Leaving"]
<zmdkrbou> seems to be a ";" problem
<zmdkrbou> anyway, ";" sucks
<zmdkrbou> you don't need it
jcreigh has joined #ocaml
EsotericMoniker has quit [Connection reset by peer]
jcreigh has quit ["Cuius rei demonstrationem mirabilem sane detexi. Hanc marginis exiguitas non caperet."]
malc_ has joined #ocaml
joshcryer has joined #ocaml
<youknow365> zmdkrbou: what does ; do ?
<zmdkrbou> "blabla ; something" is used strictly equivalent to "let _ = blabla in something"
<zmdkrbou> (-used)
<youknow365> so whats the problem with my above problem?
<youknow365> zmdkrbou: ^^
<youknow365> line 12 was the problem
<youknow365> let client_sock = socket PF_INET SOCK_STREAM 0 in
<zmdkrbou> yep, i don't understand the error (but i never use ";" so i'm not used to this kind of pb)
<Dylan> ; is closer to let () = ... in ..., no?
<Dylan> (petty detail)
<zmdkrbou> nope, i don't think so
<zmdkrbou> i don't exactly remember but i think in "x ; y" x doesn't have to be of type unit
<zmdkrbou> oh, yes it does
<zmdkrbou> so yes.
<youknow365> still lost
<youknow365> line 12 is the problem
<youknow365> the only problem
malc_ has quit ["leaving"]
<zmdkrbou> nope, it's not
<youknow365> thats what its telling me
<youknow365> could you please show me what i got ot do to fix this ?
<youknow365> zmdkrbou: ^^
<zmdkrbou> i don't know precisely, this imperative style is too much for me
<zmdkrbou> but i think it's a problem of using ";" (and why not in the beginning ?)
mwc has joined #ocaml
<youknow365> oh gosh im lost
<youknow365> do you know "ocaml" well ?
<youknow365> zmdkrbou: ^^
<zmdkrbou> meaning ?
mwc has quit ["Leaving"]
piggybox has quit [Read error: 104 (Connection reset by peer)]
<youknow365> zmdkrbou: theres a problem and i dont know what the solution is
<zmdkrbou> yes i see that :)
<youknow365> zmdkrbou: and all i want is is for it to be fixed
<youknow365> zmdkrbou: this is drivng me crazy this small tcp client been working on ir ffor like 4 hours
<youknow365> and its just a small problem
scriptdevil has joined #ocaml
<scriptdevil> how different is OCAML? i tried reading some code.... was reallly confused
<zmdkrbou> different from what ?
<zmdkrbou> youknow365: replace each "expression ;" by "let _ = expression"
<youknow365> so add quotes around all the expressions ?
<zmdkrbou> nono, no quotes
<zmdkrbou> remove the ";"
<zmdkrbou> and use "let _ ="
<scriptdevil> it is different from C style languages... what is it based on?
<zmdkrbou> on lambda-calculus
<scriptdevil> zmdkrbou: r u serious?
<zmdkrbou> yes, of course
<scriptdevil> :)
<youknow365> zmdkrbou: http://phpfi.com/139806
<youknow365> like that ??
<zmdkrbou> all functional languages comes from lambda-calculus
<zmdkrbou> (-s)
<scriptdevil> ok... i saw in wikipedia that ocaml was created in 1980s.. is it still worth learning? no offense meant
<zmdkrbou> yes it is
<youknow365> c was created in the 50's
<zmdkrbou> it's a recent language
<zmdkrbou> there was caml and camllight
<zmdkrbou> ocaml doesn't have more than 10 years or so
<zmdkrbou> youknow365: nope
<scriptdevil> zmdkrbou: ok.. i'll try my best to understand the syntax.. u see this let seems outta place... but it will soon look normal once i start reading more code i expect
<scriptdevil> c is a 70s lang
<scriptdevil> c++ 80s
<scriptdevil> python D 90s
<scriptdevil> is OCaml a good first functional language or shoulf i go in for scheme and common lisp before this?
<zmdkrbou> youknow365: http://phpfi.com/139808
<youknow365> Haskell
<scriptdevil> k
<zmdkrbou> scriptdevil: the base syntax is quite simple once you understand that it's just about functions
<zmdkrbou> (but having a base knowledge of lambda-calculus is better to understand functional programming)
<scriptdevil> OK... project OCAML
<youknow365> File "tcp.ml", line 15, characters 34-40:
<youknow365> This expression has type string but is here used with type Unix.host_entry
<scriptdevil> thanks all those in this channel
<zmdkrbou> now you have a nice type error :)
<scriptdevil> i will be back if i need help.. bye
scriptdevil has left #ocaml []
<youknow365> zmdkrbou: stilll makes me mad :P
<youknow365> zmdkrbou: what do i gotta do now ?
<zmdkrbou> look at your types
<zmdkrbou> let hentry = gethostname () in ...
<zmdkrbou> this makes hentry a string
<youknow365> connect client_sock (ADDR_INET (hentry.h_addr_list.(0), 4550))
<youknow365> oooo
<youknow365> so what do i have to do
<youknow365> is it bad being a string ?
<zmdkrbou> if you need something of type host_entry, yes .....
<youknow365> zmdkrbou: man im a n00b help me out ......documentation is VERY limited on ocaml
<youknow365> zmdkrbou: i almost have it
<youknow365> its like theres a syntax error at the bottom of all my files
slipstream has quit [Read error: 104 (Connection reset by peer)]
slipstream has joined #ocaml
shekmalhen has joined #ocaml
ramkrsna has quit [Connection timed out]
ramkrsna has joined #ocaml
_jol_ has joined #ocaml
Snark has joined #ocaml
_jol_ has quit ["leaving"]
shekmalhen has quit ["sti"]
tristram has joined #ocaml
EsotericMoniker has joined #ocaml
EsotericMoniker has left #ocaml []
finelemon has quit [Read error: 110 (Connection timed out)]
<datrus> \quit
datrus has quit ["leaving"]
_jol_ has joined #ocaml
<falconair> i'm having some trouble understanding how to use ocamlyacc and ocamllex , does it make sense to read C based tutorials for yacc and lex to better understand them? (are they similar enough in concepts and syntax (other than C/ocaml specific stuff)?
Nanomon has joined #ocaml
joshcryer has quit [Client Quit]
_jol_ has quit ["leaving"]
mikeX has joined #ocaml
Nanomon has quit ["Leaving"]
mikeX has quit ["leaving"]
<flux__> yes
clog_ has joined #ocaml
_jol_ has quit ["leaving"]
clog has joined #ocaml
ookk has joined #ocaml
<mwc> Well, FP says that you should focus on how things are calculated, from a hihg level mathematic level
<mwc> as oppossed to worrying about running around computing values and storing them in memory cells.
<mwc> you shouldn't really need ;; ever
<mwc> I have >1000 lines of Ocaml in this compiler project so far, and not a single ;;
<youknow365> honestly i really didnt do ANY ocaml i jus jumped right into it with this
<youknow365> i looked at a hello world and that was it lol
<shekmalhen> ish
<youknow365> i need to do a inductory tutorial
<youknow365> casue i cant see syntax errors
<shekmalhen> caml is not the kind of language that you simply jump in like that
finelemon has joined #ocaml
Snark has quit ["Leaving"]
mwc has quit [Remote closed the connection]
<youknow365> i told her to call me santa claus ...........cause i will leave her with a white chin
<shekmalhen> ?
<youknow365> lol
<shekmalhen> how old are you, youknow365?
<ookk> is there any way to type in Num constants in a program without using the Int constructor?
<ookk> then you cant even put in arbitrary length integer constants because you cant you got to transform a normal int constat to the Num with Int
descender has quit [Remote closed the connection]
descender has joined #ocaml
<ookk> how am i supposed to type a numberic constant into my code that is larger then the standard int?
<youknow365> shekmalhen: its a damn rap line man ......holy crap
<shekmalhen> :/
<youknow365> shekmalhen: its a joke man .......holy crap
<youknow365> shekmalhen: and im 18 if you really care
Jonex has quit [Read error: 104 (Connection reset by peer)]