<Snrrrub>
Okay, newbie question: why would the compiler insist that my List.filter expression return unit in a function that has the form: let f l = List.filter someFunction l; ()
Mr_Awesome has joined #ocaml
<thermoplyae>
in the expression a ; b (typed as 'a), a is supposed to have type unit and b type 'a
<thermoplyae>
what you actually mean to write above is let f l = ignore (List.filter someFunction l), or maybe let f l = let _ = List.filter someFunction l in ()
<Snrrrub>
So does the expression a <- b have type unit?
mbishop has quit [Remote closed the connection]
<thermoplyae>
it does
<Snrrrub>
I see. Thanks, that clarifies a LOT! :)
<ozzloy>
http://xrl.us/beyoq why doesn't this work? eval_fn is defined in expr.ml
<ozzloy>
is this not the right way to include files?
<Smerdyakov>
#use isn't part of the language.
<Smerdyakov>
It's just a directive for the toplevel.
<Smerdyakov>
There is no language construct to include a file.
<ozzloy>
ok. the ocaml shell we have available to us does not have history. nor do we have rlwrap. do you have a suggestion?
<ozzloy>
what's your environment like for writing ocaml?
sergez_ has quit [Read error: 113 (No route to host)]
<Smerdyakov>
You really should read some of the manual. OCaml has a story for multi-file development just like C does.
<ozzloy>
Smerdyakov: could you provide me with a link to this documentation?
<ozzloy>
Smerdyakov: are you talking about ocaml-tutorial.org?
timchen1` is now known as nasloc__
mbishop has joined #ocaml
Snrrrub__ has joined #ocaml
mbishop has quit ["brb"]
Snrrrub has quit [Read error: 110 (Connection timed out)]
sergez_ has joined #ocaml
mbishop has joined #ocaml
sergez__ has joined #ocaml
sergez_ has quit [Read error: 104 (Connection reset by peer)]
sergez__ has quit [Read error: 110 (Connection timed out)]
Tetsuo has joined #ocaml
sergez_ has joined #ocaml
sergez_ has quit [Read error: 110 (Connection timed out)]
middayc has quit []
AxleLonghorn has joined #ocaml
sergez_ has joined #ocaml
thermoplyae has left #ocaml []
sergez_ has quit [Read error: 110 (Connection timed out)]
Snrrrub__ is now known as Snrrrub
AxleLonghorn has left #ocaml []
<flux>
hmh, does anyone else hate that godi-tools are godi_xx instead of godi-xx - you always need to press shift..
<flux>
I guess it's too late now to fix it :)
pantsd has joined #ocaml
pantsd has quit [Client Quit]
<flux>
sigh, on solaris godi's bootstrap insists on executing /usr/lib/dc, which is a directory (and not in the path even); the real binary would be at /opt/gnu/bin/dc
<jonafan>
you can write a suitable printerf function, and the return value of this function should be whatever printerf returns
<jonafan>
it looks perfectly legal to me
<flux>
I guess there is a reason, dunno if it can be fixed without breaking backwards compatibility (common sense would say so, but common sense might not play quite right here ;))
<jonafan>
the type of foo should be (('a -> string) -> 'a -> 'b) -> t -> 'b
<bla>
But type inferring won't let you do it.
<bla>
And, can it be 'a? What if you pass char to it?
<jonafan>
that 'a is for the printerf function's first argument, to convert the 'a to a string. if you pass something that converts a char to a string, why not?
<flux>
actually that's a point I learned some time ago, but apparently forgot also :)
<jonafan>
i mean, it's not like it's not trivial to write something equivalent in ocaml, but i just don't understand why it doesn't compile
postalchris has quit [Connection timed out]
<cygnus_>
because the first use of it binds the variables to accept int
<cygnus_>
i think you must write it using functors
<flux>
there was a page listing the numerous options on how to write that
<flux>
actually it was for the fix-function, but the problem was similar, I think
<cygnus_>
this is making a polymorphic type , but what is the { } for ?
<bluestorm>
hm
<bluestorm>
it's a struct-like declaration
<bluestorm>
"record"
<bluestorm>
it's a record
<cygnus_>
i thought type must have constructors?
<bluestorm>
type coord = { x : int; y : int }
<bluestorm>
cygnus_: algebraic datatypes must
<cygnus_>
ok so a polymorphic record
<cygnus_>
is the 'a. meaning for all a ?
<bluestorm>
yes
<bluestorm>
it's were rank-2 polymorphism is involved
<bluestorm>
actually rank-2 polymorphism is a quite "elaborate" type-system feature, and i think (but i'm not sure really) it's originally been introduced in OCaml for the object system
<bluestorm>
we can have it in records too
<bluestorm>
but it hasn't been extended to general types
<bla>
Well. It can work without this struct. Can't it?
<bluestorm>
(i guess the added complexity wasn't worth the benefits)
<bluestorm>
bla: i don't think so
<bluestorm>
to use that you have to use a record or an object
<cygnus_>
hmm
<bla>
Hm. I'll try experimenting on clean ocaml then.
<cygnus_>
why can't you just define the function and use it
<bluestorm>
you'll run into a type-inference problem
<pango>
most of this memory should still be shared, Linux does COW (copy on write)
<bla>
With fork()?
<pango>
of course
<bla>
I guess it's not so difficult to 'touch' some memory in such high-level language.
<bla>
Touch one which could be shared otherwise. ;d
<pango>
at least we don't have reference counters
<pango>
but better not enable memory compaction ;)
<pango>
(well, it seldom fires)
<bla>
Hmmm. ;d
<bla>
SHR per process is 188.
<bla>
RES 684, VIRT 11504
<bla>
Pipes are slow.
<bla>
Shared memory segments would be better.
<pango>
memory segments don't provide synchronisation, so you'd need some sort of locks too
<bla>
I could use signals. Wonder how fast they are. ;d
<bla>
real 2m27.703s
<bla>
That's correct answer for their N (10000000)
<bla>
It's still faster than their vanilla implementation. (over 3 minutes!)
<pango>
question is, whether it's a concurrency, or parallelism benchmark. Since they have little requirements for threads kind, I'd say it's concurrency
<bla>
I'll send them today version 2. It's fastest what I can think about without using non-standard threads.
marmottine has quit [Remote closed the connection]
RobertFischer has joined #ocaml
CRathman_ has joined #ocaml
CRathman_ has quit [Remote closed the connection]
RobertFischer has left #ocaml []
CRathman has quit [Read error: 110 (Connection timed out)]
<Yoric[DT]>
Well good night everyone.
Yoric[DT] has quit ["Ex-Chat"]
bluestorm has quit ["Konversation terminated!"]
dramsay has quit [Read error: 110 (Connection timed out)]