__DL__ has quit [Read error: 104 (Connection reset by peer)]
Smerdyakov has quit [Read error: 110 (Connection timed out)]
__DL__ has joined #ocaml
Smerdyakov has joined #ocaml
systems has joined #ocaml
systems has quit [Client Quit]
Smerdyakov has quit [Read error: 60 (Operation timed out)]
lus|wazs has joined #ocaml
Smerdyakov has joined #ocaml
docelic has joined #ocaml
docelic has quit [Read error: 104 (Connection reset by peer)]
lus|wazs has quit ["sul °°"]
Smerdyakov has quit [Read error: 60 (Operation timed out)]
Smerdyakov has joined #ocaml
Smerdyakov has quit [Read error: 60 (Operation timed out)]
Smerdyakov has joined #ocaml
Smerdyakov has quit [Read error: 60 (Operation timed out)]
brwill|zzz is now known as brwill
Smerdyakov has joined #ocaml
brwill is now known as brwill|out
lus|wazs has joined #ocaml
mrvn has joined #ocaml
<mrvn>
moin
<phubuh>
sup
<mrvn>
let($)f g x=f(g x)let r v k o s=k v(s+o+2*((o-v)asr 30)*o)let i=r 1let v=r 5let
<mrvn>
x=r 10let l=r 50let c=r 100let d=r 500let m=r 1000let s x=x(fun o x->x+o)0 0;;
<mrvn>
s (m$c$m$l$x$x$x$i$v);;
<mrvn>
Anyone an idea how do to this with less code? It calculates roman numbers (like mcmkxxxiv=1984)
<mrvn>
s/k/l/
stepcut has joined #ocaml
<stepcut>
I want to make an interpreter that can read a program written in an ML-like language from the command-line and run it. I am thinking a good way to do this might be to use camlp4 to parse the command-line into an AST, and then write code to interprete the AST. But I can't find any examples of someone doing this, so maybe its a bad idea after all?
<mrvn>
camlp4o should be an example.
<mrvn>
parses ocaml into an AST used by the compiler/interpreter
<stepcut>
true
<mrvn>
das liegt meist an der Frequenz
<mrvn>
ups
<stepcut>
lets say I do something like: let ast = Grammar.Entry.parse Pcaml.expr (Stream.of_string "let a = 5 in a");;
<stepcut>
now ast is of type MLast.expr
<stepcut>
Is there some function I can call that will try to interpret an MLast.expr?
<stepcut>
I can't really figure anything useful to do after I get an MLast.expr ... I think I am missing something
docelic has joined #ocaml
skylan has joined #ocaml
<mrvn>
stepcut: in the interpreter yes
<mrvn>
I think.
<mrvn>
There is a function that can parse and evaluate a string.
stepcut has quit [Remote closed the connection]
lus|wazs has quit ["sul °°"]
lus|wazs has joined #ocaml
brwill|out is now known as brwill
mattam has quit [Read error: 60 (Operation timed out)]