<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.