<jeffwheeler>
Commenting out that line and removing it from the print statement causes the type to change to the specific string version of the Column.
ygrek has quit [Remote closed the connection]
ygrek has joined #ocaml
Ogedei has joined #ocaml
<flux>
maybe you need to add explicit int_of_string conversion there - apparently some version has changed since the time of writing that
<flux>
hm, actually, maybe I don't know what I'm saying, I haven't really done much lablgtk2 to talk about :)
Snark has quit [Read error: 113 (No route to host)]
Snark has joined #ocaml
ygrek has quit [Remote closed the connection]
mordaunt has joined #ocaml
ygrek has joined #ocaml
mikeX has quit [Read error: 110 (Connection timed out)]
<jeffwheeler>
hmm, that's possible, but I think they do some weird things with Gobject.Data.string and Gobject.Data.int wrappers, not sure what's up there.
<flux>
jeffwheeler, which editor do you happen to use? if emacs, there's a way to retrieve the type of an expression.. I think the same thing is available for vim too, nowadays.
<flux>
that's helpful when debugging type-problems
<jeffwheeler>
Emacs, and it's C-c C-t.
<flux>
right, so you know it :)
<jeffwheeler>
:)
<jeffwheeler>
I'm playing with something else for the moment; thanks for the help.
<jeffwheeler>
I gave up on that for now.
jeffwheeler has quit ["Leaving."]
rwmjones has joined #ocaml
<flux>
hmh, I took a new look at jeff's problem, and I don't quite understand the fixes I needed to do.. it is obvious however that the code has never been compiled as is.
<JimmyM>
I've actually done a lot with OCaml before.
<JimmyM>
It's just been a while since I used it.
<JohnnyL>
Smerdyakov, what's the difference between a=b and let a=b in?
<pango>
JimmyM: you can pattern-match against x :: [] or, same thing, against [x]
<JimmyM>
OK, that's what I was thinking.
<Smerdyakov>
pango, reaaaaal cool, man. The give-everyone-the-exact-answer school of pedagogy.
<pango>
Smerdyakov: so?
<JimmyM>
Smerdyakov: I understand what it says.
<JimmyM>
Plus, I tried that before.
<Smerdyakov>
JohnnyL, [a = b] is an expression, and [let a=b in] by itself is not a valid expression. :)
<JimmyM>
But there was some other incorrect code around it that kept it from compiling.
<JohnnyL>
thats why should get rid of the keyword let in.
<Smerdyakov>
pango, it doesn't help people learn to answer their own questions in the future.
<Smerdyakov>
JohnnyL, why is why?
<pango>
Smerdyakov: in that specific case, I felt it wouldn't be the case
<Smerdyakov>
Anyone understanding the basics of writing recursive functions over lists should have known the building blocks to create the pattern.
<Smerdyakov>
Anyone _not_ understanding the basics of writing recursive functions over lists should be going back to a tutorial. :P
<pango>
I don't feel like I should justify my decision
<JohnnyL>
The keywords let in is the equivilent of lisps' '('.
<JohnnyL>
and/or setq.
Snark has quit ["Quitte"]
<Smerdyakov>
JohnnyL, no.
<flux>
hm, how about equivalent to lisp's (let ?-)
Abo-Marwan has joined #ocaml
<JohnnyL>
flux, i don't know, does 'let .. in' have semantics to anything above it?
<JohnnyL>
if it does it's not like lisps let.. otherwise so.
<flux>
johnnyl, no (if I understand what you mean)
<JohnnyL>
flux, what I"m trying to find. meagerly speaking is the reason to use let..in (Perhaps it has some other operative at that same level it replaces)?
<flux>
let x = b in expr has a scope of expr
<flux>
before that statement and after that expression it affects nothing
<Smerdyakov>
JohnnyL, it's the primitive way of creating variables without using new function definitions.... what else do you propose?
<flux>
(actually let .. in is also an expression so that wasn't quite correct thing to say)
<JohnnyL>
ok
<JohnnyL>
well, in lisp let has an obiovus meaning. Unless you switch let a=b.in c with a=b;c;
<JohnnyL>
obvious
screwt8 has joined #ocaml
<Smerdyakov>
'let' in OCaml means the same as 'let' in Lisp, except that the variable isn't mutable.
<flux>
let a = b in c -> (let ((a b)) c)
<JohnnyL>
well, you could make a function from the let assignment in lisp.
<JohnnyL>
but then it may be harder to read depending on the implementation.
Abo-Marwan has quit [Remote closed the connection]
screwt8 has quit [Remote closed the connection]
<JohnnyL>
let..in it 3 more characters than ; ;
<pango>
JohnnyL: it's been a while since I used any Lisp, but I think the difference is that Lispen were traditionally dynamically scoped, while OCaml is lexically scoped
<Smerdyakov>
JohnnyL is a dangerous weapon against computers in the tradition of Captain Kirk and his nonsensical statements that fry their brains.
<Smerdyakov>
BTW, JohnnyL, is your last name Lin?
<JohnnyL>
pango, oh i thought lisp was both lexical and dynamic.
* JohnnyL
bows to the eternal in Smerdyakov
<Smerdyakov>
JohnnyL, so that is your last name?
<flux>
lexical scoping was a later addition to lisp
<flux>
ooh, my sql query generator works now, with the new approach (each query has its own symbols)
<flux>
R.select g_site (in' (col c_site) (R.project client_hosts [R.new_column (), col c_host_site])) -> SELECT * FROM (SELECT site, name FROM site) AS s (c3, c4) WHERE (c3) IN (SELECT c7 FROM (SELECT * FROM (SELECT client, name FROM client) AS l (c1, c2) LEFT JOIN (SELECT host, ip, site, client FROM host) AS r (c5, c6, c7, c8) ON ((c1) = (c8))) AS s (c1, c2, c5, c6, c7, c8))
<flux>
obviously some (read: lots of) other code needs to be there for that query, so there aren't quite any returns if one has only one query - also it doesn't really leverage the compiler for much else than syntax checking, that is, no static type system goodness
<flux>
I'm not sure how such goodness would be implemented, though.. perhaps with get1, get2, get3 etc types, for different query arities, which leads to projectn and order_byn-functions
ikaros has joined #ocaml
<flux>
but especially not-very-nice is the join of two relations: it would need \forall x, y in {1..n}: joinxy
<flux>
and even then the actual expressions of projections and joins wouldn't become type safe.. I think.
<flux>
can it construct sql queries by composing other queries?
<Smerdyakov>
Yes.
<Smerdyakov>
I don't think I ever implemented sub-selects, though.
<Smerdyakov>
The ad-hoc implementation techniques I was using would make that painful, but the new approach I'm working on slowly now should make it more pleasant.
<flux>
I'm hoping at some point I would be able to write a camlp4-preprocessor, which would perform sufficient magic for the compiler to type check that
<Smerdyakov>
It's not going to happen for a system with as much flexibility as mine.
<Smerdyakov>
I do static type-checking of functions from database schemas to complete SQL-using web applications, for instance.
<flux>
I believe that's going to be true, but I'm thinking this will be easier to integrate with other ocaml code
<JohnnyL>
Smerdyakov, Lutz is my last name.
<flux>
you are aware of pgocaml, which does that too?
<Smerdyakov>
JohnnyL, kdokey.
<flux>
(maybe, difficult to say from that description)
<Smerdyakov>
flux, no, I'm not aware of it. I'll take a look.
<Smerdyakov>
Aha, from the boys at Merjis.
<Smerdyakov>
No, from a quick look, I don't think PGOCaml comes anywhere close to doing this.
<Smerdyakov>
I'm not aware of any prior work that comes close to what I do.
Ogedei has quit [Read error: 104 (Connection reset by peer)]
<Smerdyakov>
(In terms of 100% static checking of the type safety of a complicated generic program that uses a relational database)
Ogedei has joined #ocaml
<flux>
are there any specific interesting .sml-files one interested in your approach should take a look at, or is it a all-or-nothing-deal?-)
<Smerdyakov>
.sml files? You are interested in the implementation of the compiler?
<Smerdyakov>
There is a code example/feature walk-through on the web site.
<flux>
I'm thinking how the sql types (which I assume you have) flow through the compiler.. or are the sql-types implemented with the language itself?
<Smerdyakov>
But that doesn't involve SML, which is just the semi-arbitrarily-chosen language for implementing the compiler.
<Smerdyakov>
You can see laconic/src/ast.sml in the CVS repo.
<Smerdyakov>
(For the complete type/expression/yada-yada definitions)
<Smerdyakov>
The design is definitely kind of hokey, but I learned a lot from implementing it and know how to do it with fewer orthogonal features now.
<flux>
that's interesting, thanks
<flux>
how are laconic and laconic2 related?
<Smerdyakov>
laconic2 is tres new.
<Smerdyakov>
It's going to be a single programming language where you can implement everything, with usability features so that you don't notice that it's really Coq.
<flux>
so it's not targeted specifically only for web development?
<Smerdyakov>
It's targeted at replacing every general purpose programming language.
<Smerdyakov>
And every DSL.
<Smerdyakov>
Because life is more fun if you think big. :-)
<flux>
:)
Mr_Awesome has joined #ocaml
<flux>
when will it become self-hosting?-)
<ita>
size does matter hmm ?
<Smerdyakov>
flux, beats me.
<Smerdyakov>
ita, eh?
* Smerdyakov
notices the "Hard problems" section at the bottom of the PGOCaml page.
<Smerdyakov>
My implementation either supports or almost supports that. :-)
<JohnnyL>
laconics2 because self aware 2012... It was an all purpose loirning komputer...
<JohnnyL>
opps
<JohnnyL>
laconics2 became self aware 2012... It was an all purpose loirning komputer...
schme has left #ocaml []
brooksbp has joined #ocaml
hkBst has quit [Read error: 104 (Connection reset by peer)]
hkBst has joined #ocaml
rwmjones has quit ["Closed connection"]
hkBst has quit [Client Quit]
hkBst has joined #ocaml
love-pingoo has quit ["Connection reset by pear"]
JimmyM has quit ["Leaving"]
ygrek has quit [Remote closed the connection]
hsuh has joined #ocaml
hsuh has quit [Remote closed the connection]
hsuh has joined #ocaml
hsuh has quit [Remote closed the connection]
dazari has joined #ocaml
dazari has left #ocaml []
screwt8 has joined #ocaml
ita has quit [Remote closed the connection]
m3ga has joined #ocaml
seafood_ has joined #ocaml
m3ga has quit ["disappearing into the sunset"]
hordf has quit ["Bye"]
hkBst has quit ["Konversation terminated!"]
Yoric[DT] has quit ["Ex-Chat"]
seafood__ has joined #ocaml
gim_ has quit []
seafood_ has quit [Read error: 110 (Connection timed out)]