<Anarchos>
thelema i know but the segfault is in caml_minor_gc ...
<Anarchos>
anyway it is time to bed
<Anarchos>
good night to all
<julm>
gn anar
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
thatch has left #ocaml []
sav has quit [Read error: Connection reset by peer]
sav has joined #ocaml
lewis1711 has joined #ocaml
sav has quit [Read error: Connection reset by peer]
sav has joined #ocaml
sav has quit [Ping timeout: 240 seconds]
snarkyboojum has quit [Quit: ...]
ulfdoz has quit [Ping timeout: 255 seconds]
ulfdoz has joined #ocaml
opla2 has joined #ocaml
sepp2k has quit [Quit: Leaving.]
opla2 has quit [Ping timeout: 246 seconds]
kaustuv_ has joined #ocaml
<lewis1711>
can one not use the short "fun ->" form of lambdas in module signatures?
<lewis1711>
oh it seems fun -> forms can't have pattern matching in them. odd
<lewis1711>
oh well
Edward_ has joined #ocaml
snarkyboojum has joined #ocaml
<thelema>
lewis1711: "function" does pattern matching, "fun" only can do what "let" does re pattern matching
<lewis1711>
is there some reason for not just having a single "fun" keyword that does what function does? or is it just a bit o' cruft?
<lewis1711>
(often what I think of as a "Design flaw" ends up having a good reason behind it. though sometimes not:P)
<thelema>
fun is the core keyword, function is sugar for the common fun x -> match x with ...
elehack has quit [Quit: Farewell, programs.]
mjonsson has quit [Read error: Operation timed out]
<lewis1711>
...oh yeah, it had no match. right :)
Amorphous has quit [Ping timeout: 272 seconds]
sepp2k has joined #ocaml
Edward_ has quit []
boscop_ has joined #ocaml
Amorphous has joined #ocaml
boscop has quit [Ping timeout: 240 seconds]
sepp2k has quit [Quit: Leaving.]
<kaustuv_>
I think having function in OCaml is a design flaw.
<kaustuv_>
Interestingly, Standard ML has only (the equivalent of) function, written "fn", but the price it pays is that curried functions have to be written with multiple fns.
<kaustuv_>
I wonder why OCaml does not allow [function p1 ... pn -> e | q1 ... qn -> f | ...] as a derived form for [fun x1 ... xn -> match x1, ..., xn with p1, ..., pn -> e | q1 ... qn -> f | ...]. Is it ambiguous?
<lewis1711>
hooray, I just solved the first execise in Okasaki in ocaml
* lewis1711
puts intermediate functional programmer on CV
surikator has quit [Quit: surikator]
eye-scuzzy has quit [Remote host closed the connection]
eye-scuzzy has joined #ocaml
thatch has joined #ocaml
myu2 has joined #ocaml
thatch has quit [Remote host closed the connection]
joewilliams is now known as joewilliams_away
seafood has joined #ocaml
arubin has quit [Quit: arubin]
seafood has quit [Quit: seafood]
seafood has joined #ocaml
edwin has joined #ocaml
edwin has quit [Remote host closed the connection]
edwin has joined #ocaml
smerz has joined #ocaml
edwin has quit [Remote host closed the connection]
edwin has joined #ocaml
ygrek has joined #ocaml
ygrek has quit [Remote host closed the connection]
spearalot has joined #ocaml
ygrek has joined #ocaml
mike_mcclurg has quit [Ping timeout: 240 seconds]
ftrvxmtrx has quit [Read error: Connection reset by peer]
<ubuntu>
can someone explain me how i update ocaml on my ubuntu 10.10 to ocaml 3.12.0?
<lewis1711>
have to build it from source i imagine
<ubuntu>
how?
<lewis1711>
usually... ./configure, sudo make install
<lewis1711>
download the latest from the ocaml site, read the README and INSTALL files that should come with it, and look up a guide on compiling applications by source
zerny has joined #ocaml
<lewis1711>
(I am on ubuntu and using 3.11.2, is there something juicy I am missing out on?:D)
<adrien>
hmmmmm
<adrien>
you better be sure you're not mixing your own ocaml with distro packages
<ubuntu>
you can open something inside a certain scope
<lewis1711>
oh yeah. uninstall ubuntu's ocaml first
<adrien>
but I think there is a PPA for ocaml 3.12, not sure at all however (not using ubunut)
<ubuntu>
made an sudo apt-get update and then apt-get upgrade, and then apt-get install ocaml, but still the old version is going to be installed?
zerny has quit [Remote host closed the connection]
<lewis1711>
that's an ubuntu question not an ocaml question
seafood has quit [Ping timeout: 265 seconds]
RyanRN has quit [Quit: Leaving.]
mfp has quit [Quit: Leaving]
mfp has joined #ocaml
<mfp>
gildor: if you're still interested, I've added a thread pool to ocaml-sqlexpr, allowing non-blocking, multicore-enabled (can evaluate multiple queries in parallel) use with Lwt
yezariaely has joined #ocaml
yezariaely has left #ocaml []
jm has joined #ocaml
seafood has joined #ocaml
<gildor>
mfp: thx, will package it ASAP (if you have done a release)
mike_mcclurg has joined #ocaml
<gildor>
ubuntu: "apt-cache policy ocaml" should explain what is going on
opla2 has joined #ocaml
jcwjcw has joined #ocaml
<jcwjcw>
does anyone have a good list of all the already implemented alternative syntaxes for ocaml?
<ubuntu>
gildor: i have two things in the version table, but still it doesnt install the right version
<jcwjcw>
noone?
opla2 has quit [Ping timeout: 264 seconds]
rks has quit [Read error: Connection reset by peer]
rks has joined #ocaml
surikator has joined #ocaml
lewis1711 has left #ocaml []
<gildor>
ubuntu: does 3.12 appear in this list of version
<ubuntu>
yes
<gildor>
jcwjcw: there is only original syntax and revised syntax
<jcwjcw>
really?
<gildor>
jcwjcw: most of the other alternative syntaxes only cover very specific areas
<jcwjcw>
It seems like someone should make an extension that makes ocaml more friendly to c/java programmers
<gildor>
e.g. i18n, arithmetic operation, SQL queries
<gildor>
jcwjcw: OCaml (and functional PL in general) is different on all levels wrt to c/java
<jcwjcw>
I undersatnd
<gildor>
jcwjcw: syntax should be minor issue in this case
<jcwjcw>
you're preaching to the choir
<jcwjcw>
But I also care about the success of the language
<gildor>
ubuntu: what is the priority of the 3.12 version in this list (a number)
<jcwjcw>
it would help the popularity if there was a "skin" on top of ocaml that made it more familiar
<gildor>
jcwjcw: there is many other factor for language popularity
<jcwjcw>
Right. Unfortunately this is a major one though
<jcwjcw>
Why do you think js looks the way it does?
<gildor>
jcwjcw: e.g. Erlang syntax is different to C/Java but it is more popular than OCaml
<adrien>
I can't really find doc on "pkglag" ("distribution navigator"): anyone know what it does, what it's good for?
<kaustuv_>
gildor: in oasis plugin DevFiles, what does "it aims to provide good old entry points" mean? Do you mean that it provides the standard all/install/clean/distclean/etc targets?
<jonrafkind>
it seems I cannot add methods to class B and have it be a subtype of class A, so whats the point of subtypes?
<mrvn>
jonrafkind: you can coerce B to A if it has all of the signature of A.
<jonrafkind>
but isn't it usually more useful to add to the signature of B?
<mrvn>
obviously
<jonrafkind>
so then you can't coerce B to A in that case
<mrvn>
sure you can. as said. you can coerce if it has all of the signature of A
<jonrafkind>
well i just tried adding one method to B and it said "cannot coerce to A because A doesnt have getx"
<mrvn>
# class a = object method a = 1 end class b = object inherit a method b = 2 end let b = new b let a = (b :> a);;
<mrvn>
class a : object method a : int end
<mrvn>
class b : object method a : int method b : int end
<mrvn>
val b : b = <obj>
<mrvn>
val a : a = <obj>
<jonrafkind>
ah ok mine didnt work because I had a method with eq:'a -> bool and object(self:'a)
<jonrafkind>
so B has a B type as the parameter for eq, but A has an A type
<kaustuv_>
jonrafkind: you should read the manual about binary methods. There is a reason why .equals() usually takes a superclass of all classes as input and does downcasting.
<mrvn>
That should probably be 'a. 'a -> boo constraint 'a :> 'self
<mrvn>
or something
<jonrafkind>
so the only way to do equality is to escape the type system?
<kaustuv_>
It's not escaping the type system, it's just that binary methods are just not a good fit for OO
<jonrafkind>
i thought downcasting could produce a runtime error
<kaustuv_>
downcasting is simply unavailable in OCaml
<kaustuv_>
(for very good reasons -- downcasting is evil)
<jonrafkind>
ohh you were talking about java with .equals()
<mrvn>
jonrafkind: one common thing is to have a method as_base that returns the base class
<kaustuv_>
jonrafkind: I think you will get more out of 10 minutes of reading that manual link I posted than discussing it here, because it is not a trivial issue
<mrvn>
kaustuv_: That example with comparable goes a bit far though imho.
<jonrafkind>
why do you need to say #comparable instead of just comparable?
gildor has quit [Ping timeout: 240 seconds]
<mrvn>
iirc that can best be described as typeof()
<jonrafkind>
but typeof is a runtime thing, i thought signatures were static
gildor has joined #ocaml
<mrvn>
"The type #point used below in the constraint clause is an abbreviation produced by the definition of class point. This abbreviation unifies with the type of any object belonging to a subclass of class point."
<mrvn>
typeof() is certainly a compile time thing
<mrvn>
Scroll up to 3.10 Parameterized classes. Its used first there
<ubuntu>
gildor: can you give me some more advise how to get the ocaml 3.12.0 on my computer?
<mrvn>
jonrafkind: plain comparable would only match exactly that type.
<jonrafkind>
well yes, but supposdly method dispatch should find the proper method at runtime
<mrvn>
it does.
<jonrafkind>
so it seems like getting a "comparable" class is enough
<mrvn>
jonrafkind: then the caller has to coerce to make the type system happy iirc.
<kaustuv_>
jonrafkind: "comparable" is a *name* for a particular type, whereas "#comparable" is a type constraint that matches all subtypes of comparable. If you used just "comparable", you'd always have to call min as: min (x :> comparable) (y :> comparable)
<mrvn>
Not all of the details make sence from a usage point but some are dictated by the type inference.
<mrvn>
s/seence/sense/
<jonrafkind>
ok
<mrvn>
jonrafkind: From a usage point the extra methods/values added in the derived classes could make the base comparison function wrong. Then you would use "comparable". With "#comparable" you say comparing derived classes is specifically allowed.
<jonrafkind>
ok i dont totally understand but ill play around with it, thanks though
<kaustuv_>
Incidentally, this is exactly the issue with an equals method. You specifically *don't* want the equality method defined in the superclass to be called (i.e., you never want to coerce to the supertype) because the subclasses might make different distinctions.
<mrvn>
It depends on wether you want to compare different subclasses, just the superclass or same subclass.
<mrvn>
you can write the function for each of those.
<kaustuv_>
Right, there are always situations when something makes sense in OO, but
<kaustuv_>
it's hard to say what makes sense always
<kaustuv_>
It's basically why no other language that I am aware of has structural subtyping
<mrvn>
I miss coercion between {a:int;} and {a:int;b:int;}
jm has quit [Remote host closed the connection]
alpounet has quit [Remote host closed the connection]
alpounet has joined #ocaml
<adrien>
http://blog.xfce.org/2008/10/devhelp-assistant-for-vim/ : "Automatically display API documentation in Devhelp as you type in Vim" (also available for emacs), with a .ogv video ; I definitely want that for ocaml and lablgtk2 =)
<gildor>
the "Package: *" is in file /etc/apt/preferences ?
<ubuntu>
gildor: yes
<gildor>
humm ubuntu
<ubuntu>
sounds bad
<gildor>
try apt-get -t sid install ocaml
<ubuntu>
Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: ocaml : Depends: ocaml-nox-3.12.0 E: Broken packages
<gildor>
ubuntu: new error?
<ubuntu>
the same as with apt-get install ocaml
<gildor>
ubuntu: you mean nothing has changed
<ubuntu>
yes
<gildor>
last try (then I give up)
<ubuntu>
gildor: i really appreciate all the effort you put in so far, thanks a lot
<mrvn>
if you can't get the preferences right then do purge it all, put just the one source in sources.list and install.
<ubuntu>
the weird things is, after removing the ocaml package, purge says no ocaml package is installed, i still can invoke the ocaml toplevel interpreter
<mrvn>
which ocaml
<ubuntu>
the old 3.11
<mrvn>
no, type that
<ubuntu>
what do you mean?
<mrvn>
type "which ocaml" and press return
<ubuntu>
usr/bin/ocaml
<mrvn>
ocaml-interp: /usr/bin/ocaml
<mrvn>
different package
<ubuntu>
do not really understand where going at?
<mrvn>
you need to remove ocaml-interp to get rid of the ocaml interpreter.
<ubuntu>
should i purge all ocaml related packages?
seafood has joined #ocaml
<mrvn>
you don't seem to be able to install the once you want without it.
<mrvn>
"ones" even
<ubuntu>
so what to do?
<kaustuv_>
Until ocaml 3.12 enters unsable, why not just use GODI? (It's what I did.)
<kaustuv_>
unsTable
<ubuntu>
it s the version i have to work with for the company
seafood has quit [Ping timeout: 276 seconds]
coucou747 has quit [Ping timeout: 240 seconds]
coucou747 has joined #ocaml
edwin has quit [Remote host closed the connection]
BiDOrD has joined #ocaml
ygrek has quit [Ping timeout: 240 seconds]
avsm has quit [Quit: Leaving.]
<jm>
I am about to write a(n AST) pretty printer. Is there any library around that makes the task a little bit less unpleasant (apart from Format, that is)?
alexyk has joined #ocaml
<alexyk>
anybody has a pagerank implementation in ocaml?
<mfp>
jm: there are several camlp4 syntax extensions that can generate pretty-printers automatically given the type definition
ikaros has quit [Quit: Leave the magic to Houdini]
<alexyk>
mfp: hi! if anybody would know about a pagerank in ocaml, that would be the author of eigenclass, I'd suppose :)
<mfp>
heh, eigenvector for the dominant eigenvalue
<mfp>
don't remember seeing any around
arubin has quit [Quit: arubin]
<alexyk>
there's one even in perl; is telling about the kind of things ocaml is *not* used for...
<mfp>
does it work with large sparse matrices? the toy version is trivial to implement
<adrien>
not used for search engines? well, it is :P
<jm>
mfp: That sounds too good to be true! How does camlp5 relate to camlp4?
<mfp>
jm: camlp5 is a fork of camlp4, derived (and compatible with) camlp4 pre-3.10. It is usually used to compile syntax extensions that haven't been ported to camlp4 post-3.10
<mfp>
*derived from
<kaustuv_>
Note, camlp5 is still maintained and usually gets support for new OCaml syntax before camlp4!
<mfp>
indeed
<adrien>
alexyk: are they "implementations" or simply querying?
<mfp>
jm: http://code.google.com/p/deriving/ (and jaked's 3.12-compatible version) and sexplib (serialization to S-expressions) can probably help you