flux changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | Grab OCaml 3.10.2 from http://caml.inria.fr/ocaml/release.html (featuring new camlp4 and more!)
bohanlon has joined #ocaml
longh has quit [Remote closed the connection]
netx has left #ocaml []
<Quadrescence> thelema: You there? :O
<Quadrescence> Any other linux/ubuntu users around?
struktured has quit [Read error: 60 (Operation timed out)]
struktured has joined #ocaml
<hcarty> Quadrescence: Yes
<Quadrescence> Hum, I am just trying to set up GODI now.
ertai has joined #ocaml
<Quadrescence> getting some fun errors. :/
alexyk has joined #ocaml
<hcarty> Quadrescence: Post them to a pastebin site and hopefully I or someone else here can help
<hcarty> Quadrescence: I'd recommend installing godi somewhere under $HOME
<Quadrescence> hum, okay.
<hcarty> Unless you plan on sharing the install with several users on a system
<Quadrescence> Nope
<hcarty> It isn't really designed for a "build as me, install as root" compilation and installation pattern
<hcarty> I have it installed under ~/Applications/godi/ and added ~/Applications/godi/bin and sbin/ to $PATH
<hcarty> It makes package management, for both godi and manually installed packages, simpler
<Quadrescence> Should I install as root?
<hcarty> Quadrescence: No, I would recommend installing as your user
<Quadrescence> alright
<hcarty> Set the prefix to something in your home directory, and do everything as your user
<hcarty> The user which will be using the godi install
<Quadrescence> hcarty: Hehe, this seems to be working a lot nicer.
<Quadrescence> :}
ozy` has quit []
<hcarty> Quadrescence: That's good to hear :-)
struktured_ has joined #ocaml
struktured has quit [Read error: 60 (Operation timed out)]
jeddhaberstro has quit []
pango has quit [Remote closed the connection]
jeddhaberstro has joined #ocaml
<alexyk> just tried to build me some packages in godi, got this:
<alexyk> > ===> Building for godi-bin-prot-1.2.2godi1
<alexyk> > ...
<alexyk> > ocamlfind ocamlopt -pack -o bin_prot.cmx nat0.cmx common.cmx unsafe_common.cmx unsafe_write_c.cmx write_ml.cmx unsafe_read_c.cmx size.cmx re
<alexyk> ad_ml.cmx write_c.cmx read_c.cmx type_class.cmx map_to_safe.cmx binable.cmx utils.cmx
<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
flux changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | 3.11.0beta1 available from http://caml.inria.fr/pub/distrib/ocaml-3.11/ | Or grab OCaml 3.10.2 from http://caml.inria.fr/ocaml/release.html
<toots> flux: thks for answers, I'll be doing more testings...
<flux> happy bughunting
<toots> ;)
<toots> yeheee
|jeremiah has joined #ocaml
<mfp> is it possible to create a pack module with extra str_items (types, exceptions & values) in addition to the modules compiled with -for-pack?
<mfp> something like ocamlopt -c -o pack.cmx -pack packed.cmx pack.ml doesn't work -> "Please specify the name of the output file, using option -o"
<mfp> I have modules B and C which I want to place under A, but I also want some types + functions in A
<mfp> a workaround is to compile B and C with -for-pack A_pack, then in A do include A_pack, but I'd prefer a clean, direct way
longh has joined #ocaml
vixey has joined #ocaml
Morphous has quit [Read error: 110 (Connection timed out)]
Morphous has joined #ocaml
tar_ has joined #ocaml
tar_ has quit [Client Quit]
tar_ has joined #ocaml
tar_ has quit [Remote closed the connection]
toots has quit [Read error: 113 (No route to host)]
_y_ has joined #ocaml
<_y_> http://rafb.net/p/CzsXnS20.html -- please help, I do not understand this bit of code
<fremo> is it the function keyword that you dont understand ? add take another anonymous argument.
<_y_> no, that part's clear
<fremo> fold_right ?
<vixey> you should explain what you don't understand
<_y_> I suppose what's confusing me is the fold_right on a recursive function
<_y_> I can't visualize it
<_y_> no no, I understand the OCaml syntax just fine, and the sematics of the functional programming constructs involved
<vixey> _y_: so is my modification correct?
<_y_> I just don't understand what this function actually does, despite the lenghty comment
<_y_> yes, seems so
<fremo> it depends on the join parameter behaviour...
<_y_> or well, no, your translation is not completely correct, because add references join which is not in scope
<_y_> yes, and there are examples of joins, each of which makes sense
<vixey> _y_: huh
<vixey> oh I see what you mean
<_y_> there are the joins
<_y_> each of which is perfectly comprehensible on their own
<_y_> (context: this is the switch generation portion of a compiler)
<_y_> but still, exactly how merge works eludes me
<flux> _y_, well, it constructs a list backwards
<flux> _y_, and merges the first element of the current list, if it can
<flux> _y_, are you familiar with using folds for constructing lists?
<_y_> not for constructing lists
filp has quit ["Bye"]
<flux> for example let map f l = List.fold_right (fun x xs -> f x::xs) l [];;
<flux> folds are quite useful when converting for example sets to lists, or vice versa
<flux> try writing those ;)
<_y_> ok, so your example would just construct a list backwards, while applying f to each element?
<flux> yes
<_y_> ok, I think I see what it's doing
<_y_> it takes the elements of the current list, backwards, and tries to apply the join function to each one successively
<vixey> backwards??
<_y_> yes, due to the fold_right
<vixey> sometimes I write
<_y_> if they are able to be joined, it applies the join function with the result of the join and the next element of the list
<vixey> (fun x ys -> ...)
<vixey> in the fold
<_y_> I'm not sure I follow
<vixey> List.fold_right (fun x ys -> _) _
<vixey> rrather than x xs
<flux> perhaps it would be warranted, as x has different type than the elements of ys
<flux> but otherwise.. well, I use short names in short functions ;)
<_y_> ok, it just joins the successfully-joined element with the next item of the list, trying to join as many elements as it can together
<vixey> by the way have you seen stuff like
<vixey> List.fold_right (fun i t -> i + t) numbers 0;;
<vixey> List.fold_right (fun i t -> i * t) numbers 1;;
<_y_> adding and multipling all of the numbers together
<_y_> with 0 and 1 as the base case respectively
<_y_> yes, I'm not an idiot when it comes to functional programming, but the snippet I pasted eluded me
<flux> folds are quite useful functions
<vixey> umm?I wasn't calling you an idiot
pango has quit [Remote closed the connection]
<_y_> ah, sorry
<_y_> well, thanks everybody, I'll be off then
<flux> happy hacking
_y_ has quit []
pango has joined #ocaml
Yoric has quit [Remote closed the connection]
jlouis has joined #ocaml
toots has joined #ocaml
<toots> hi all again !
<toots> flux: ping ?
<flux> pong
<toots> yea
<toots> when I use Unix.close_process, are the in/out channel closed too ?
<flux> you know, I've never thought of that, but I would very much expect that
<toots> yes me too
<toots> I got my bug now :)
<toots> thks !
Yoric has joined #ocaml
Snark has quit [Remote closed the connection]
toots has left #ocaml []
<Yoric> ertai: ping
Camarade_Tux has quit [Read error: 104 (Connection reset by peer)]
Camarade_Tux has joined #ocaml
gdmfsob has quit [Read error: 110 (Connection timed out)]
Snark_ has joined #ocaml
Snark_ is now known as Snark
tomh has joined #ocaml
marmotine has joined #ocaml
<hcarty> Are "undefined symbol: caml_alloc" and similar messages from "ldd -r dllsome-ocaml-c_stubs.so" normal?
<hcarty> I get them for all of the dll*_stubs.so files in my godi install - core libs, godi packages, and manually installed libraries
_zack has quit ["Leaving."]
struktured__ has quit [Read error: 110 (Connection timed out)]
tomh has quit ["http://www.mibbit.com ajax IRC Client"]
_Jedai_ has quit [Connection reset by peer]
Jedai has joined #ocaml
Yoric has quit ["Ex-Chat"]
OChameau has quit ["Leaving"]
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> in the output
jeddhaberstro has joined #ocaml
<rwmjones_> hcarty, hey ... just a sec
<rwmjones_> $ ldd -r /usr/lib64/ocaml/stublibs/dllbigarray.so
<rwmjones_> undefined symbol: caml_compare_unordered(/usr/lib64/ocaml/stublibs/dllbigarray.so)
<rwmjones_> undefined symbol: caml_local_roots(/usr/lib64/ocaml/stublibs/dllbigarray.so)
<rwmjones_> undefined symbol: caml_serialize_int_1(/usr/lib64/ocaml/stublibs/dllbigarray.so)
<rwmjones_> undefined symbol: caml_stat_free(/usr/lib64/ocaml/stublibs/dllbigarray.so)
<rwmjones_> [...]
<hcarty> rwmjones_: Thanks
<rwmjones_> undefined symbol: caml_copy_int64(/usr/lib64/ocaml/stublibs/dllbigarray.so)
<rwmjones_> undefined symbol: caml_copy_nativeint(/usr/lib64/ocaml/stublibs/dllbigarray.so)
<rwmjones_> undefined symbol: caml_sys_error(/usr/lib64/ocaml/stublibs/dllbigarray.so)
<rwmjones_> linux-vdso.so.1 => (0x00007fff519ff000)
<rwmjones_> libc.so.6 => /lib64/libc.so.6 (0x0000000000315000)
<rwmjones_> /lib64/ld-linux-x86-64.so.2 (0x0000003ac7200000)
<rwmjones_> hcarty, I don't want to post the whole thing or freenode will kick me off for flooding :-(
<hcarty> rwmjones_: That's plenty, thanks :-)
<rwmjones_> hcarty, I think I've got a debian machine around if you want that too?
<hcarty> rwmjones_: If possible, that would be great
<hcarty> rwmjones_: Just a confirmation that is is more or less the same would be enough
<hcarty> rwmjones_: Specifically, all of the "undefined symbol: caml_*" lines
<rwmjones_> hcarty, basically it's the same on a debian machine ... not sure if it's precisely the same symbols, but it looks very similar
<rwmjones_> $ ldd -r /usr/lib/ocaml/3.10.2/stublibs/dllbigarray.so
<rwmjones_> undefined symbol: caml_compare_unordered(/usr/lib/ocaml/3.10.2/stublibs/dllbigarray.so)
<rwmjones_> undefined symbol: caml_local_roots(/usr/lib/ocaml/3.10.2/stublibs/dllbigarray.so)
<rwmjones_> undefined symbol: caml_serialize_int_1(/usr/lib/ocaml/3.10.2/stublibs/dllbigarray.so)
<rwmjones_> undefined symbol: caml_stat_free(/usr/lib/ocaml/3.10.2/stublibs/dllbigarray.so)
<rwmjones_> undefined symbol: caml_deserialize_block_8(/usr/lib/ocaml/3.10.2/stublibs/dllbigarray.so)
<rwmjones_> undefined symbol: caml_deserialize_block_4(/usr/lib/ocaml/3.10.2/stublibs/dllbigarray.so)
<rwmjones_> undefined symbol: caml_alloc_custom(/usr/lib/ocaml/3.10.2/stublibs/dllbigarray.so)
<rwmjones_> [etc]
<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)]
Jedai has joined #ocaml
christo_m has joined #ocaml
<christo_m> http://pastebin.com/m3ce6096c this doesnt do what iwant to do (it locks up)
<christo_m> im trying to calculate the absolute value of n before i find it's totient
<christo_m> i also want to make sure the value of n isnt 0 and tha tishould return 1 if it is
<christo_m> so i just added "if n = 0 then 1 else"
christo_m has quit ["Lost terminal"]
<Yoric[DT]> What's the easiest way of producing XML from a data structure these days?
<Yoric[DT]> IO-XML doesn't exist anymore, does it?
dobblego has quit ["Leaving"]
dibblego has joined #ocaml
christo_m has joined #ocaml
<christo_m> flux: you've been able to help me thus far
<christo_m> any ideas?
* Yoric[DT] is getting each week more impressed by his team.
<Yoric[DT]> Two weeks ago, it was "by the way, we forgot to tell you but you have 24h to write a draft chapter."
<Yoric[DT]> Tonight, it is "by the way, did someone tell [me] that he's giving a talk in about 12h?"
<Yoric[DT]> (hint: it's 1am)
jeddhaberstro_ has joined #ocaml
<Yoric[DT]> for what values does it lock up?
<Camarade_Tux> speaking of which I should do my work for tomorrow, 8am, I can't get myself to do it :d
<Yoric[DT]> Well, I'm giving a lab class tomorrow at 8am and I have no clue what I'm going to ask.
<Camarade_Tux> but I'll blame the internet, it suddenly got too active, both mailing-list, #ocaml, mails, ... =)
<Yoric[DT]> :)
<Yoric[DT]> Oh, and I'm supposed to produce some assignment for tomorrow morning, too.
<Yoric[DT]> christo_m: for what values does it lock up?
<christo_m> did you see the source?
<Camarade_Tux> I'm sure you'll manage to make everything (ne pas perdre espoir est le plus important ;) )
<Yoric[DT]> christo_m: yes
<Yoric[DT]> Camarade_Tux: merci :)
<christo_m> christo_m
<christo_m> woops
<Yoric[DT]> Oh, yeah, and I'm supposed to produce a demo for tomorrow, of course.
<Yoric[DT]> On a piece of software which I was told to deliver next January.
<christo_m> Yoric[DT]: i dont know it just doesnt work for negative values as it hsould
<Yoric[DT]> christo_m: do you know what #trace does?
<christo_m> no
<Yoric[DT]> Well, it's a debugging tool.
<Yoric[DT]> I suggest doing
<Yoric[DT]> #trace gcd
<Yoric[DT]> and then testing your code.
<Yoric[DT]> It should help you find the problem.
ulfdoz has quit ["deprecated"]
<christo_m> Yoric[DT]: im not relaly sure how to use it..
<christo_m> where do i put #trace gcd??
<Yoric[DT]> In the toplevel.
<Yoric[DT]> You're using the toplevel, aren't you?
<christo_m> you tell me..
<Camarade_Tux> christo_m, which command are you running ? ocaml, ocamlc or ocamlopt ?
tomh has joined #ocaml
<christo_m> Camarade_Tux: ocaml
<christo_m> im running it in the interpreter to test.
<Yoric[DT]> Well, it's called the top-level :)
<Yoric[DT]> Now, in the toplevel, if you haven't done so yet, write down your functions.
<Yoric[DT]> Then write
<Yoric[DT]> #trace gcd;;
<Yoric[DT]> Then test your code.
<christo_m> (sigh)
<christo_m> can you just tell me what's wrong..
<christo_m> i think ill learn better that way
<Yoric[DT]> Sorry, it's against my religion.
<vixey> yuck
<christo_m> god knows im just learning this language because the course is forcing me
<Yoric[DT]> So just because you're not interested, giving you the answer should make you learn better?
<vixey> if you aren't interested in ocaml then I don't think this is a good place for you
<christo_m> this is a place to discuss ocaml, as judging by the topic
<vixey> exactly
<christo_m> i don thave to share my love of the language to be here
<christo_m> Yoric[DT]: no, at least telling me what the issue is with abs becuase it works without it
<christo_m> that much i know, unfortunately the requirements in the assignment make it mandatory that i check for negative values of n
<Yoric[DT]> I'm not quite sure I understand your assignment.
<Yoric[DT]> Still, have you tried what I suggested?
<christo_m> Yoric[DT]: are you familiar with eulers totient function?
<Yoric[DT]> Not in the slightest.
<christo_m> no i havent because i don't understand what to do
<Submarine> aaaah
<Yoric[DT]> I'm sorry I can't be much clearer.
<Yoric[DT]> I gave you the exact line to write down.
<christo_m> Yoric[DT]: yes and where is the top level exactly
<Submarine> it's the cardinal of the mulitplicative group of Z/nZ
<Submarine> and it's trivial to compute once you know how to factor n
<christo_m> Submarine: :)
<Yoric[DT]> As I mentioned above, it's what you call "the interpreter".
<christo_m> okay so the problems with gcd
<christo_m> i just looked at it now
<Yoric[DT]> good
<christo_m> Yoric[DT]: does ocaml hvae a gcd-like function?
jeddhaberstro has quit [Read error: 110 (Connection timed out)]
<Yoric[DT]> I don't think so.
<christo_m> im going to assume the problem is i didnt pass abs of n to gcd's arguments
<Yoric[DT]> That's clearly a possibility.
<christo_m> well i overlooked it
<christo_m> it appears to be working now
<christo_m> thank you for your help
<christo_m> excuse my ignorance, im young
<Yoric[DT]> My pleasure.
<Yoric[DT]> Well, I'm going to call this a night.
<Yoric[DT]> Have fun with your assignments.
<christo_m> good luck with you pres
<Yoric[DT]> Cheers everyone.
<Yoric[DT]> Thanks.
<christo_m> s/you/your
<Camarade_Tux> good night ;)
Yoric[DT] has quit ["Ex-Chat"]
Jedai has quit [Read error: 104 (Connection reset by peer)]
Jedai has joined #ocaml
christo_m has quit ["Lost terminal"]