<alexyk>
> File nat0.cmx was not compiled with the `-for-pack Bin_prot' option
<alexyk>
now where does nat0.cmx come from and how do I fix it? it prevents other stuff from building and I can't r=emove it
struktured__ has joined #ocaml
alexyk has quit []
struktured_ has quit [Read error: 110 (Connection timed out)]
struktured_ has joined #ocaml
struktured__ has quit [Read error: 110 (Connection timed out)]
alexyk has joined #ocaml
pango has joined #ocaml
<alexyk>
any fixes for godi-bin-prot build error, le nat0.cmx was not compiled with the `-for-pack Bin_prot' --?
jeddhaberstro has quit []
alexyk has quit []
struktured_ is now known as struktured
alexyk has joined #ocaml
struktured_ has joined #ocaml
struktured has quit [Read error: 110 (Connection timed out)]
rstites has quit [Remote closed the connection]
Associat0r has quit []
Associat0r has joined #ocaml
alexyk has quit []
Associat0r has quit []
pierre- has joined #ocaml
pierre- has quit [Read error: 110 (Connection timed out)]
rpg has joined #ocaml
<rpg>
how do i set a list of 1000 units
<rpg>
or a dynmaic list even
pantsd has joined #ocaml
Yoric[DT] has joined #ocaml
seafood has joined #ocaml
seafood has quit [Client Quit]
mishok13 has joined #ocaml
Yoric[DT] has quit ["Ex-Chat"]
kmm has joined #ocaml
<kmm>
Hello
<flux>
rpg, hmm.. lists are dynamic by their nature. you aren't talking about an array, are you?
gdmfsob has joined #ocaml
<flux>
rpg, unfortunately constructing lists out of nothing without additional libraries is a bit of a chore, but here's a trick: let l = Array.to_list (Array.init 1000 (fun i -> i))
mishok13 has quit [Read error: 104 (Connection reset by peer)]
<kmm>
Hi, I'm having trouble understanding some of the base syntax of ocaml
<kmm>
If I need to write a function prod l : int list -> int, what does that mean?
<pango>
kmm: a function that takes an int list as parameter, and returns an int
<flux>
case in point: List.length
<flux>
actually, no :)
<flux>
List.length is more general
<flux>
but works as int list -> int too
<kmm>
pango: so prod is the name, it takes l as a parameter which is an int list, and -> means returning?
<flux>
kmm, -> means returning, but for that kind of explanation you need to understand that functions only really take exactly one argument
<kmm>
ah right
<flux>
(which is significant when you have multiple -> in the same signature)
<flux>
but you can think it this way: foo : a -> b -> c : foo is a function that takes a and b and returns c
<kmm>
ah
<kmm>
I'm supposed to write a function which takes l and returns the product of all of its members
<kmm>
where l is an int list
<flux>
learning ocaml at a school?
<kmm>
Yeah
<flux>
wouldn't they explain all those thingies about type signatures?-)
<kmm>
Yeah but I still find it hard to grasp when coming from language that always just do type name(param,param,param);
<kmm>
languages*
<flux>
kmm, the advanced explanation about a -> b -> c: it's actually interpreted as the same as (a -> (b -> c))
<kmm>
ah
<flux>
so take a in and return a function that takes b in and returns c
<kmm>
gotcha
<kmm>
so I'm supposed to loop through a list and get the product of everything, 1 if not (so I should just multiply a var initially as 1 by each element)
<kmm>
I have an example for sum of each:
<kmm>
let rec sum l = match l with [] -> 0 | (x::xs) -> x + (sum xs)
<kmm>
Unfortunately I'm not quite sure what that's doing.
<flux>
unfortunately the lesson begun, so I'll be silent now
<kmm>
what?
<flux>
(I'm at school)
<kmm>
ahhhh
<kmm>
hmm anyone else able to help me make sense of this code?
<pango>
kmm: (I'll need to keep it short to, I have to get ready for work) match does pattern matching on list l
<pango>
kmm: either the list is empty ([]) or it's not, and then it has a head element and a tail list (x :: xs)
<pango>
kmm: what's at the right of ->s are the expressions that need to be evaluated in each case
<pango>
kmm: | is the separator between `match' cases
<pango>
kmm: and the important thing to notice: this definition of sum is recursive (sum function calls itself)
<kmm>
wha's :: ?
<pango>
(hence the `rec' keyword)
<kmm>
right, that's the one part I understand from all of it, heh
lorph has joined #ocaml
<kmm>
I know I need to do something like
<kmm>
let rec prod l = match l with [] -> 0 | (x:xs) -> x * (prod xs)
<kmm>
would that work?
<lorph>
if i have 2 list of chars, how do I create a list of all the char combinations, one from each list? I can only think of how to do it imperatively
<kmm>
It gives me 0 apparently.
<kmm>
which is not the product of [1;2;3]
<kmm>
but I know why, because my x is initially 0
<kmm>
How can I adapt it to have x as one before I start through?
<pango>
kmm: try to translate this function definition into english
pantsd has quit [Remote closed the connection]
<kmm>
that's part of my problem >_<
<kmm>
what should I be reading it as?
<pango>
kmm: and :: is lists constructor
<pango>
(the other being [])
<pango>
# [] ;;
<pango>
- : 'a list = []
<pango>
# 1 :: [] ;;
<pango>
- : int list = [1]
<pango>
# 2 :: [1] ;;
<pango>
- : int list = [2; 1]
<kmm>
lists constructor?
<pango>
with [] and :: you can build all the lists
<pango>
kmm: think of it as a function for now; :: is a function that takes an element e and a list l, and return another list that looks like the old list with e in front
<kmm>
ahh right
struktured__ has joined #ocaml
<kmm>
1::[2;3] yields [1;2;3]
<pango>
yes
<kmm>
ok I understand that.
<pango>
so if you pattern match [1;2;3] against x :: xs, x will be bound to 1 and xs to [2;3]
Raevel has quit [Read error: 110 (Connection timed out)]
<pango>
s/bound/bind/
<pango>
oups forget last msg
<pango>
yes, if you pattern match [1;2;3] against x :: xs, x will be bound to 1 (list 'head') and xs to [2;3] (list 'tail')
<pango>
that way you can break a list back to its elements
<pango>
(you were not introduced to the concept of pattern matching so far?)
struktured_ has quit [Read error: 110 (Connection timed out)]
filp has joined #ocaml
<kmm>
ah okay
<kmm>
I understand that.
<kmm>
Need to go, thanks for your help!
kmm has quit ["Leaving"]
struk_atwork2 has quit [Read error: 104 (Connection reset by peer)]
<pango>
lorph: if you learned about list append (@), you could first write a function that takes a character c and a list l and return the list of pairs (c, e) with e each element of l; and then a function that uses it to get the expected result
<pango>
(that's not the most efficient implementation, but probably the easiest to write)
rwmjones_ has joined #ocaml
<pango>
afk!
ulfdoz has joined #ocaml
Submarine has joined #ocaml
marmotine has joined #ocaml
petchema has joined #ocaml
OChameau has joined #ocaml
rwmjones_ has quit ["Closed connection"]
<palomer>
a list is stored as a set of pointers, right?
<rwmjones>
palomer, no, it's stored as a sequence of cons cells
<rwmjones>
each element in the list is a struct cons { struct cons *next; struct foo *data; }
<rwmjones>
(that's the 10,000 ft overview anyway)
<palomer>
gotcha
<palomer>
so the size of a list does not depend on what it contains
<palomer>
http://ocaml.pastebin.com/m2e909f07 <-- I just thought up this algorithm, it turns a list into a tree. what makes it different from other traversal algorithms is that it starts from an internal node
<palomer>
any comments?
<palomer>
I would have thought this to be a well understood problem
<palomer>
but I can't find anything similar anywhere
<flux>
palomer, have you looked at zippers?
<flux>
also with all that concatenation going around I doubt that's efficient, am I wrong?-o
<flux>
hmm.. how come that doesn't end up in an infinite loop?
<palomer>
why would it??
<palomer>
and why isn't it efficient?
<palomer>
I've looked at zippers many times
<palomer>
zippers makes mutability a pain
<palomer>
ah yes, concatenation
<palomer>
oh well...
<palomer>
c'est la vie
<palomer>
if you find a linear solution, that would be cool!
<palomer>
inherit [typ] intermixed_with_strings <---This class expression is not a class structure; it has type (unit -> Typ.typ) -> [Typ.typ] Mixins.intermixed_with_strings
<palomer>
what the??!?
<palomer>
google has never even seen this error!
<palomer>
ah, found the error
<lorph>
how do I convert a char to string?
_zack has joined #ocaml
<lorph>
nm
<gildor>
String.make 1 c
<rwmjones>
palomer, isn't the point of using a zipper that you don't need to mutate your data structure?
Yoric has joined #ocaml
<Yoric>
hi
Snark_ has joined #ocaml
mellum has joined #ocaml
<mellum>
Hi. What's the equivalent of popen in ocaml?
marmotine has quit [No route to host]
<Quadrescence>
errrg, ===> TCL/TK not found
<flux>
mellum, open_process_in?
<mellum>
flux: which module is that in?
<flux>
Unix
<mellum>
ok thanks
<mellum>
very clever, keeping names like "getcwd", but not popen
<flux>
whine whine ;)
filp has quit [kornbluth.freenode.net irc.freenode.net]
sporkmonger has quit [kornbluth.freenode.net irc.freenode.net]
kg4qxk has quit [kornbluth.freenode.net irc.freenode.net]
dobblego has quit [kornbluth.freenode.net irc.freenode.net]
TaXules has quit [kornbluth.freenode.net irc.freenode.net]
pango has quit [kornbluth.freenode.net irc.freenode.net]
Asmadeus has quit [kornbluth.freenode.net irc.freenode.net]
mlh has quit [kornbluth.freenode.net irc.freenode.net]
Axioplase_ has quit [kornbluth.freenode.net irc.freenode.net]
mellum has quit [kornbluth.freenode.net irc.freenode.net]
smimram has quit [kornbluth.freenode.net irc.freenode.net]
OChameau has quit [kornbluth.freenode.net irc.freenode.net]
petchema has quit [kornbluth.freenode.net irc.freenode.net]
Submarine has quit [kornbluth.freenode.net irc.freenode.net]
Demitar has quit [kornbluth.freenode.net irc.freenode.net]
Smerdyakov has quit [kornbluth.freenode.net irc.freenode.net]
maxote has quit [kornbluth.freenode.net irc.freenode.net]
xevz has quit [kornbluth.freenode.net irc.freenode.net]
rwmjones has quit [kornbluth.freenode.net irc.freenode.net]
Vital303` has quit [kornbluth.freenode.net irc.freenode.net]
bla has quit [kornbluth.freenode.net irc.freenode.net]
cmeme has quit [kornbluth.freenode.net irc.freenode.net]
ozzloy has quit [kornbluth.freenode.net irc.freenode.net]
mellum has joined #ocaml
OChameau has joined #ocaml
petchema has joined #ocaml
Submarine has joined #ocaml
filp has joined #ocaml
pango has joined #ocaml
Demitar has joined #ocaml
Smerdyakov has joined #ocaml
sporkmonger has joined #ocaml
kg4qxk has joined #ocaml
dobblego has joined #ocaml
maxote has joined #ocaml
Asmadeus has joined #ocaml
xevz has joined #ocaml
rwmjones has joined #ocaml
Vital303` has joined #ocaml
mlh has joined #ocaml
TaXules has joined #ocaml
Axioplase_ has joined #ocaml
cmeme has joined #ocaml
ozzloy has joined #ocaml
bla has joined #ocaml
smimram has joined #ocaml
ulfdoz has quit [Read error: 110 (Connection timed out)]
Linktim has joined #ocaml
vbmithr has quit [kornbluth.freenode.net irc.freenode.net]
azi_ has quit [kornbluth.freenode.net irc.freenode.net]
mbishop has quit [kornbluth.freenode.net irc.freenode.net]
palomer has quit [kornbluth.freenode.net irc.freenode.net]
Linktim has quit [kornbluth.freenode.net irc.freenode.net]
Yoric has quit [kornbluth.freenode.net irc.freenode.net]
struktured__ has quit [kornbluth.freenode.net irc.freenode.net]
bohanlon has quit [kornbluth.freenode.net irc.freenode.net]
Torment has quit [kornbluth.freenode.net irc.freenode.net]
_Jedai_ has quit [kornbluth.freenode.net irc.freenode.net]
snhmib has quit [kornbluth.freenode.net irc.freenode.net]
mattam has quit [kornbluth.freenode.net irc.freenode.net]
thelema has quit [kornbluth.freenode.net irc.freenode.net]
svenl has quit [kornbluth.freenode.net irc.freenode.net]
sbok has quit [kornbluth.freenode.net irc.freenode.net]
lorph has quit [kornbluth.freenode.net irc.freenode.net]
tab has quit [kornbluth.freenode.net irc.freenode.net]
rpg has quit [kornbluth.freenode.net irc.freenode.net]
ertai has quit [kornbluth.freenode.net irc.freenode.net]
pattern has quit [kornbluth.freenode.net irc.freenode.net]
authentic has quit [kornbluth.freenode.net irc.freenode.net]
kelaouchi has quit [kornbluth.freenode.net irc.freenode.net]
Linktim has joined #ocaml
Yoric has joined #ocaml
struktured__ has joined #ocaml
lorph has joined #ocaml
rpg has joined #ocaml
ertai has joined #ocaml
bohanlon has joined #ocaml
Torment has joined #ocaml
_Jedai_ has joined #ocaml
snhmib has joined #ocaml
mattam has joined #ocaml
vbmithr has joined #ocaml
thelema has joined #ocaml
azi_ has joined #ocaml
mbishop has joined #ocaml
pattern has joined #ocaml
palomer has joined #ocaml
svenl has joined #ocaml
sbok has joined #ocaml
authentic has joined #ocaml
tab has joined #ocaml
kelaouchi has joined #ocaml
Camarade_Tux has joined #ocaml
<Quadrescence>
ocaml
Snark_ is now known as Snark
Linktim_ has joined #ocaml
Associat0r has joined #ocaml
Linktim has quit [Read error: 113 (No route to host)]
GustNG has joined #ocaml
munga has joined #ocaml
Quadrescence has quit [Remote closed the connection]
<flux>
ooh, 3.11.0beta1
toots has joined #ocaml
<toots>
lo all !
<toots>
I have a question on Unix.select
<flux>
go on
<toots>
I don't know what to do when there was a select waiting
<toots>
but one of the socket is closed in the mean time
<flux>
you close it from another thread or the peer closes it?
<toots>
yep another thread for instance
<flux>
that's not a good idea
<toots>
no control
<toots>
well it happens
<toots>
:)
<flux>
well
<toots>
I use stdin/out from another process
<toots>
sometimes the process crashes..
<flux>
I guess you can catch the error of bad filedescriptor
<flux>
and then scan all the descriptors for their validity by reading in non-blocking-mode
<flux>
and remove invalid ones
<flux>
(for instance)
<toots>
hum
<toots>
yes
<flux>
but if someone also happens to open a new descriptor in the mean time, funny things can happen, because that descriptor could be the same the select is using..
<toots>
waht are the exc file descriptors for ?
<toots>
I though it was meant for that..
<flux>
no
<flux>
they are for example for OOB
<flux>
(tcp supports sending priority messages)
<toots>
ok, so no interest at all for me...
<flux>
why is the other thread closing the fd without interfacing with the select loop?
<toots>
ok, thanks I'll try to catch the exc and recover then...
<toots>
flux: because in this situation the fd is stdout from another process
<toots>
or stdin
<toots>
and sometimes the process crash
<toots>
=es
<flux>
yes
<flux>
but even if the other end closes the fd, your end won't
<toots>
ha
<toots>
hum
<flux>
you need to Unix.close a socket for it to get closed
<flux>
no other way AFAIK
<toots>
flux: I guess I should do more testings for this issue then
marmotine has quit [Read error: 113 (No route to host)]
pierre- has joined #ocaml
ulfdoz has joined #ocaml
Jedai has quit [Connection reset by peer]
Jedai has joined #ocaml
Yoric[DT] has joined #ocaml
<olegfink>
hi
<olegfink>
is ~type:value a value at all?
<olegfink>
toplevel says it's a syntax error
<vixey>
it looks like a syntax error to me
<olegfink>
errr, that is ~label:value
<olegfink>
e.g. let f ~a = a has type a:'a -> 'a
<olegfink>
so it would seem logical that ~a:1 (as in f ~a:1) would have type a:int
<grirgz>
a:int is defined in the scope of a function definition, it has no meaning outside, you must use let
pierre- has quit [Read error: 110 (Connection timed out)]
<olegfink>
so labeled arguments don't quite fit the type system?
Jedai has quit [Read error: 104 (Connection reset by peer)]
<pango>
I'd say labels are not a type system feature
Jedai has joined #ocaml
<olegfink>
but doesn't it make sense for them to be?
jeddhaberstro has joined #ocaml
<olegfink>
so that I can create arbitrary something:-types that are 'specialiastions' of the right-hand side types
<pango>
wouldn't you then need int_of_a_int and a_int_of_int functions, etc?
<olegfink>
only the latter, which should be implemented with a syntactig sugar a:<value>
<olegfink>
the whole point is to not have the former
<olegfink>
that is, the a:int -> int cast is done by specifying ~a in function definition, exactly like labeled arguments are implemented now.
<pango>
what's the benefit?
<olegfink>
I have a fully type-aware solution to mistaking the order of arguments.
<olegfink>
that is, (/) : divident:int -> divisor:int -> int
<Yoric[DT]>
hi
<olegfink>
hi David
* Yoric[DT]
just loves surprise deadlines.
<olegfink>
pattern matching like let ~a = b could also be handy
GustNG has quit ["Leaving."]
<olegfink>
(or I've just just read too much of Cardelli)
<olegfink>
Yoric[DT]: I've just read 'headlines' and was going to ask which in particular. How's Batteries going, btw?
<Yoric[DT]>
Fine.
<Yoric[DT]>
Today, I've adapted my current research project to use Batteries.
<Yoric[DT]>
Plenty of bug-fixing ensued.
<Yoric[DT]>
Which is a good thing.
<Yoric[DT]>
I also think I've solved the documentation problems which had been plaguing me.
<Yoric[DT]>
So, besides the surprise deadline, things are fine.
<Yoric[DT]>
How are you?
<olegfink>
good, should stop talking nonsense and start developing something in ocaml to try out batteries
<olegfink>
I think I've finally found what: http://t2-project.org/ has a few nice ideas absent both in OE and Gentoo, but their bash-with-lua-accelerator implementation is terrible. I figured it makes some sense to try write a build system in ocaml.
* Yoric[DT]
doesn't know about T2.
* Camarade_Tux
vaguely remembers reading something about T2...
<olegfink>
it's just another take on a build-everything abstraction
<Camarade_Tux>
didn't they have some trouble at some point (I said I *vaguely* remembered ;) )
<olegfink>
such things are handy when you're running a binary-based distro and need to quickly compile something
<olegfink>
Camarade_Tux: maybe, I'm not really following them
<Camarade_Tux>
olegfink, I last read about T2 probably about two years ago when I was wondering which distro to use
<Camarade_Tux>
(went for slackware ^^)
<Camarade_Tux>
but all this tells me to finish my livecd :p
Snark has quit ["Ex-Chat"]
<olegfink>
I don't need T2 as a distro, I'm quite happy with mainstream binary ones, but when I say "compile!", it really has to compile what I want, tracking all the dependencies, optional features, local build system idiosyncrasies etc.
<Camarade_Tux>
olegfink, you're asking quite a lot ! source dependency tracking would require all the sources to be under the same system, that would forbid any "new" application/driver
<Camarade_Tux>
what I have in slackware satisfies me : no -dev packages, installing gtk ? you are also getting the headers and everything needed to compile
<Camarade_Tux>
for my livecd, I am terribly annoyed though : godi fails to initialize because it can't write, it then tells me to look at the log, but since it can't write, there isn't any !
<olegfink>
throw a tmpfs before its namespace?
<olegfink>
errr, wait, wrong speak, mount a tmpfs where it wants to write.
<Camarade_Tux>
why ? especially, I do that half of the time but I don't know how it would help
<olegfink>
it then would write its log to it
<Camarade_Tux>
but I don't understand where it wants to write =/
* Camarade_Tux
has maybe an idea
<olegfink>
strace!
<olegfink>
strace is my second favourite unix shell
<Camarade_Tux>
oh, I know !
<Yoric[DT]>
brrr
<Yoric[DT]>
pcre is scary
<Camarade_Tux>
perl inside :p
<Camarade_Tux>
hmmm, my chroot doesn't seem to chroot anything...
<Camarade_Tux>
oh no, that was simply bash being stupid
<Camarade_Tux>
ok, if I run the command by hand, it works, I *really* hate bash
<olegfink>
use strace :-)
<olegfink>
(instead of bash)
<Camarade_Tux>
well, that would be stracing a bash script running a script-based program from a chroot started with bash and running from bash, that may actually work :p
<olegfink>
that's what modern unix is all about.
<Camarade_Tux>
unfortunately it's not yet really informative
<olegfink>
strace you mean?
<Camarade_Tux>
yes
|Jedai| has joined #ocaml
jeddhaberstro has quit []
<olegfink>
Camarade_Tux: if it doesn't show syscalls that seem related to godi, there's probably something threaded in the chain. Try strace -fF.
<Camarade_Tux>
I had -ff but not -fF, I added it and I now have 14k lines of log, yummy !
<olegfink>
heh.
<Camarade_Tux>
olegfink, great !
<Camarade_Tux>
stat64("/ocaml/bin/patch", 0x77f498c8) = -1 ENOENT (No such file or directory)
<Camarade_Tux>
=) I only have to figure out why it's not looking in /usr/bin !
<olegfink>
but maybe it then tries other (more sensible) locations?
<Camarade_Tux>
oh, it does but later on =/
rwmjones_ has joined #ocaml
<Camarade_Tux>
woot, it works ! thanks a lot, strace has been really helpful
<Camarade_Tux>
basically it decided to use the TMP variable which was set to a path which simply did not exist inside the chroot
itewsh has joined #ocaml
<Camarade_Tux>
now that it downloads and compile, I can do my homework for tomorrow :)
Linktim_ has quit [Read error: 113 (No route to host)]
Jedai has quit [Read error: 110 (Connection timed out)]
<hcarty>
Is someone here using the Debian or Fedora OCaml packages willing to paste the output from "ldd -r dllbigarray.so" for the dllbigarray.so (or any other C stub from the standard lib) to a pastebin?
<hcarty>
I'm using godi and want to check something
<hcarty>
rwmjones_: I'm working on the PLplot bindings, and one of the library devs is concerned about the fact that the dllplplot_stubs.so has these missing symbols listed
<hcarty>
rwmjones_: But it seems to be normal for OCaml-related .so files
<hcarty>
Now if I can find out why to relieve their concerns
<rwmjones_>
hcarty, these symbols are satisfied from the ocamlrun binary itself
<hcarty>
rwmjones_: Ok, thanks. I thought it was something like that
jlouis has quit ["Leaving"]
|Jedai| has quit [Connection reset by peer]
Jedai has joined #ocaml
<hcarty>
rwmjones_: Are the .so stubs used in native code OCaml binaries?
itewsh has quit ["KTHXBYE"]
marmotine has joined #ocaml
marmotine has quit [Read error: 113 (No route to host)]
<rwmjones_>
hcarty, no ... currently the C code is staticly linked
rwmjones_ has quit ["Closed connection"]
Jedai has quit [Read error: 104 (Connection reset by peer)]