authentic has quit [Read error: 110 (Connection timed out)]
^authentic is now known as authentic
Mr_Awesome has quit [Read error: 110 (Connection timed out)]
smimou has quit ["bli"]
buluca has quit [Read error: 113 (No route to host)]
ertai_ has quit [Read error: 110 (Connection timed out)]
nuncanada has quit ["Leaving"]
seafood_ has joined #ocaml
seafood_ has quit [Read error: 104 (Connection reset by peer)]
seafood_ has joined #ocaml
seafood_ has quit [Read error: 104 (Connection reset by peer)]
seafood_ has joined #ocaml
seafood_ has quit [Read error: 104 (Connection reset by peer)]
seafood_ has joined #ocaml
seafood_ has quit [Client Quit]
seafood_ has joined #ocaml
pango has quit [Remote closed the connection]
pango has joined #ocaml
seafood_ has quit [Read error: 110 (Connection timed out)]
<eck>
i have a simple question (i think)... i'm learning ocaml, and I wrote a small program to factor numbers using big_int, but when I run it I get an error that I don't know how to troubleshoot; code at http://pastebin.com/d560f8533
<eck>
the error is Fatal error: exception Invalid_argument("equal: abstract value")
darinm has joined #ocaml
<eck>
ah, i found the problem
seafood_ has joined #ocaml
rayno has quit [Read error: 110 (Connection timed out)]
jlouis has joined #ocaml
jlouis_ has quit [Read error: 110 (Connection timed out)]
ygrek has joined #ocaml
<eck>
i have another question... how can I fold * across a list? (*) is interpreted as a comment
<flux>
( * )
<eck>
thanks
rayno has joined #ocaml
<mbishop>
( * ) is the reason why you should space all infix functions that way :P
seafood_ has quit [Read error: 104 (Connection reset by peer)]
rayno has quit [Connection timed out]
d2bg has joined #ocaml
Tetsuo has joined #ocaml
kelaouchi has quit [Read error: 110 (Connection timed out)]
ita has quit [Read error: 104 (Connection reset by peer)]
<pango>
eck: don't know if you modified it since you posted your code, but the comparison function you give to List.fast_sort does not match the expected behavior of comparison functions in OCaml library
<pango>
eck: it should behave like Pervasives.compare
ita has joined #ocaml
bluestorm_ has joined #ocaml
det has quit [Read error: 104 (Connection reset by peer)]
kelaouchi has joined #ocaml
bluestorm_ has quit [Remote closed the connection]
ertai_ has quit [Read error: 110 (Connection timed out)]
authentic has quit [Read error: 113 (No route to host)]
ertai_ has joined #ocaml
Yoric[DT] has joined #ocaml
hkBst has quit ["Konversation terminated!"]
mrsolo_ has quit ["Leaving"]
ita has quit [Read error: 110 (Connection timed out)]
seafood_ has joined #ocaml
seafood_ has quit [Read error: 104 (Connection reset by peer)]
ertai_ has quit [Read error: 110 (Connection timed out)]
smimou has joined #ocaml
ikaros_ has joined #ocaml
ikaros has quit [Read error: 110 (Connection timed out)]
ita has joined #ocaml
rayno has joined #ocaml
Yoric[DT] has quit [Read error: 110 (Connection timed out)]
mordaunt has quit [Remote closed the connection]
mordaunt has joined #ocaml
ttamtta1 has left #ocaml []
pango has quit [Remote closed the connection]
pango has joined #ocaml
dbueno has joined #ocaml
d2bg has left #ocaml []
mordaunt has quit [Read error: 104 (Connection reset by peer)]
ygrek_ has quit [Remote closed the connection]
ygrek_ has joined #ocaml
Yoric[DT] has joined #ocaml
dbueno has quit ["Leaving"]
Yoric[DT] has quit [Client Quit]
asmanur has quit [Connection timed out]
david_koontz has joined #ocaml
pango has quit [Remote closed the connection]
rayno has quit [Read error: 110 (Connection timed out)]
pango has joined #ocaml
ygrek_ has quit ["Leaving"]
ita has quit ["Hasta luego!"]
screwt8 has quit [Remote closed the connection]
Abo-Marwan has quit [Remote closed the connection]
screwt8 has joined #ocaml
Abo-Marwan has joined #ocaml
david_koontz has quit []
david_koontz has joined #ocaml
kazzmir has joined #ocaml
<kazzmir>
can I not declare classes in the body of a let?
<Smerdyakov>
kazzmir, have you consulted the language grammar in the manual?
<kazzmir>
i briefly looked at it.. i hate reading bnf
<jlouis>
kazzmir: so you insulted the language grammar ... ?
<jlouis>
Better read it since it will contain the anser
l_a_m has quit [Remote closed the connection]
Mr_Awesome has joined #ocaml
joshcryer has quit [Client Quit]
buluca has joined #ocaml
al___ has joined #ocaml
<al___>
can Str.regexp do back-references and if so how? let regexpr = Str.regexp("^(.+)\\1\\1$");; doesn
<al___>
't seem to match "aaa"
<pango>
but Str.regexp "^\\(.+\\)\\1\\1$" does
<al___>
aahh why escape ()?
joshcryer has joined #ocaml
<pango>
because \( and \) are used for grouping, not ( and )
<al___>
there was a ubuntu package for it, i installed it... there's no docs and none of the examples in the readme run... i don't even know how to include it
<al___>
is there anything else? this seems unmaintained
<al___>
open Pcre;; gives "unbound module"
joshcryer has quit [Nick collision from services.]
joshcryer has joined #ocaml
<pango>
use ocamlc -I +pcre pcre.cma or ocamlopt -I +pcre pcre.cmxa; Alternatively use ocamlfind to add the correct parameters for you (ocamlfind ocaml{c,opt} -package pcre -linkpkg ...)
<hcarty>
al___: I'll second the Pcre over Str recommendation. It's a much nicer module to work with.
<al___>
i think Str's is regex engine bogus anyway \\(.+\\)\\1\\1 doesn't match baabaabaabaa
<pango>
it's it print_endline (s ^ "\n"); printing non-matching strings ?
<al___>
yeah it comes from the non_matched line
bluestorm_ has quit ["Konversation terminated!"]
<al___>
but aabaaaaaa should match
<pango>
how so?
<al___>
it contains a substring, "a", repeated 3 times
<pango>
string_match does left-anchored search
<al___>
ah
<al___>
i didn't know that
<pango>
val string_match : regexp -> string -> int -> bool
<pango>
(** [string_match r s start] tests whether a substring of [s] that
<pango>
starts at position [start] matches the regular expression [r].
<pango>
(from str.mli)
<pango>
well, I agree that's still slightly ambiguous
<al___>
i don't think that implies left-anchored
<al___>
but i understand now why it's not working
<pango>
you can either add .* at the beginning of your regexp, or use Str.search_forward (its contract is slightly different from string_match however; It raises an exception if no match is found)
<al___>
the .* doesn't work right either
<al___>
oh it does... sorry.... too many a's and b's close together
<pango>
I guess you're looking for strings that _don't_ match? (= don't have 3 consecutive repetitions anywhere)
<al___>
yeah
<pango>
since you're building new strings by adding a letter to a string that already has that property, you know that the consecutive repetitions _must_ involve the added character
<al___>
ultimately i want to do something related to the group b(2,3) which is the group on two generators such that anything cubed goes to the identity
<pango>
so the algorithm would still be correct if you right-anchored the regexp
<al___>
yes
<al___>
i see... that probably would make it faster too
<pango>
I doubt the regexp engine will be smart enough to optimize this however. So you could add the new letters to the front and use a left-anchored regexp instead
<al___>
free-group on two generators
<al___>
pango thanks for the tip
<pango>
np
d2bg has quit ["ERC Version 5.3 (devel) (IRC client for Emacs)"]
<pango>
that will be faster, but still very string allocation and copy intensive... With a small low-level optimization you can cut that in half, but ultimately I wonder if using strings and regexpes is the fastest way...