willb has quit [Read error: 110 (Connection timed out)]
Platyna has left #ocaml []
Amorphous has quit [Remote closed the connection]
det has quit [Remote closed the connection]
det has joined #ocaml
Amorphous has joined #ocaml
Yoric[DT] has quit ["Ex-Chat"]
realtime has quit [brown.freenode.net irc.freenode.net]
schme has quit [brown.freenode.net irc.freenode.net]
kg4qxk has quit [brown.freenode.net irc.freenode.net]
brendan has quit [brown.freenode.net irc.freenode.net]
realtime has joined #ocaml
schme has joined #ocaml
kg4qxk has joined #ocaml
brendan has joined #ocaml
jonasb has quit [Remote closed the connection]
nuncanada has quit ["Leaving"]
middayc has quit ["ChatZilla 0.9.84 [Firefox 3.0.5/2008120122]"]
|jedai| has quit [Read error: 110 (Connection timed out)]
|jedai| has joined #ocaml
Axioplase_ has quit ["brb"]
Axioplase has joined #ocaml
Ori_B has joined #ocaml
<Ori_B>
hi.
<Ori_B>
I have a rather bizzare type error...
<Ori_B>
I have a function defined as returning a string list
<Ori_B>
let edits word = ...;;
<Ori_B>
doing '"asdf" :: (edits blah)' gives no error, but doing 'iter print_string (edits blah)' says
<Ori_B>
This expression has type string -> unit but is here used with type char -> unit
<Ori_B>
does anyone have any idea what's going wrong here?
christian__ has joined #ocaml
<christian__>
GO Ocaml GO!!!
<Ori_B>
heh. unfortunately, it's not going for me.
<christian__>
nanana
<christian__>
try linux...try opensuse..there is ocaml packages out there that worx
<christian__>
anyone experience with jocaml?
<Ori_B>
christian__: eh, ocaml works for me, but I get a very obscure type error.
<Ori_B>
This expression has type string -> unit but is here used with type char -> unit
<christian__>
wrong type -> wrong thought
<Ori_B>
when I do 'List.iter print_string (edits word)'
<Ori_B>
but 'print_string (List.reduce (fun a b -> a ^ " " ^ b) (edits word))' works
<christian__>
what should it do?
<christian__>
its too late for me to think about it...srry
<christian__>
print_string is not a function...it evaluates to Unit
<christian__>
or so
<christian__>
good night
AxleLonghorn has joined #ocaml
|jedai| has quit [Read error: 110 (Connection timed out)]
|jedai| has joined #ocaml
det_ has joined #ocaml
det has quit [Read error: 104 (Connection reset by peer)]
tar_ has joined #ocaml
|jedai| has quit [Read error: 110 (Connection timed out)]
|jedai| has joined #ocaml
<sanguinev>
Ori_B: Try ("asdf") :: (edits blah)
<sanguinev>
Ori_B: I suspect that OCaml might think "abc" :: "def" == "abc" ^ "def" ?
<sanguinev>
Nevermind.
_jedai_ has joined #ocaml
<thelema>
Hi
|jedai| has quit [Read error: 110 (Connection timed out)]
<Ori_B>
sanguinev: yeah, I have no idea where it's pulling the 'char' from
<Ori_B>
I don't have any variables that should be a char, and other string operations work there too
<thelema>
no, abc::def != abc ^ def
<thelema>
the first is a list, the second a longer string.
<Ori_B>
thelema: any idea what could be causing the error I'm seeing?
<Ori_B>
I can work around it, but I have no clue what the issue could be...
<thelema>
well, it looks like your function ref strings
<thelema>
grr...
<thelema>
your function returns a list of characters?
<thelema>
in haskell, a string is a list of characters, in ocaml, a string is... a string. it's much more like an array, except it's byte indexed, and ocaml arrays are word indexed
<thelema>
'c' is a character. "c" is a string with length 1
<thelema>
"foo" is a string of length 3, 'foo' is not valid
brendan has quit [brown.freenode.net irc.freenode.net]
realtime has quit [brown.freenode.net irc.freenode.net]
schme has quit [brown.freenode.net irc.freenode.net]
kg4qxk has quit [brown.freenode.net irc.freenode.net]
realtime has joined #ocaml
schme has joined #ocaml
kg4qxk has joined #ocaml
brendan has joined #ocaml
<thelema>
btw, [List.reduce (fun a b -> a ^ " " ^ b)] is pretty inefficient - try String.concat
<Ori_B>
thelema: exactly.
<Ori_B>
thelema: which is why I'm so confused.
<Ori_B>
'"asdf" :: (edits word)' typechecks just fine
<Ori_B>
iter print_string (edits word) doesn't
<thelema>
List.iter?
<thelema>
(be careful with your [open]s
<Ori_B>
yes, List.iter
<Ori_B>
it doesn't matter if I add the 'List.'
<Ori_B>
that's the first thing I tried
<thelema>
and the type error for iter is that you have a (string -> unit), but what's expected is a (char -> unit)... hmmm...
<thelema>
the type error is being indicated on print_string, no?
<thelema>
which tells me that somehow it believes that (edits word) has type char list.
<thelema>
I can't explain why (edits word) would work in the context ["asdf"::(edits word)] if it weren't a string list.
<thelema>
even more surprising is that your use of List.reduce fixes things.
<Ori_B>
thelema: yes, I know. If I wasn't a total noob, I'd suspect a compiler bug...
<thelema>
Ori_B: that's quite unlikely. Any chance you can paste your code? (pastebin.ca)
<Ori_B>
give me a minute. it's currently not compiling thanks to me being in the middle of a few edits
<thelema>
just enough to reproduce the problem, of course.
<Ori_B>
(yeah, that's the whole thing. a dumb spellchecker)
<Ori_B>
if you change line 94 to... wait. wtf. it works now.
<Ori_B>
let me find a version that doesn't work, because I want to know what I changed accidentally to make it work
<thelema>
ok.
<thelema>
you should write [let parse_args () = ...] - without the () will cause it to be evaluated immediately. with () delays execution
<thelema>
it's not too bad to have code like that executed before the "main" function, but stylistically it's undesirable
<Ori_B>
thelema: ah, thanks
<thelema>
ah, the problem is iter vs. iter. when you do [open List;; open String;;], if there's any functions in both, the string version hides the List one.
<buzz0r>
already tried it with wxruby + Shoes (another ruby gui)
<rwmjones>
a long time ago someone did some wxwidgets bindings, however using swig so it probably sucked
<buzz0r>
it helps compiling ruby modules from ocalm
<buzz0r>
yes, last updated 2004 :)
<buzz0r>
Ill try to email the gui that is actually doung it with wxpython somehow and ask him to put his sample on the net again. Ill give you the link then.
<buzz0r>
hmm
|jedai| has quit [Operation timed out]
<buzz0r>
rwmjones: did you have good experinces with perl4caml?
|jedai| has joined #ocaml
<rwmjones>
well I wrote it, so yes
<buzz0r>
oh great
<rwmjones>
anyhow yes it works fine ... uses lots of memory and is quite slow, but that's entirely down to perl itself
<buzz0r>
thats ok with me. wow this is a great piece of work you made! thanks a lot you work on this
<buzz0r>
hmm
<buzz0r>
so, do you think it would be possible to use wxperl?
<buzz0r>
form ocaml?
<rwmjones>
yeah, I see no reason why it won't work. You'll have to use the "low level" perl bindings, unless you go to the effort of wrapping them in nice high level OCaml objects. See the source to perl4caml for how to do that.
<itewsh>
I also need to check whether I have a "GET" and a "HTTP"
vpalle has joined #ocaml
<mrvn>
itewsh: again, split by " "
<mrvn>
or rather "[ \t]*"
<mrvn>
or lookup the regexp for an url and http request and use them.
<mrvn>
in the RFCs
<itewsh>
hum ok
<itewsh>
hmm*
jak3 has joined #ocaml
<jak3>
is it possible to write a method that accepts variable of any type?
<bluestorm>
you mean, polymorphism ?
<jak3>
yes
<jak3>
for example can i want an 'add' function that can add both ints and floats
<jak3>
can i write*
<bluestorm>
that's not the same thing
<bluestorm>
you can easily write a function that does the same thing over any type
<bluestorm>
let couple x = (x, x)
<bluestorm>
'a -> 'a * 'a
<mrvn>
jak3: no. But you can write a type that can hold either int or float and add those.
<bluestorm>
what you want is to do a _different_ thing on different types, that's ad-hoc polymorphism and not supported
<psnively>
But see g'caml.
<jak3>
ok thanks
<mrvn>
Or, if you have a couple (and more complex) of such functions, you can write a functor that you instantiate with the basic arithmetic functions.
<psnively>
Yeah, and there's the delimited overloading camlp4 extension, too.
vpalle has quit [Connection timed out]
vpalle has joined #ocaml
|jedai| has quit [Read error: 110 (Connection timed out)]
|jedai| has joined #ocaml
pango has quit [Remote closed the connection]
OChameau has quit [Read error: 113 (No route to host)]
pango has joined #ocaml
ygrek has joined #ocaml
Associ8or has joined #ocaml
_zack has quit ["Leaving."]
_zack has joined #ocaml
<Yoric[DT]>
Ok, documentation generation worked around.
<Yoric[DT]>
Gasp, the Batteries toplevel works but Emacs/Tuareg doesn't like it :(
<hcarty>
Yoric[DT]: Is the Batteries master git branch 3.11-safe?
psnively has quit []
<Yoric[DT]>
Should be.
<Yoric[DT]>
Give me 30 seconds to commit.
<hcarty>
And I missed your ping the other day ... was it just a request for testing?
<Yoric[DT]>
Yes.
<Yoric[DT]>
Pushed.
<jonafan>
today i must write visual basic .net
<hcarty>
Yoric[DT]: pulled and building here...
<Yoric[DT]>
hcarty: thanks :)
<Yoric[DT]>
jonafan: sympathies :(
<jonafan>
i wonder.... i use vb .net for this particular task because its pretty good at COM
<jonafan>
i wonder if F# would be good at COM as well
<jonafan>
VB .NET doesn't care when you attempt to send messages to COM objects that it doesn't know the interface for
<jonafan>
I'd imagine that if F# treated these objects the same way ocaml treats classes and objects, it'd be great