systems changed the topic of #ocaml to: http://icfpcontest.cse.ogi.edu/ -- OCaml wins | http://www.ocaml.org/ | http://caml.inria.fr/oreilly-book/ | http://icfp2002.cs.brown.edu/ | SWIG now supports OCaml| Early releases of OCamlBDB and OCamlGettext are available | Caml Weekly news http://pauillac.inria.fr/~aschmitt/cwn/
polin8 has quit ["Lost terminal"]
polin8 has joined #ocaml
polin8 has quit [Client Quit]
polin8 has joined #ocaml
polin8 has quit [Client Quit]
polin8 has joined #ocaml
polin8 has quit [Client Quit]
polin8 has joined #ocaml
karryall has quit [Remote closed the connection]
systems has joined #ocaml
<lsr> vincenz_: I did use a type, but just a symbolic (not sure if that's correct terminology) type
<lsr> type scale = Farenheit | Celcius | Kelvin;;
<lsr> and then i used:
<lsr> let parse_scale2 s =
<lsr> match s with
<lsr> "F" | "f" -> Farenheit
<lsr> [...]
<Riastradh> match s with
<Riastradh> f where String.equal(f, "f") || ... -> Fahrenheit
<Riastradh> | c where ... -> Celsius
<Riastradh> | ...
<Riastradh> Er, 'where (String.equal f "f") || ... ->'
<Riastradh> Something like that.
<lsr> Why is that an improvement?
<Riastradh> match s with
<Riastradh> "F" | "f" -> Fahrenheit
<Riastradh> parses to:
<Riastradh> match s with
<Riastradh> "F"
<Riastradh> | "f" -> Fahrenheit
<Riastradh> and there's no -> for "F".
<Riastradh> Or did your thing work?
<lsr> yes, it did work
<Riastradh> Oh.
<Riastradh> Oops.
<Riastradh> OK, what was your question?
<lsr> and for what it's worth, i didn't just invent it :)
* Riastradh supposes he should ask that before trying to answer.
<lsr> Riastradh: wasn't really a question, just a ~13 delay to Vincenz' comments
<lsr> er, ~13 hour delay
<lsr> argh, 13 hour delayed reply
<Riastradh> Oh.
mattam_ has quit [Read error: 113 (No route to host)]
<lsr> time to think of something more interesting to write
<systems> a new text editorz
<systems> >:)
<lsr> i'm mostly happy with emacs, thanks :)
<Riastradh> Work on the OCaml clone of Emacs!
<systems> the web is the thing, write zope in ocaml
<systems> or something of the kind
<systems> j2ee implementation in ocaml , something like that
<Riastradh> Write a CPS-based web library.
<systems> cps ?
<Riastradh> Continuation-Passing Style.
<Riastradh> A method of web development that makes state -REALLY- easy to maintain.
<Riastradh> Unlike CGI.
<Riastradh> With CGI scripts, the script must -stop execution-, i.e., uncontinuably, for the output to be displayed to tbe browser, and then another one must start later to process input from the browser.
<Riastradh> With CPS, the execution is merely suspended, and control jumps back to the script when the browser gives input; to hold state in a CPS script, therefore, only lexical closures are required.
<systems> i still dont fully understand terms, like lexical and continuation, but i get the idea
<Riastradh> A continuation is just a place where control continues.
<systems> but this is very low level, advantage ... frameworks i would imagine is made, to make it easier to go from design to working code
<Riastradh> ?
<Riastradh> Rephrase, please, systems.
<systems> i am still not sure about many things, so never mind me if i say something completely mal-informed
<lsr> i think his point is that there is code that makes it sufficiently easy to write web applications that the advantage of closures isn't very compelling
<lsr> (i don't disagree or agree; just trying to interpret)
<systems> i think i was tryin to say, an lib/tool should is more important to make it easier to implement a logic ...
<systems> this i think can be helped with Graphical documentations
* Riastradh still doesn't get what systems is saying, unless lsr was correct in his interpretation.
<systems> hehe, i still consider myself new to programming, so, it is very likely that i am missing something major with how programs are built
<systems> but with graphical docs i mean stuff like UML, ERD-diagrammers
<Riastradh> No, no, I just would like you to rephrase...I don't quite get what you're saying the way you're saying it.
<systems> you draw what you want to built, which fit, in a framework (graphical representations) , that the framework tell you how to actually built it
<Riastradh> Er, but what were you saying about the CPS stuff?
<systems> i was sayin, that CPS is very technical
<systems> is wont make programming easier, but it maybe makes code more efficient
<Riastradh> Not really -- just add a new function, sendSuspend, that will be given output to send and a continuation.
<Riastradh> No, it would make the code easier.
<systems> :)
<Riastradh> Er, rather.
<Riastradh> sendSuspend is given a function that takes one argument.
<Riastradh> That argument is a special URI that the next input will go to.
<Riastradh> That function should return the output.
<Riastradh> In that output is contained a usage of the special URI, probably.
<Riastradh> sendSuspend gives that output to the browser and suspends the script until the browser goes to that special URI.
<Riastradh> It then returns the input from the browser for you to use elsewhere.
<systems> you dont need to read it, just look at the graph
<systems> clear seperation of components
<systems> you know, where to look for to do whatever
<lsr> hopefully not another dumb question, but:
<lsr> let s = Unix.socket Unix.PF_INET Unix.SOCK_STREAM;;
<systems> the graph almost tell you how to make an app
<lsr> let c2 = Unix.connect s aa;;
<lsr> it barfs on s
<lsr> "This expression has type int -> Unix.file_descr but is here used with type Unix.file_descr"
Kinners has joined #ocaml
<Riastradh> systems - They don't tell you how to store state with the servlets.
<systems> excatly
<Riastradh> lsr - let s = Unix.socket (Unix.PF_INET : int) Unix.SOCK_STREAM;; (* maybe? *)
<Riastradh> CPS is a way to store state with the servlets.
<systems> it tell me more about the bigger picture of making an app
<systems> which is the more important objective of a framework, make the big picture simpler
<lsr> Riastradh: nope :(
<Riastradh> lsr - Maybe do that with Unix.SOCK_STREAM.
<Riastradh> In a web app that interacts with the user, some method of maintaining the state that the user has sent so far must be used.
<Riastradh> CPS is a very simple way to maintain that state.
<lsr> This expression has type Unix.socket_type but is here used with type int
<lsr> the call to Unix.socket doesn't give any warnings
<systems> lsr , check to see if Unix.socket_type is not defined twice differently
<Riastradh> Oh.
<Riastradh> You said it barfed on s, though.
<Riastradh> Or did it barf on Unix.connect s?
<lsr> yes, in Unix.connect
<lsr> sorry I wasn't clear
<Riastradh> OK, maybe do (s : int).
<lsr> that changes the error :)
<Riastradh> What's the error now?
<lsr> This expression has type int -> Unix.file_descr but is here used with type
<lsr> int
<systems> http://caml.inria.fr/FAQ/FAQ_EXPERT-eng.html ->check the first questions
<Riastradh> 'socket' takes three parametres; you gave it two.
<Riastradh> val socket : socket_domain -> socket_type -> int -> file_descr
<Riastradh> ^^^
<lsr> gah, i'm an idiot
systems has quit ["Client Exiting"]
<Riastradh> Why don't you use the higher-level networking interface?
<lsr> i'm using with what i know right now
<Riastradh> socket to get a socket.
<Riastradh> open_connection to get input and output ports for that socket.
<lsr> i don't think it's the low-levelness of the interface that's causing me problems just now; rather it's that i'm still wrestling with syntax
<Riastradh> shutdown_connection to close a socket.
foxster has quit [Read error: 104 (Connection reset by peer)]
lament has joined #ocaml
foxster has joined #ocaml
<lsr> lsat dumb question for the evening:
<lsr> Unix.send s str1 (String.length str1) 0;;
<lsr> - : Unix.msg_flag list -> int = <fun>
<lsr> Why does that not seem to "do anything"?
<lsr> s is a connected socket, but the listener on the other end doesn't seem to get anything
<Kinners> you haven't fully applied the function
<lsr> sorry, I don't really know what that means yet
<Kinners> you partially apply a function (hopefully that's the right terminology) by not giving it all the parameters
<Kinners> so the Unix.send call you did returned a function that takes 2 parameters
<lsr> ok, a) am i misreading the doco if i think Unix.send takes 4 parameters, and b) did I not give it 4 parameters?
<Kinners> one parameter I mean
<Kinners> it takes 5 and returns an int
<lsr> ahhhh
<lsr> i see now
vincenz_ has quit [Remote closed the connection]
iusris_ has quit [Read error: 113 (No route to host)]
iusris has joined #ocaml
vincenz_ has joined #ocaml
qnix has joined #ocaml
qnix has left #ocaml []
__DL__ has quit [Read error: 54 (Connection reset by peer)]
vincenz_ has quit [sterling.freenode.net irc.freenode.net]
iusris has quit [sterling.freenode.net irc.freenode.net]
polin8 has quit [sterling.freenode.net irc.freenode.net]
docelic|away has quit [sterling.freenode.net irc.freenode.net]
asqui has quit [sterling.freenode.net irc.freenode.net]
Riastradh has quit [sterling.freenode.net irc.freenode.net]
vincenz_ has joined #ocaml
iusris has joined #ocaml
polin8 has joined #ocaml
docelic|away has joined #ocaml
asqui has joined #ocaml
Riastradh has joined #ocaml
asqui has quit [Excess Flood]
asqui has joined #ocaml
foxster has quit [Read error: 104 (Connection reset by peer)]
foxster has joined #ocaml
foxster has quit [Client Quit]
Kinners has left #ocaml []
mattam has joined #ocaml
foxster has joined #ocaml
foxster has quit [Read error: 104 (Connection reset by peer)]
foxster has joined #ocaml
lament has quit ["heh"]
<seth_> How do I allow code mutually recursive functions?
gene9 has joined #ocaml
Kinners has joined #ocaml
foxster has quit [Read error: 104 (Connection reset by peer)]
<vincenz_> let rec f... and g...
<vincenz_> you use an "and" in the let
<seth_> vincenz_: thanks, I found that after looking through the docs a lot. too bad you weren't here earlier. :)
<vincenz_> sowwy
<seth_> I'm off to sleep, thanks again.
<vincenz_> cu
gene9 has quit []
__DL__ has joined #ocaml
systems has joined #ocaml
systems has quit [Read error: 60 (Operation timed out)]
karryall has joined #ocaml
pattern_ has quit [sterling.freenode.net irc.freenode.net]
pattern_ has joined #ocaml
lus|wazze has joined #ocaml
liyang_ has quit ["leaving"]
liyang has joined #ocaml
Kinners has left #ocaml []
liyang has quit ["leaving"]
lus|wazze has quit ["The ultimate downfall of society is the greatest advancement in communications technology being used to find pictures of peop]
karryall has quit ["bye"]
foxster has joined #ocaml
xtrm has quit ["killall -9 world"]
foxen has joined #ocaml
foxster has quit [Read error: 110 (Connection timed out)]
foxen has quit [Read error: 110 (Connection timed out)]
foxster has joined #ocaml
mattam_ has joined #ocaml
mattam has quit [Read error: 110 (Connection timed out)]
lus|wazze has joined #ocaml
asqui has quit [Connection timed out]
gene9 has joined #ocaml
gene9 has quit [Client Quit]
foxster has quit [Connection timed out]
systems has joined #ocaml
systems has quit ["Client Exiting"]
lus|wazze has quit ["das ist die antri-depri-quit-msg... der anti-depri-quit-msgen-blues!"]
asqui has joined #ocaml
mattam_ has quit ["leaving"]