* Smerdyakov
goes crazy using Coq to prove inductive theorems automatically.
<Smerdyakov>
Nothing like stating the inductive hypothesis and using the eauto tactic to do the rest. :D
CosmicRay has quit [Read error: 113 (No route to host)]
cjohnson has joined #ocaml
mattam has quit [Read error: 110 (Connection timed out)]
__DL__ has quit ["Bye Bye"]
monochrom has joined #ocaml
Sonarman has joined #ocaml
cjohnson has quit ["sleep"]
hexreel has joined #ocaml
tintin has quit [Remote closed the connection]
<tsume>
damn, even Hiribayashi-san is having trouble with swig, so its not just me :)
<tsume>
He has been getting firther than me though, since he knows the internals of WideStudio. However, the bug he ran into was swig related, so maybe he will hand the binding code out and the swig bug for ocaml.swg may be found.
CosmicRay has joined #ocaml
<humasect>
ahh =)
<humasect>
(hello)
vezenchio has joined #ocaml
CosmicRay has quit ["Client exiting"]
hexreel has quit ["quit"]
Sonarman has quit ["leaving"]
zzorn has joined #ocaml
monochrom has quit ["What is the meaning of "meaning"?"]
mlh has quit [Client Quit]
Snark has joined #ocaml
Herrchen has joined #ocaml
Msandin has joined #ocaml
zzorn is now known as zzorn_away
pango_ has quit [Remote closed the connection]
slashvar[ens] is now known as slashvar[lri]
Msandin2 has joined #ocaml
Msandin has quit [Read error: 110 (Connection timed out)]
Msandin2 is now known as Msandin
Msandin_ has joined #ocaml
Msandin has quit [Read error: 110 (Connection timed out)]
Msandin_ is now known as Msandin
mlh has joined #ocaml
__DL__ has joined #ocaml
mellum has quit [Read error: 60 (Operation timed out)]
mellum has joined #ocaml
smimou has joined #ocaml
humasect has quit [Read error: 104 (Connection reset by peer)]
humasect has joined #ocaml
_fab has joined #ocaml
_fab has quit [Remote closed the connection]
mlh is now known as mlh_
<vincenz>
Hi
mlh_ has quit ["who are you people and what are you doing in my computer?!"]
<Msandin>
'i
<mflux>
let's say I have a function that returns a tuple of two values
<mflux>
and I would like to construct an object which has these values bind into two separate names
<mflux>
how would I do it?
<smimou>
let (a, b) = f x in ...
<mflux>
but in objects I need to use val
<mflux>
but val (a, b) = f.. doesn't work
<mflux>
the complete code being something in effect of class bar = object val (a, b) = (4, 2) end
<mflux>
one 'solution' would be to use ref option, but that's inconvenient
<mauke>
class bar = let (tmp1, tmp2) = f x in object val a = tmp1 val b = tmp2 end
<mflux>
hmm, well that was along the lines of a workaround for functions I did think about, but that didn't occur to me, thanks!
<mflux>
hmm, so 'class' is almost like a function definition..
<vincenz>
mflux: what?
<vincenz>
mflux: you can let the constructor take a tuple
<Msandin>
if you use that solution you should be aware that the expression "f x" is only evaluated once per class, i.e. not at object creation time..
<vincenz>
there's easier ways
<vincenz>
class bar (a, b) = object end
<vincenz>
seeing your variables are not mutable... that's fine
<Msandin>
let new_bar () = new bar (f x)
<mflux>
msandin, ok, so infact that's not suitable for me then
<mflux>
I'm trying to establish an ip-connection at object creation
<vincenz>
mflux: new bar (f x)
* vincenz
shrugs
<vincenz>
class bar (a, b) = object end
<mflux>
yes, it might not be the perfect interface, but I would still like to be able to do it ;)
<mflux>
and I would rather hide it from the interface
<mflux>
of course, I could just provide a function that does that
<Msandin>
mflux: you could also do:
<Msandin>
class bar () = let (a, b) = f x in object end
<mflux>
yeah, I'm doing "class t ~host ?(port=3000) () = let (conn_fd, conn_in, conn_out) = connect ~host ~port () in object.."
<mflux>
I too eagerly interpreted your warning, obviously it only referred to the case constructor taking no arguments
<Msandin>
mflux: yeah, it was for that particular case
<mauke>
hahaha, that rocks
<mauke>
class instances aren't objects
<mauke>
inheritance isn't subtyping
<Msandin>
mflux: i'd probable use a factory function though ("connect" instead of "new bar"), but that's me
<vincenz>
ooh
<vincenz>
wait
<vincenz>
I have an OO tcpip lib I made
<vincenz>
lemme look
<vincenz>
right
<vincenz>
as long as your class takes parameters it won't be executed only once
<mauke>
class bar x = ... is just syntactic sugar for class bar = fun x -> ...
<mauke>
doing "new bar" yields a function, not an object :-)
<Msandin>
mauke: you know, that fact, and understanding what it allows you to do with parametrized classes has been creeping into my brain lately;-) I knew it, but breaking the Java mindset takes work
<vincenz>
yip
<mauke>
<3 ocaml
<vincenz>
a few things of ocaml aren't as clean as they could be :/
* vincenz
wants typeclasses
<mauke>
what are typeclasses?
<vincenz>
haskell has typeclasses
<vincenz>
if the typesystem of ocaml was expanded to allow restriction on 'a it'd work fine
<Msandin>
mauke: a Haskell thingy which seems harmless but end very powerful
<vincenz>
yi
<vincenz>
yip
<vincenz>
and it's possible to achieve in linux
<vincenz>
..
<vincenz>
ocaml
<vincenz>
just add type-constraints to 'a
<vincenz>
and operators should be expanded to allow type-operators
<vincenz>
that way the :: from list becomes implementable
CosmicRay has joined #ocaml
<vincenz>
:D
cjohnson has joined #ocaml
Msandin has quit [Read error: 60 (Operation timed out)]
<CoolPops>
I love emacs because it's also my personal info manager (Planner mode), my web mainteance tool (Emacs Wiki), my very awesome email client (Wander Lust), and also my media player/editor (Emms).
* CoolPops
also likes to take a break or two with Emacs Tetris ;-)
<Riastradh>
The way Tuareg mode works better reflects the structure of the code. It indents a sequence of lets the same, and then it indents the body further to show the area in which the new variables are bound.
<mauke>
emacs is a good os; it just lacks a decent text editor
<CoolPops>
Riastradh: yes, from my learning I see why it's indented. I jsut wonder if it's always practical.
<CoolPops>
Riastradh: maybe the Gtk example is coded a bit wrong? The let ... in sequences could all be at the top, then it would make good sense, be indented properly and look good as well.
<CoolPops>
(at the top of the let main () = function of course.
<vincenz>
CoolPops: they are not let ins
<vincenz>
CoolPops: they are toplevel lets
<CoolPops>
vincenz: I'm speaking of let main () = \n let window = ... in (code, code, code) let button = ... in (code, code, code ...) ?
<vincenz>
oh!
<vincenz>
works fine in vim
<CoolPops>
vincenz: but after an in ... it should be indented unless it's another let statement, shouldn't it?
<vincenz>
n
<vincenz>
o
* vincenz
mutters at his typist
<vincenz>
no
<CoolPops>
hm. I'm stil a bit green to OCaml.
<vincenz>
look at let x = e in
<vincenz>
b
<vincenz>
as
<vincenz>
{
<vincenz>
x= e;
<vincenz>
b;
<vincenz>
}
<vincenz>
then you see that it's most logically on the same line
<vincenz>
I mean same column
<CoolPops>
vincenz: in ocaml, what causes the '}' ? The next let statement?
<Riastradh>
It is better to think of it as a set of bindings & then a body. let does _not_ perform assignment.
<vincenz>
just giving a somewhat c-equivalent
<Riastradh>
Note that, in C, you _do_ indent blocks.
Ag_47 has joined #ocaml
<Ag_47>
hippl
<Ag_47>
does anyone use pxp?
<Riastradh>
You don't write code like this:
<Riastradh>
{ int x = 5;
<Riastradh>
foo bar baz;
<Riastradh>
quux zot mumble;
<Riastradh>
}
<Riastradh>
OCaml just makes a clearer syntactic distinction between the binding of variables & the body than C.
<vincenz>
Riastradh: you're abusing syntnax now
<CoolPops>
When I write code I strive to make it easy to understand and read. I'm a code reader. I'm just trying to understand the correct way.
<vincenz>
I find let's on the same line the most logical
<Riastradh>
Aligning let in a sequence of bindings, yes. But the body should nevertheless be indented, unlike the code there.
<vincenz>
I disagree
<Riastradh>
vincenz, do you not indent blocks in C?
zzorn_away is now known as zzorn
* CoolPops
is getting confused :-)
<vincenz>
Riastradh: I do and I put the variable assignments on the same column as the rest
<Riastradh>
CoolPops, let binds variables in a closed body. I'm suggesting that you indent the body within which the new variables are bound.
<vincenz>
I indent the body of a function
<CoolPops>
it would seem to me to make more sense to move the let button = ... up, right below the let window binding. That would fix everything, in this example.
* Ag_47
is looking for a pxp guru. or must become one himself ;)
pango has joined #ocaml
solarwind has quit [Read error: 60 (Operation timed out)]
Submarine has joined #ocaml
mattam has joined #ocaml
pango has quit ["Leaving"]
Ag_47 has left #ocaml []
pango has joined #ocaml
<CoolPops>
Compiling my own copy of ocaml, it states: "shared libraries not supported." at the end of configure. I'm on NetBSD, shouldn't shared libs be supported?
Snark has quit ["Leaving"]
<Submarine>
have you read the docs about it? not all platforms are supported with shared libs
<Submarine>
anyway, shared libs are not that useful for ocaml
<CoolPops>
Submarine: I'm installing packages and it seems like they all give me errors like: dll_postgresql.so not found... and then err out, and do not install.
* CoolPops
has tried postgre, sqlite and dbi ... all got basically the same error.
* CoolPops
goes and reads some more of the INSTALL docs.
vezenchio has quit ["I live in a yurt on the steppes of Sheepfuckistan. That's why."]
a-zwei has joined #ocaml
<CoolPops>
$ ocamlfind
<CoolPops>
Fatal error: exception Stream.Error("Expected a '=' or a '(arguments,...)=' clause at line 1 position 2")
<CoolPops>
any thoughts? This is the 1st package I installed after my fresh ocaml install.
<CoolPops>
The compile/install of both (ocaml and findlib) went fine, no errors or anything.
CoolPops has left #ocaml []
monochrom has joined #ocaml
Skal has joined #ocaml
Herrchen has quit ["good night"]
Submarine has quit ["Leaving"]
picard has quit ["Leaving"]
Yorick has joined #ocaml
cjohnson has quit ["banana"]
mlh has joined #ocaml
CosmicRay has quit ["Client exiting"]
Msandin_ has quit [Read error: 104 (Connection reset by peer)]
shawn_ has joined #ocaml
senko has quit ["Leaving"]
Yorick has quit ["Leaving"]
_shawn has quit [Connection timed out]
monochrom has quit [Read error: 60 (Operation timed out)]