yminsky has joined #ocaml
jao has joined #ocaml
yminsky has quit []
yminsky has joined #ocaml
slipstream-- has joined #ocaml
piggybox has joined #ocaml
slipstream has quit [Read error: 110 (Connection timed out)]
pants1 has quit ["Leaving."]
yminsky has quit []
bzzbzz has quit ["leaving"]
chs has joined #ocaml
pants1 has joined #ocaml
ramkrsna has joined #ocaml
G has joined #ocaml
G_ has quit [Read error: 110 (Connection timed out)]
G_ has joined #ocaml
G has quit [Read error: 110 (Connection timed out)]
G_ is now known as G
joshcryer has quit [Client Quit]
smimou has joined #ocaml
Submarine has quit ["Leaving"]
vital303 has joined #ocaml
vital303 has quit [Client Quit]
smimram has joined #ocaml
Mr_Awesome has joined #ocaml
smimou has quit [Read error: 110 (Connection timed out)]
Oxylin has joined #ocaml
Oxylin has quit [Client Quit]
love-pingoo has joined #ocaml
smimram has quit ["bli"]
joshcryer has joined #ocaml
G_ has joined #ocaml
Mr_Awesome has quit ["...and the Awesome level drops"]
rickardg has joined #ocaml
G has quit [Read error: 110 (Connection timed out)]
DomQ has joined #ocaml
DomQ has quit [Client Quit]
G_ is now known as G
love-pingoo has quit ["Leaving"]
jao has joined #ocaml
Nutssh has quit ["Client exiting"]
ygrek has joined #ocaml
yminsky has joined #ocaml
yminsky has quit []
ygrek has quit [Remote closed the connection]
ygrek has joined #ocaml
linefeed has joined #ocaml
EliasAmaral has quit [Read error: 104 (Connection reset by peer)]
linefeed has quit ["Leaving"]
eroyf has quit [Success]
gunark has quit [Read error: 110 (Connection timed out)]
nn-gentoo_ has quit [Read error: 110 (Connection timed out)]
pango has quit [Remote closed the connection]
pango has joined #ocaml
bluestorm_ has joined #ocaml
jajs has joined #ocaml
benny_ has joined #ocaml
benny has quit [Read error: 110 (Connection timed out)]
pango_ has joined #ocaml
delamarche has joined #ocaml
Submarine has joined #ocaml
<
tsuyoshi>
figured out how to get c's ? and : in ocaml
<
rwmjones>
you have or you want?
<
rwmjones>
just do: let r = if cond then something else someother
<
tsuyoshi>
or wait.. I had it working but now it's not working
<
tsuyoshi>
# let (-?) test yes no = if test then yes else no let (-:) testyes no = testyes no;;
<
tsuyoshi>
val ( -? ) : bool -> 'a -> 'a -> 'a = <fun>
<
tsuyoshi>
val ( -: ) : ('a -> 'b) -> 'a -> 'b = <fun>
<
tsuyoshi>
# true -? "yes" -: "no";;
<
tsuyoshi>
- : string = "yes"
<
tsuyoshi>
# false -? "yes" -: "no";;
<
tsuyoshi>
- : string = "no"
<
tsuyoshi>
but that is too hard to type
* rwmjones
is suspicious that the precedence rules work
<
tsuyoshi>
I tried ^? and ^: instead but they don't seem to work
<
pango_>
you can't "emulate" them that way anyway, because of eager evaluation
<
tsuyoshi>
yes... ocaml precedence is difficult to understand
<
rwmjones>
tsuyoshi, the first character of the operator decides the precedence etc.
<
rwmjones>
so an operator called -? acts the same was as -
<
rwmjones>
so an operator called -? acts the same way as -
<
tsuyoshi>
oh really
<
tsuyoshi>
the manual doesn't say that
<
tsuyoshi>
or wait, it does
<
tsuyoshi>
I don't see why ^? and ^: wouldn't work though
<
rwmjones>
dunno .. what operator is ^
<
tsuyoshi>
string concatenation
<
pango_>
# let myif test yes no = if test then yes else no ;;
<
pango_>
# myif true 0 ( 1 / 0 ) ;;
<
pango_>
Exception: Division_by_zero.
<
tsuyoshi>
it won't work exactly like c
<
pango_>
you don't need ? and : anyway
<
pango_>
if/then/else is already an expression
<
tsuyoshi>
yeah, I just wanted to abbreviate it
pango has quit [Remote closed the connection]
<
tsuyoshi>
I got in the habit of doing (and test yes) instead of (if test yes) in scheme
<
tsuyoshi>
but you can't do test && yes in ocaml unless yes is a bool
<
tsuyoshi>
nor can you do test && yes || no
rickardg` has joined #ocaml
<
tsuyoshi>
so with a ^? b ^: c, it is putting ^: before ^?
<
tsuyoshi>
but with a -? b -: c, it is putting -? before -:
<
rwmjones>
tsuyoshi, are you talking about perl-style open "foo" || die ... ?
<
tsuyoshi>
I'm not really familiar with perl
<
tsuyoshi>
but I guess that's a similar construct
<
pango_>
- is left associative, ^ is right associative
<
tsuyoshi>
ohh I see
<
tsuyoshi>
I wonder why they made ^ right associative
<
tsuyoshi>
I guess it lets you concatenate the results of function applications with fewer parentheses
<
rwmjones>
anyone seen this error under ocaml 3.10:
<
rwmjones>
File "uq_gtk.ml", line 150, characters 44-45:
<
rwmjones>
Parse error: ";" or ":" or ":>" or ")" expected after [expr] (in [expr])
<
rwmjones>
Preprocessing error on file uq_gtk.ml
<
rwmjones>
this is the code ....
<
rwmjones>
( match g.gtk_event_source_in with
<
rwmjones>
None when i ->
<
rwmjones>
g.gtk_event_source_in <- Some(mk_handler `IN [fd] [] []);
<
rwmjones>
| Some s when not i ->
<
rwmjones>
it happens just after the mk_handler
<
tsuyoshi>
so `IN is characters 44-46 of line 150?
<
rwmjones>
actually, the space before the `IN
<
rwmjones>
is 44-45
<
rwmjones>
mk_handler is a function, which takes the right number of params
<
tsuyoshi>
how strange
* rwmjones
bets this is because this file is preprocessed with pa_macro
<
rwmjones>
which in OCaml 3.10 has IN as a reserved word
rickardg has quit [Read error: 110 (Connection timed out)]
love-pingoo has joined #ocaml
gunark has joined #ocaml
jlouis has joined #ocaml
pants1 has quit [Read error: 60 (Operation timed out)]
eroyf has joined #ocaml
jlouis_ has quit [Read error: 110 (Connection timed out)]
the_dormant has joined #ocaml
rickardg` has quit [Remote closed the connection]
rwmjones has quit ["Closed connection"]
Submarine has quit ["Leaving"]
jajs has quit ["Quitte"]
ygrek has quit [Remote closed the connection]
Mr_Awesome has joined #ocaml
jao has joined #ocaml
love-pingoo has quit ["zz"]
joshcryer has quit [Client Quit]
jao has joined #ocaml
joshcryer has joined #ocaml
vital303 has joined #ocaml
the_dormant has quit []
Mr_Awesome has quit [Read error: 54 (Connection reset by peer)]
Mr_Awesome has joined #ocaml