jlouis_ has quit [Read error: 110 (Connection timed out)]
<ozzloy>
how do i end an inner nested match with without ending the outter?
<ozzloy>
match a with b -> match c with d -> e | _ -> f (*now i want to end "match c with"*)
<ecc>
put the whole inner match in parens (or begin ... end)
<ozzloy>
ecc: thans
<ozzloy>
thanx
<ozzloy>
....
<ozzloy>
i fail
cs130wan has joined #ocaml
StoneNote_ is now known as StoneNote
middayc has joined #ocaml
seafood_ has joined #ocaml
jlouis has quit [Remote closed the connection]
jlouis has joined #ocaml
jlouis has quit [Remote closed the connection]
jlouis has joined #ocaml
jlouis has quit [Remote closed the connection]
mwc_ has joined #ocaml
authentic has joined #ocaml
jnkm_ has joined #ocaml
seafood_ has quit [calvino.freenode.net irc.freenode.net]
kbidd has quit [calvino.freenode.net irc.freenode.net]
ertai has quit [calvino.freenode.net irc.freenode.net]
huh has quit [calvino.freenode.net irc.freenode.net]
Mr_Awesome has quit [calvino.freenode.net irc.freenode.net]
Demitar has quit [calvino.freenode.net irc.freenode.net]
munga has quit [calvino.freenode.net irc.freenode.net]
__suri has quit [calvino.freenode.net irc.freenode.net]
yminsky has quit [calvino.freenode.net irc.freenode.net]
jnkm has quit [calvino.freenode.net irc.freenode.net]
mattam has quit [calvino.freenode.net irc.freenode.net]
gim has quit [calvino.freenode.net irc.freenode.net]
jnkm_ is now known as jnkm
mattam has joined #ocaml
yminsky has joined #ocaml
__suri has joined #ocaml
kbidd has joined #ocaml
ertai has joined #ocaml
huh has joined #ocaml
Mr_Awesome has joined #ocaml
gim has joined #ocaml
munga has joined #ocaml
AxleLonghorn has joined #ocaml
AxleLonghorn has left #ocaml []
Demitar has joined #ocaml
mwc_ has quit [Remote closed the connection]
mwc has left #ocaml []
middayc has quit [Read error: 110 (Connection timed out)]
seafood_ has joined #ocaml
<cs130wan>
i am trying to remove duplicates from a list using tail recursion
<cs130wan>
let removeDuplicates l =
<cs130wan>
let rec helper (seen,rest) =
<cs130wan>
match rest with
<cs130wan>
[] -> seen
<cs130wan>
| h::t ->
<cs130wan>
let seen' = [h]@seen in
<cs130wan>
let rest' = t in
<cs130wan>
helper (seen',rest')
<cs130wan>
in
<cs130wan>
List.rev (helper ([],l))
<cs130wan>
;;
<cs130wan>
that's what i have so far
pango has quit [Remote closed the connection]
<cs130wan>
i don't see how i can "check" to see if it has seen a item before
pango has joined #ocaml
<flux>
cs130wan, List.mem h seen ?
seafood_ has quit []
<flux>
you can write h::seen instead of [h]@seen
ttamttam has joined #ocaml
ttamtta1 has joined #ocaml
ttamtta1 has quit [Client Quit]
ttamttam has quit [Client Quit]
ttamttam has joined #ocaml
jderque has joined #ocaml
Tetsuo has joined #ocaml
cs130wan has quit ["cs130wan has no reason"]
ygrek has joined #ocaml
seafood_ has joined #ocaml
seafood_ has quit []
seafood_ has joined #ocaml
seafood_ has quit [Client Quit]
asmanur has joined #ocaml
thermoplyae has quit ["daddy's in space"]
rwmjones has joined #ocaml
jderque has quit [Read error: 113 (No route to host)]
ita has joined #ocaml
filp has joined #ocaml
jderque has joined #ocaml
Yoric[DT] has joined #ocaml
<Yoric[DT]>
hi
Jedai has joined #ocaml
bluestorm has joined #ocaml
jderque has quit [Read error: 113 (No route to host)]
<Yoric[DT]>
Mmhhh....
<Yoric[DT]>
Is there any way for me to specify that a function only accepts polymorphic variants ?
<Yoric[DT]>
(but any of these)
<mfp>
let f (x : [>]) = x;;
<xavierbot>
Characters 13-15:
<xavierbot>
Parse error: ">" or "|" or [row_field] expected after "[" (in [ctyp])
<xavierbot>
let f (x : [>]) = x;;
<xavierbot>
^^
<xavierbot>
Characters 15-16:
<xavierbot>
Parse error: illegal begin of top_phrase
<flux>
hm
<flux>
that works for me :-o
<mfp>
huh? that parses fine in ocaml
<Yoric[DT]>
That's what I tried, too.
<Yoric[DT]>
Without success.
<flux>
maybe it's a version thing
<flux>
3.09.2
<mfp>
3.10.1
<rwmjones>
it's probably because of camlp4
<mfp>
let f (x : [> ]) = x;;
<rwmjones>
xavierbot, restart yourself
<xavierbot>
<xavierbot>
Assertion failed, file "camlp4/Camlp4/Struct/Camlp4Ast2OCamlAst.ml", line 262, char 8
<xavierbot>
Objective Caml version 3.10.0
<xavierbot>
Camlp4 Parsing version 3.10.0
<rwmjones>
^^
<Yoric[DT]>
mmhhh....
<Yoric[DT]>
It does send camlp4 on an infinite loop.
<Yoric[DT]>
So I wasn't crazy, it was a camlp4 bug.
<mfp>
camlp4o doesn't choke on let f (x : [> ]) = x ([> ] instead of [>]) here
<Yoric[DT]>
Well, mine does.
<Yoric[DT]>
Perhaps I should upgrade to 3.10.1 .
* Yoric[DT]
wonders how to do that with GODI.
<mfp>
hmmm camlp4o pr_o.cmo foo.ml works, camlp4o pr_r.cmo foo.ml dies. Are you using the revised syntax?
<Yoric[DT]>
ah, ok
<Yoric[DT]>
No, I was using the original.
<flux>
I've been installing godi for a few days now to a solaris machine.. the build of ocamlnet was bad, and I need to redo it, but it fails as parts of the libraries have already been ocamlfind installed
<flux>
and I fail to spot the libraries that cause trouble :)
<flux>
but maybe now..
<Yoric[DT]>
mmhhh....
<Yoric[DT]>
Cannot retrieve package list.
<Yoric[DT]>
Ok, wrong godi.conf.
<Yoric[DT]>
Upgrade in progress.
jderque has joined #ocaml
Mr_Awesome has quit [Read error: 110 (Connection timed out)]
Mr_Awesome has joined #ocaml
bluestorm has quit ["Konversation terminated!"]
<Yoric[DT]>
Ok, with the upgraded OCaml, it works.
marmottine has joined #ocaml
rwmjones_ has joined #ocaml
xavierbot has quit [Read error: 113 (No route to host)]
rwmjones has quit [Read error: 113 (No route to host)]
love-pingoo has joined #ocaml
marmottine has quit [Read error: 110 (Connection timed out)]
ulfdoz has quit [Read error: 110 (Connection timed out)]
marmottine has joined #ocaml
Morphous_ has joined #ocaml
bzzbzz has quit ["Lost terminal"]
bzzbzz has joined #ocaml
Morphous has quit [Read error: 110 (Connection timed out)]
<flux>
godi isn't very fast.. I wonder how fixable that is.
<flux>
I'm thinking it'll go linearly (?) slower when more packages come in..
<flux>
is there a way to extract the godi database and incorporate it to another host?
<flux>
like dpkg --get-selection | ssh remote-host dpkg --set-selection
jderque has quit [Read error: 113 (No route to host)]
<mfp>
I thought it was just a problem with native threads
<mfp>
since Java 6 -server was about as fast
postalchris has joined #ocaml
<bla>
I guess Event was most slow here.
<bla>
But implementation with fork and Unix.pipes was also slow (I even haven't sent it.)
<bla>
Maybe pity. It could be interesting to compare.
AxleLonghorn has quit [Read error: 110 (Connection timed out)]
AxleLonghorn has joined #ocaml
<mfp>
bla: with 503 processes??
<bla>
;-)
<Yoric[DT]>
I sent one using pipes, they didn't bother putting it online :(
<Yoric[DT]>
And yeah, it was slooooow :)
<mfp>
maybe it killed their box? :P
<bla>
I'd use normally clone() without cloning some memories which fork() does.
<bla>
But I found no Ocaml-clone interface.
<bla>
It's more Linux than Unix.
<mfp>
I implemented thread-ring using lwt some time ago, it was about 30% slower than GHC (mostly GC)
<mfp>
actually not 30%, ~10s vs ~7s for GHC IIRC
ulfdoz has joined #ocaml
AxleLonghorn has left #ocaml []
jderque has joined #ocaml
marmottine has quit [Read error: 113 (No route to host)]
<jlouis>
I am pondering stealing GHC's meteor-contest and wrapping it into SML for MLton. After a bit of cleanup it should be stealable for OCaml. But I am far from finished yet.. ;)
<jlouis>
(Shootout btw ;)
postalchris has quit [Read error: 110 (Connection timed out)]
rwmjones has joined #ocaml
<Yoric[DT]>
Lightweight threads are now supposed to be forbidden.
<Yoric[DT]>
Including manual scheduling.
<rwmjones>
one shouldn't use threads anyway ...
<Yoric[DT]>
Which happened after I rewrote the concurrency contests to use the same algorithm as Python.
<Smerdyakov>
Yoric[DT], wow, what a lame restriction.
<Yoric[DT]>
(and along the way went from 3x slower than Python to 15x faster)
<Yoric[DT]>
Which prompted them to remove a number of submissions.
<Smerdyakov>
Including yours?
jderque has quit ["leaving"]
<Yoric[DT]>
starting with mine, I assume :/
|Catch22| has quit []
<jlouis>
Yoric[DT]: lightweight threads as in userland-based?
<jlouis>
Because then you can remove most of the Erlang entries as well
<jlouis>
and most of the GHC ones I presume
ygrek has quit [Remote closed the connection]
postalchris has joined #ocaml
marmottine has joined #ocaml
|Catch22| has joined #ocaml
rwmjones has quit ["Closed connection"]
postalchris has quit ["Leaving."]
postalchris has joined #ocaml
<Yoric[DT]>
jlouis: "cooperative threads… and other programs with custom schedulers will be listed as interesting alternative implementations"
<jlouis>
Yoric[DT]: aww, then the shootout is irrelevant
<jlouis>
It would be much more interesting to have a shootout into which different (PL-idiomatic) solutions were posted to problems
<jlouis>
and where performance doesn't really matter that much
jbu311 has joined #ocaml
<jbu311>
can someone explain try ... with exn -> ... to me? I understand what's supposed to go after "try", but what's supposed to go after "with exn ->"
<Smerdyakov>
"exn" isn't part of the syntax.
<Smerdyakov>
Have you read the tutorial in the OCaml manual?
<jbu311>
i've looked at it
<Smerdyakov>
"try...with" isn't there?
<jbu311>
i might not be looking at the official one, one sec
<mbishop>
try <some code here> with <some exception that the code will throw> -> <some code to handle what happens if you receive the exception>
<jbu311>
mbishop, thanks, that makes sense, i guess i just dont understand the example i'm looking at
<jbu311>
but what you explained makes sense
<jbu311>
thanks
<jbu311>
I guess I'm having trouble making sense of "with _ -> begin"
<Smerdyakov>
jbu311, did you read the tutorial?
<jbu311>
does that just mean "when you encounter any error whatsoever"?
<jbu311>
smerdyakov, the tutorial is not very readable to me
<jbu311>
but yes, it does help
<mbishop>
_ is used in pattern matching to mean anything, so "with _" will catch any exception, yes
<jbu311>
all the manual says is "try expr with pattern-matching "
<pango>
btw exceptions are not always errors
<Smerdyakov>
jbu311, again, I'm suggesting the tutorial, not the reference section.
<Yoric[DT]>
If you know about exceptions in Java, C# or C++, you can just consider that this use of "with" is a variant on "catch".
mwc has joined #ocaml
<jbu311>
got it
<jbu311>
the syntax is kinda tricky, i just started trying to program in ocaml this morning
<Yoric[DT]>
Actually, I largely prefer the syntax of OCaml to that of most languages.
<jbu311>
it's interesting
<Yoric[DT]>
It's shorter and can be made to match more closely specifications than, well, many other languages.
<mwc>
I'd prefer whitespace, like Haskell or Python
<mwc>
but that's about it
<Yoric[DT]>
Well, that was the "almost" part :)
<Yoric[DT]>
s/almost/most/
thermoplyae has joined #ocaml
Mr_Awesome has joined #ocaml
<pango>
I'd like a syntax that makes it easier to move parts of code around. Current syntax is quite good, but not perfect (let <=> let in when embedding top level definitions, open constructs like match that can break,...)
<pango>
; as a terminator instead of a separator would probably also help in this
<flux>
mwc, I suppose you're aware of twt?
<mwc>
flux, I am
<jbu311>
would anyone kindly help me figure out why the commented line is giving me an error? I am following an example perfectly (I guess not) and am still getting errors...URL: http://rafb.net/p/K2Gtk148.html
<Yoric[DT]>
pango: what about the revised syntax ?
<Yoric[DT]>
jbu311: upper-case, I guess.
<Yoric[DT]>
Variables can't have upper-case names.
<jbu311>
Yoric, thanks, i'll try that
<Yoric[DT]>
To this, I would add that whatever you're doing looks rather un-OCaml-ish.
<jbu311>
uppercase, is only for functions?
<Yoric[DT]>
No, only for constructors and module names.
<jbu311>
Yoric[DT] haha, yes, i'm very unfamiliar with ocaml
<Yoric[DT]>
Usually, for this kind of thing, you'd rather have one recursive loop (instead of "while true"), in which you'd carry forward your "L" and "Q" (or whichever name you want to give them).
<Smerdyakov>
You would definitely have gotten this information from the manual's tutorial.
<Yoric[DT]>
jbu311: I have recently read a very good book on OCaml, called _OCaml for scientists_.
<Yoric[DT]>
And I'd recommend my own tutorial except for the fact that a) it's not finished b) it's in French :)
<pango>
Yoric[DT]: I don't like all the changes in revised syntax, so while it's probably better from that point of view, I never felt like switching