Oejet has quit [Read error: Connection reset by peer]
Oejet has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
Yoric has joined #ocaml
kmicinski has quit [Ping timeout: 255 seconds]
Julien__T has joined #ocaml
ftrvxmtrx has joined #ocaml
ftrvxmtrx_ has joined #ocaml
ftrvxmtrx has quit [Ping timeout: 246 seconds]
ftrvxmtrx_ is now known as ftrvxmtrx
vivanov has joined #ocaml
Julien__T has quit [Quit: Julien__T]
boscop has joined #ocaml
Oejet has quit [Read error: Connection reset by peer]
Oejet has joined #ocaml
edwin has quit [Remote host closed the connection]
Yoric has quit [Ping timeout: 255 seconds]
Yoric has joined #ocaml
Yoric_ has joined #ocaml
Yoric has quit [Read error: Connection reset by peer]
Yoric_ is now known as Yoric
ftrvxmtrx has quit [Quit: Leaving]
ftrvxmtrx has joined #ocaml
DimitryKakadu has joined #ocaml
sepp2k has joined #ocaml
yezariaely has joined #ocaml
yezariaely has left #ocaml []
tauntaun has joined #ocaml
eelte has joined #ocaml
mo3b1us has joined #ocaml
edwin has joined #ocaml
<thelema>
gildor: I'm looking forward to changing the webroot variable in odb... :)
Oejet has quit [Ping timeout: 276 seconds]
fraggle_ has quit [Quit: -ENOBRAIN]
ftrvxmtrx has quit [Quit: Leaving]
sysop_fb has joined #ocaml
fraggle_ has joined #ocaml
lamawithonel has quit [Remote host closed the connection]
lamawithonel has joined #ocaml
lamawithonel has quit [Read error: Connection reset by peer]
ulfdoz has quit [Read error: Operation timed out]
ulfdoz has joined #ocaml
kmicinski has joined #ocaml
surikator has joined #ocaml
lamawithonel has joined #ocaml
mo3b1us has quit [Ping timeout: 252 seconds]
dnolen has joined #ocaml
lamawithonel has quit [Remote host closed the connection]
lamawithonel has joined #ocaml
kmicinski has quit [Read error: Connection reset by peer]
sysop_fb has quit []
lamawithonel has quit [Ping timeout: 276 seconds]
<EM03>
rproust: call me weird but i'm trying to do ocaml fast cgi stuff with the ocamlnet library
<rproust>
never used ocamlnet
<rproust>
have you looked into cohttp
<rproust>
??
willb has joined #ocaml
avsm has joined #ocaml
eelte has quit [Quit: 0x2a]
lamawithonel has joined #ocaml
pikachuyann has joined #ocaml
pikachuyann has left #ocaml []
an146 has joined #ocaml
<thelema>
an146: hi
arubin has joined #ocaml
Oejet has joined #ocaml
kerx__ has quit [Ping timeout: 248 seconds]
Associat0r has joined #ocaml
dnolen has quit [Quit: dnolen]
Fullma has joined #ocaml
surikator has quit [Quit: surikator]
vivanov has quit [Read error: Connection reset by peer]
lopex has joined #ocaml
avsm has quit [Quit: Leaving.]
mo3b1us has joined #ocaml
kuscotopia has joined #ocaml
<kuscotopia>
Hi all, I am just getting started with OCAML and ran into confusion trying to define a type as a 3-tuple. What am I doing wrong on the following:
<gildor>
thelema: ACK, last week was pretty busy
<gildor>
thelema: but I still have the short term goal to interact with odb
<kuscotopia>
type expr = Val as int | Var as string | Add as expr * Plus * expr ;;
<kuscotopia>
(Plus is defined previously as an op type)
<flux>
kuscotopia, Plus isn't a type
<flux>
kuscotopia, it's a constructor
<flux>
so you have somehwere type type_name = .. Plus ..
<flux>
you need to use type_name there
<kuscotopia>
Yeah, I could do that....was just trying to be specific as I have other operators defined in that type as well (like Semicolon)
<flux>
kuscotopia, it doesn't really add anything to have a constant in that place..
<flux>
kuscotopia, oh, noticed another issue as well: it's "of", not "as"
<kuscotopia>
oops...IM error only..I have of in my code
<flux>
kuscotopia, you could just as well have type expr = .. | Add of expr * expr and no information would be lost, no?
<kuscotopia>
Maybe..though I lose the sense of an operator don't I? So 2 + 2 ... both 2's would be an expr and + would be the operator
<kuscotopia>
In yours...2 would be an expr.. "+2" would be an expr..right? or am I interpreting that wrong?
<flux>
kuscotopia, how about .. | Add of expr * operator * expr ?
<flux>
kuscotopia, also, noticed a third thing: you cannot have the same constructor in two positions, Var of int | Var of string
<kuscotopia>
Sure...first should be Val...so Val of int | Var of string
<flux>
oops
<flux>
indeed :)
<flux>
misread that one
<kuscotopia>
I was trying to be explicit in my definition..and want to take into account addition, multiplication, division, etc
<kuscotopia>
hence I was hoping to bind Add variant to addition
<kuscotopia>
Maybe to give myself some sense of control while I ride the learning curve :P
<flux>
so how do you define Plus?
<kuscotopia>
type op = Plus | Minus | Times | .. ;;
<flux>
hm, so wouldn't you then use something like BinaryOp of expr * op * expr ?
<flux>
instead of Add of expr * Plus * expr? to be cover all expressions?
<mrvn>
kuscotopia: I recommedn s/Var/Ident/
<flux>
that is indeed the customary name
<mrvn>
and s/Add/BinOp/ or something
kerx__ has joined #ocaml
<kuscotopia>
*Nods* I could see that. So make a bin for my binary ops and rather one bin to rule all my operators.
<kuscotopia>
I will update the names. I am new to language theory so I doubly new.
<mrvn>
except ? which is tertiary if you have that and unary -, !, ~
<kuscotopia>
Yeah, for the moment I will restrict my scope for the moment, but seems easy enough to make a new types for the teriaries and unaries.\
mo3b1us has quit [Ping timeout: 276 seconds]
<kuscotopia>
Thanks folks, back to the grindstone.