philed has quit [Remote host closed the connection]
tac has joined #ocaml
hongboz has joined #ocaml
Playground has quit [Ping timeout: 252 seconds]
Playground has joined #ocaml
silkwood has joined #ocaml
sad0ur has quit [Read error: Connection reset by peer]
Playground has quit [Ping timeout: 248 seconds]
travisbrady has joined #ocaml
madroach has quit [Ping timeout: 248 seconds]
madroach has joined #ocaml
ManAmongHippos has joined #ocaml
chambart has quit [Ping timeout: 246 seconds]
weie has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
adotbrown has quit [Ping timeout: 248 seconds]
adotbrown has joined #ocaml
_tca has joined #ocaml
TDJACR has joined #ocaml
tac has quit [Ping timeout: 245 seconds]
travisbrady has quit [Quit: travisbrady]
travisbrady has joined #ocaml
travisbrady has quit [Client Quit]
tac has joined #ocaml
ski has quit [Ping timeout: 252 seconds]
dabd has quit [Quit: Ex-Chat]
tac has quit [Ping timeout: 245 seconds]
tac-tics has joined #ocaml
hongboz has quit [Ping timeout: 255 seconds]
silkwood has quit [Quit: Ex-Chat]
Yoric has joined #ocaml
cdidd has joined #ocaml
adotbrown has quit [Ping timeout: 252 seconds]
weie has quit [Quit: Leaving...]
adotbrown has joined #ocaml
ttamttam has joined #ocaml
alej has joined #ocaml
ulfdoz has joined #ocaml
adotbrown has quit [Ping timeout: 244 seconds]
weie has joined #ocaml
ski has joined #ocaml
ulfdoz has quit [Ping timeout: 248 seconds]
ttamttam has left #ocaml []
ski has quit [Ping timeout: 252 seconds]
tac-tics has quit [Ping timeout: 245 seconds]
answer_42 has joined #ocaml
yacks has joined #ocaml
gour has joined #ocaml
Yoric has quit [Remote host closed the connection]
Yoric has joined #ocaml
Yoric has quit [Ping timeout: 246 seconds]
ftrvxmtrx_ has joined #ocaml
Cyanure has joined #ocaml
ttamttam has joined #ocaml
mcclurmc has joined #ocaml
hkBst has joined #ocaml
hkBst has quit [Changing host]
hkBst has joined #ocaml
<flux>
what, ocaml trunk has record name disambiguation?
<flux>
that's.. almost.. like overloading ;-)
djcoin has joined #ocaml
Kakadu has joined #ocaml
Cyanure has quit [Remote host closed the connection]
AltGr has joined #ocaml
cago has joined #ocaml
Cyanure has joined #ocaml
adotbrown has joined #ocaml
adotbrown has quit [Ping timeout: 248 seconds]
mye has quit [Quit: mye]
philed has joined #ocaml
Yoric has joined #ocaml
ocp has joined #ocaml
<darkf>
js_of_ocaml doesn't seem to be compiling my modules (I have a few of them) when I use the command on their manual http://ocsigen.org/js_of_ocaml/manual/ - the resulting .js just has some caml_* stdlib functions
ontologiae has joined #ocaml
Snark has joined #ocaml
thomasga has joined #ocaml
cyball has joined #ocaml
RagingDave has joined #ocaml
mcclurmc has quit [Ping timeout: 248 seconds]
ocp has quit [Ping timeout: 245 seconds]
<pippijn>
darkf: you have a bytecode program?
<darkf>
pippijn: Yes, although now I'm getting a new error - Missing primitives: caml_ml_output_char
pango is now known as pangoafk
<pippijn>
that's ok
<pippijn>
darkf: you're using channel I/O
<darkf>
pippijn: Yeah I kind of need printf
<pippijn>
to stdout?
<pippijn>
then you need to implement caml_ml_output_char in javascript
<pippijn>
because js has no stdout
<darkf>
pippijn: Ah, I see.
<darkf>
pippijn: It only seems to be called 3 times even though it outputs ": hi\n" on the console
<darkf>
pippijn: Maybe printf is broken?
<darkf>
well obviously something else is broken as print_endline doesn't work either - oh well
<darkf>
js_of_ocaml might be broken horribly
<darkf>
is there a good alternative?
<thomasga>
darkf: js_of_ocaml works very well
<thomasga>
(for me at least :-) )
<Kakadu>
js_of_ocaml should work well
<darkf>
well, I'd love it to, but it took me 2 hours just to get this to compile and it doesn't seem to be *correct* (the ocaml interpreter works fine, but it has incorrect results in js)
<Kakadu>
darkf: OCaml has hardcoded primitives in itself
<Kakadu>
like %apply which applies functions
<Kakadu>
or printf primitives which print lines at terminal
<Kakadu>
it is obvious that you should not try to print something to terminal if you are in browser
<Kakadu>
Do you call printf directly or it is called by Firebug.log (...) ?
<Kakadu>
darkf: ^^
<darkf>
Kakadu: Directly. But since print_endline doesn't give the correct results either I'm inclined to believe js_of_ocaml isn't compiling something right.
<thelema_>
date is just a date implementation, it doesn't implement Calendar_sig
<SuperNoeMan>
last question:
<SuperNoeMan>
I'm converting expressions to strings
<SuperNoeMan>
and right now, I have operator precedence being paid attention to
<SuperNoeMan>
but I also need to pay attention to associativity
<tch>
thelema_: oh
<SuperNoeMan>
so that, where the empty string is represented with @
<SuperNoeMan>
the sequence of ("", ""), ""
<SuperNoeMan>
returns @@@
<SuperNoeMan>
because it is left associative, and therefore equivalent
<thelema_>
but "", ("", "") should return @(@@)?
<SuperNoeMan>
but I want "", ("", "") to return @(@@)
<SuperNoeMan>
yes!!
<SuperNoeMan>
thelema_: I'm just at a loss as to how to capture this functionality
<SuperNoeMan>
in a recursive implementation
<thelema_>
start by putting () around everything, and take it away when allowed.
<SuperNoeMan>
yeah, but how do I test whether its allowed?
<thelema_>
for example, (@@)@ can have () around left branch removed because left associative
<SuperNoeMan>
yes
<thizanne>
SuperNoeMan: if it does not work, it is not correct
<thelema_>
((@)(@))(@)
<thelema_>
singletons get parens removed
<thelema_>
and then left branch gets parens removed
<thelema_>
try those rules at first
<SuperNoeMan>
but I want to keep the logic within the conversion to string function... I don't want to scan my own string that I'm returning after the conversion is complete, that's not very elegant...
<thelema_>
if you need to track precedence (which you likely will), you'll just add () when precedence of inside is too low
RagingDave has quit [Quit: Ex-Chat]
<SuperNoeMan>
well I have precedence taken care of
<thelema_>
I'm not actually suggesting you scan the output string
<SuperNoeMan>
for precedence, I pass in a number that represents an operations precedence
<SuperNoeMan>
thelema_: ok :)
<thelema_>
I'm suggesting that you be able to print with and without ()
<thelema_>
for any element
<SuperNoeMan>
and compare that number to the currently matched one
<thelema_>
and then figure out whether you need ()
<SuperNoeMan>
well I don't know how to test for associativity without knowing the context of where I'm parsing...
<SuperNoeMan>
or really, I don't know how to test for associativity
<SuperNoeMan>
in my algorithm at all
<thelema_>
if you really need to do that, you can pattern match more of the tree at once
<SuperNoeMan>
ahhh
<SuperNoeMan>
so I could have... more than just a single type at a time...
<thelema_>
match r with | Seq(Seq(a,b),c) -> ...
<SuperNoeMan>
well, then I have to go through every combination
<SuperNoeMan>
that's not very ideal...
<thelema_>
one solution is to generalize your type: type rex2 = Seq | Either type rexp = Constant of string | Bin of rex2 * rexp * rexp | KleeneStar of rexp;;
<SuperNoeMan>
oh cool
<SuperNoeMan>
thanks man
<thelema_>
for such a small type, this will probably not save you much
<SuperNoeMan>
well, how is this scalable...
<SuperNoeMan>
if the type was longer than a few individual constructors,this would be giant pain
<SuperNoeMan>
and look terrible in source...
<thelema_>
but it does allow things like: match r with | Bin(o1,Bin(o2,a,b),c) when o1 = o2 -> ...
answer_42 has quit [Ping timeout: 276 seconds]
tane has quit [Quit: Verlassend]
travisbrady has quit [Quit: travisbrady]
smondet has quit [Ping timeout: 248 seconds]
<SuperNoeMan>
thelema_: so, using this new construct
<SuperNoeMan>
I want to match (rexp, Seq(a, b))
<SuperNoeMan>
where rexp is a type I have defined
<SuperNoeMan>
but not a constructor
<SuperNoeMan>
I want basically any constructor within rexp to fall under this category...
<SuperNoeMan>
how can I do this?
emmanuelux has quit [Remote host closed the connection]
dwmw2_SAT is now known as dwmw2_gone
cdidd has quit [Remote host closed the connection]
SuperNoeMan has quit [Remote host closed the connection]
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]