flux changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | 3.11.0 out now! Get yours from http://caml.inria.fr/ocaml/release.html
jlouis has quit ["Leaving"]
<alexyk> so I managed to compile stuff, now it won't load:
<alexyk> # #load "crilm/lmclient.cma";;
<alexyk> Cannot load required shared library dlllmclient.
<alexyk> Reason: dlllmclient.so: this file is not a proper bundle.
<alexyk> when doing ocamlmklib -o lmclient -lstdc++ $(MYLIBS) lmclient.o, I provide .a static libs in MYLIBS -- should I produce .so's instead?
<alexyk> is that the reason the dll..so didn't load, or can I get a more specific info?
snhmib_ has joined #ocaml
willb has quit [Read error: 110 (Connection timed out)]
vixey has quit [Connection timed out]
jurjen2 has joined #ocaml
snhmib has quit [Read error: 110 (Connection timed out)]
jurjen2 has quit [Client Quit]
snhmib_ has quit [Read error: 110 (Connection timed out)]
<alexyk> well, it works in a script, but not when loaded as cma
alexyk has quit []
pumpkin_ is now known as pumpkin
alexyk has joined #ocaml
<alexyk> so how do we get a pointer from C, to denote a (wrapped) C++ object, for passing back to C when needed?
pumpkin has quit []
pumpkin_ has joined #ocaml
pumpkin_ has left #ocaml []
threeve has joined #ocaml
struktured_ has quit [Connection timed out]
<alexyk> I get garbage from CAMLreturn (caml_copy_nativeint(--num_clients));
<alexyk> why?
<alexyk> I actually get garbage on CAMLlocal1 (result);
<alexyk> result = caml_copy_nativeint(1);
jeddhaberstro has joined #ocaml
jeddhaberstro has quit []
fschwidom has quit [Read error: 104 (Connection reset by peer)]
shortc|desk has joined #ocaml
shortc|desk has quit [Client Quit]
struktured_ has joined #ocaml
<alexyk> well, it's bizarre, but I can't return an integer from C; while strings are easy
<alexyk> anybody recently returned an int from C?
mwhitney has quit ["WeeChat 0.2.6"]
Amorphous has quit [Read error: 145 (Connection timed out)]
apples` has quit ["sleep"]
mwhitney has joined #ocaml
Amorphous has joined #ocaml
sporkmonger has quit []
<flux> alexyk, what is the ocmal type of the function?
<alexyk> flux: external create : string -> int -> int = "lmclient_create"
<alexyk> I;m completely flabbergasted
<flux> alexyk, nativeint is not the same as int..
<alexyk> flux: I tried int32 and int64...
<flux> how about nativeint?
<alexyk> what should I copy for int return?
<flux> you should use Int_val or Val_int, I don't remember
<alexyk> hmm... but why isn;t there a caml_copy_int?
threeve has quit []
<flux> because they don't need to be allocated
<alexyk> so how do I return an int then? Val_int, really?
<alexyk> Int_val(value) fetches a value from the int
<alexyk> i.e. int from teh value :)
<alexyk> flux: Val_int works!
<alexyk> I owe you a bottle of wine for this :)
<flux> well, you can give it to me next time you visit Finland ;)
<alexyk> flux: surely then :) I'd love to get into a conference in Helsinki
paul424 has joined #ocaml
mbishop has quit [Read error: 113 (No route to host)]
mbishop has joined #ocaml
alexyk has quit []
<paul424> type 'a t = ('a array ref, int, int ref , int ref );; why I got type error ?
<flux> type 'a t = ('a array ref * int * int ref * int ref );;
<flux> btw, you get a syntax error, not a type error
<paul424> flux: yeap already noticed that, thanks anyway
<paul424> hmm also have a strange problem ......
<paul424> flux: if one writes some data structures functionaly, it will type dynamicaly during program excecution
<paul424> flux: but I have to write some data structure imperativly, and to postpone the typing .....
<paul424> type 'a t = 'a array ref * int * int ref * int ref ;; and then somwhere let empty size = (Array.make size , size,ref 0 ,ref 0);;
<paul424> flux: do you get it /
<paul424> ehh anyone, please ......
ygrek_ has joined #ocaml
<olegfink> paul424: Array.make is 'a array, not 'a array ref
<paul424> ohh ok
Stefan_vK has quit [Read error: 104 (Connection reset by peer)]
mbishop_ has joined #ocaml
Stefan_vK has joined #ocaml
mbishop__ has joined #ocaml
paul424 has quit ["ChatZilla 0.9.83 [Firefox 3.0.4/2008102920]"]
mbishop has quit [Read error: 110 (Connection timed out)]
mbishop_ has quit [Read error: 113 (No route to host)]
ygrek_ has quit [Remote closed the connection]
Kerris7 has joined #ocaml
ikaros has joined #ocaml
Kerris7 has quit []
_zack has joined #ocaml
jeremiah has quit [Read error: 104 (Connection reset by peer)]
__me has joined #ocaml
jeremiah has joined #ocaml
jeremiah has quit [Read error: 104 (Connection reset by peer)]
Yoric[DT] has joined #ocaml
ygrek_ has joined #ocaml
ikaros has quit [".quit"]
Kerris7 has joined #ocaml
jeremiah has joined #ocaml
asabil has joined #ocaml
hkBst has joined #ocaml
marmotine has joined #ocaml
seafood has joined #ocaml
Kerris7 has quit []
middayc has joined #ocaml
Kerris7 has joined #ocaml
rwmjones_ has joined #ocaml
ygrek_ has quit [Remote closed the connection]
rwmjones has quit [Read error: 113 (No route to host)]
olgen has joined #ocaml
seafood has quit []
rwmjones_ is now known as rwmjones
sporkmonger has joined #ocaml
sporkmonger has quit [Client Quit]
Kerris7 has quit []
slash_ has joined #ocaml
vixey has joined #ocaml
alexyk has joined #ocaml
sporkmonger has joined #ocaml
Optikal__ has quit [Remote closed the connection]
ikaros has joined #ocaml
<alexyk> the folks at c++ have a robot parsing it; would be cool to put an ocaml robot here... we could call it Xav :) Then you'd say, xav: let a = 1;; -- and it'll print the result... May combine with codepad.org which evals already
alexyk has quit []
alexyk has joined #ocaml
<alexyk> actually, we can just call it caml
alexyk has quit [Client Quit]
alexyk has joined #ocaml
<flux> alexyk, or maybe it could be called xavierbot..
<alexyk> is it there already? :)
<flux> it has been at times
<alexyk> so did it retire?
<flux> I guess nobody just isn't running it regularly. also, there were some issues with unintentional activation.
* alexyk runs out
alexyk has quit []
<flux> could be fixed with required addressing; it was activated (iirc) with the prefix #
<rwmjones> flux, patch me baby
petchema__ has joined #ocaml
<flux> rwmjones, where's the git/darcs repo?-)
<rwmjones> flux, it's umm nowhere ...
<rwmjones> actually gildor ^^ ?
petchema_ has quit [Read error: 110 (Connection timed out)]
Camarade_Tux has joined #ocaml
jeremiah has quit [Read error: 104 (Connection reset by peer)]
Camarade_Tux has quit [Remote closed the connection]
Camarade_Tux has joined #ocaml
jeremiah has joined #ocaml
middayc_ has joined #ocaml
middayc has quit [Read error: 110 (Connection timed out)]
ygrek_ has joined #ocaml
willb has joined #ocaml
jeremiah has quit [Read error: 104 (Connection reset by peer)]
Gionne has joined #ocaml
__me has left #ocaml []
<Gionne> hello, how do i avoid the last prod? http://pastebin.com/m363243a9
<vixey> Gionne, why is Epsilon "of string"?
olgen has quit []
ikaros has quit [".quit"]
<vixey> Gionne, its []-> [Prod(x, [])] by the way
<vixey> (if I understand what you were asking)
<Gionne> uhm
<Gionne> i don't need the void prod at the end
<vixey> Gionne, so think about the line of code I pasted
<Gionne> it comes from the [] case, i know, but i don't want it
<Gionne> maybe just a []->[]^
<Gionne> ^
<Gionne> ?
<Gionne> yes it is ;)
<Gionne> thanx vixey
pango has quit [Remote closed the connection]
<vixey> ok
jeremiah has joined #ocaml
alexyk has joined #ocaml
robocop has joined #ocaml
pango has joined #ocaml
middayc_ has quit []
jeremiah has quit [Read error: 104 (Connection reset by peer)]
<robocop> Hello.
<robocop> What the name of the function mod, but with floats ?
<flux> it's.. *drumroll* mod_float!
<flux> ;)
Kerris7 has joined #ocaml
<robocop> Hum, okey, thanks.
alexyk has quit []
jeremiah has joined #ocaml
asabil has quit [Read error: 104 (Connection reset by peer)]
noshadow has joined #ocaml
alexyk has joined #ocaml
alexyk has quit []
alexyk has joined #ocaml
willb1 has joined #ocaml
willb2 has joined #ocaml
willb1 has quit [Read error: 60 (Operation timed out)]
alexyk has quit []
willb has quit [Read error: 113 (No route to host)]
<mbac> ocaml really enhanced the quality of the work environment for me
<mbac> exhibit a: http://xkcd.com/303/
<Yoric[DT]> :)
<robocop> It the first time that i'm using regex, and I've got a problem. I would like replace "5+(-2)" by 5+-2
noshadow has left #ocaml []
<robocop> I write : let f = Str.regexp ".*([+|-]?[0-9]+).*" ;;
<robocop> and Str.global_replace f "5+(-2)" "\0";; to test.
<robocop> but i've got : Warning X: illegal backslash escape in string.
<robocop> - : string = "\\0"
<robocop> I've you got an idea ?
<Optikal_> Are you using regex for symbolic manipulation??
_zack has quit ["Leaving."]
<robocop> what ?
<Yoric[DT]> robocop: I believe you should use "\\0".
<robocop> Yoric[DT]: yes, but now, i've got string = "\\0"; and me, i want "5+".
<Yoric[DT]> Oh, you only want to replace the last occurrence, is that it?
<Yoric[DT]> Sidenote: I believe I agree with Optikal_'s unsaid suggestion: regexpes are often evil.
<robocop> Hum, ok.
<robocop> And, what to you use to replace "-5-2+(-2)+3" by "-5- 2+-2+3"
<robocop> ?
<vixey> robocop, what's the program for?
<Yoric[DT]> Frankly, I'd first parse the string and then proceed to rewriting the AST.
<Yoric[DT]> Just to be sure I'm not bitten by some corner case.
<robocop> vixey: is for a a lexer. Genlex has got a problem with operator "-" because it replace -x by the integer -x and not by then operator - and the number x.
<vixey> yeah
<vixey> you are doing this wrong
<vixey> make a better lexer
<vixey> then you don't have to use regex
* Yoric[DT] agrees with vixey.
<vixey> isn't camllex suitable?
<Yoric[DT]> And to write a lexer, you may use regexps, but that's as far as it goes.
<Yoric[DT]> Don't rewrite your original string, you're going to get bitten sooner or later.
<robocop> Hum, okey.
<robocop> thanks for you reponses.
<robocop> *answers, sorry.
<Yoric[DT]> :)
fred12 has joined #ocaml
fred12 is now known as cgizmo
jeremiah has quit [Read error: 104 (Connection reset by peer)]
harlos has quit [Read error: 104 (Connection reset by peer)]
<robocop> While we're at it, lets solve my problem : i would like to get the tokens from the regex matched string. Example :
<robocop> regex. Exemple : let f = Str.regexp "[0-9]+" ;;
<robocop> Str.global_replace f "a56" "what should i put there to return 56";;
<robocop> ?
<Yoric[DT]> It's not global_replace.
<Yoric[DT]> It's string_match followed by matched_string.
<Yoric[DT]> And yes, it's ugly.
<robocop> Hum, okey, thanks you :).
hjpark has joined #ocaml
<hjpark> is this code safe ? "let input = ref "" in input := read_line ();"
<flux> safe in what sense?
<Camarade_Tux> match and use 'Str.matched_string "a56"' ?
<Camarade_Tux> or Str.global_replace (Str.regexp "[^0-9]+") "a56" ""
<hjpark> the problem kind of illegal memory access
<flux> all ocaml code is safe, barring the use of explicitly unsafe functions
<hjpark> oh
<flux> I'm not sure what happens if it receives a string larger than 16 megabytes on a 32-bit platform
<flux> I would expect an exception
<Camarade_Tux> let's try :)
<hjpark> input is refer to "" string.
<hjpark> and input := something -> change "" right?
<flux> hjpark, ah, well it doesn't actually change the string ""
jeremiah has joined #ocaml
<flux> hjpark, it creates a new string and replaced the reference in input to point to that new stirng
<flux> the old empty string is garbage collected
<hjpark> oh..
<hjpark> flux: i got it. thx :)
<flux> in general it cannot do what you're thinking as you are not passing input as a parameter to read_line
<Camarade_Tux> flux, Exception: Invalid_argument "String.create"
<flux> on another level, references don't copy anything
<flux> (well, they do copy the pointer, but that's it)
<hjpark> kinda java ref style
<hjpark> i solving ACM problem by ocaml, and ocaml is very powerful :)
Camarade_Tux_ has joined #ocaml
Camarade_Tux__ has joined #ocaml
<Camarade_Tux__> (third try) in case it did not get through, trying to read a 135MB string on 32bit results in : Exception: Invalid_argument "String.create"
Camarade_Tux_ has quit [Read error: 104 (Connection reset by peer)]
Camarade_Tux has quit [Read error: 113 (No route to host)]
Camarade_Tux__ is now known as Camarade_Tux
alexyk has joined #ocaml
Camarade_Tux_ has joined #ocaml
olgen has joined #ocaml
itewsh has joined #ocaml
Camarade_Tux has quit [Read error: 110 (Connection timed out)]
cgizmo has quit ["ChatZilla 0.9.84 [Firefox 3.0.4/2008111319]"]
alexyk has quit []
<Yoric[DT]> hjpark: yes, references are more or less equivalent to non-final Java references.
<flux> hjpark, there is a pitfall compared to java, though: strings are mutable
<hjpark> oh, that's interesting.
alexyk has joined #ocaml
<Yoric[DT]> There are notions of immutable strings around but the default string type is mutable.
<Yoric[DT]> That's something most people believe is an error but it remains for historic purposes.
willb2 has quit ["Leaving"]
<flux> it would be cool if there were phantom-typed mutable and immutable strings.
<Yoric[DT]> String.Cap, in Batteries :)
<flux> batteries documentation is too difficult to google :)
<flux> yoric[dt], would it break stuff string was redefined to be [< `Read | `Write] String.t?
<flux> +if
<flux> I suppose it wouldn't work with other, non-batteries, libraries anymore..
<Yoric[DT]> Yeah.
alexyk has quit []
olgen has quit []
olgen has joined #ocaml
asabil has joined #ocaml
love-pingoo has joined #ocaml
<flux> is it really as efficient as String?
Kopophex has joined #ocaml
itewsh has quit ["KTHXBYE"]
<flux> it doesn't provide the unsafe variants of string indexing
jeremiah has quit [Read error: 104 (Connection reset by peer)]
robocop has left #ocaml []
Stefan_vK1 has joined #ocaml
Gionne has quit ["Leaving"]
jeremiah has joined #ocaml
alexyk has joined #ocaml
<alexyk> the difference with #c++: I never saw the word "bullshit" here yet :)
<alexyk> even ocaml traders are more polite than c++ traders
<Optikal_> ocaml traders?
<alexyk> optikal: type ocaml in google, then read the AdSense Ad
<Optikal_> Oh, Jane Street
<hcarty> alexyk: To be fair, we do have our share of trolls... but the community around OCaml tends to be quite pleasant
<hcarty> "we" being the folks in #ocaml and on the mailing lists. And the library authors I've dealt with.
<alexyk> hcarty: this is the most pleasant channel in fact, so far -- and the right size; look as Haskell and C++ scroll by, too crowded; and postgresql has 2,500 messages today -- those DBAs have not much else to do, clearly :) here's size to stay coherent enough
<Optikal_> All OCaml trolling is done in french
<Optikal_> =)
<alexyk> optikal: :)
<Yoric[DT]> flux: indeed.
<Camarade_Tux_> Optikal_, nah, don't forget Jon Harrop ;)
<Optikal_> Votre compilateur pue!
<Optikal_> Camarade_Tux: I just sent him money
<Optikal_> talk about feeding the trolls
<Optikal_> oh well
<alexyk> Jon Harrop is cool, he only teases Lispers
Stefan_vK has quit [Read error: 110 (Connection timed out)]
* alexyk wonders what pue means
<Camarade_Tux_> stinks
<alexyk> lol
* alexyk must not go to #c++ and say "votre langue pue"
<alexyk> google translate: your language sucks big time => votre langue sucks grand temps
jlouis has joined #ocaml
<Yoric[DT]> Well, that's a tad too literal :)
<Optikal_> that would involve Big Ben and a vaccum cleaner
<alexyk> yoric[dt]: what's the closest correct translation?
<Yoric[DT]> Optikal_: indeed :)
<Optikal_> votre langue suce beaucoup
<Optikal_> perhaps
<alexyk> google translate: s/sucks/stinks/ => votre langue pue gros temps
<alexyk> is suce as widespread as sucks in colloquial French?
<Yoric[DT]> Not that much.
<Yoric[DT]> "pue" would be better
<Yoric[DT]> But I can't think of any colloquial manner of translating "big time" in that context.
<Optikal_> "big time" basically means "alot"
* alexyk wished he learned French to debate French intellectuals in the cafés of Paris
<Optikal_> No you don't
<hcarty> Yoric[DT]: Has a decision been made on the hierarchy in Batteries?
<Optikal_> french intellectuals have a tendency towards postmodernist gibberish
<Yoric[DT]> :)
<Yoric[DT]> hcarty: not really.
<alexyk> optikal: that's the fun part :) and they're paid to do that
<Yoric[DT]> I guess we're going to go for the non-hierarchy "by default".
<flux> I guess there are no technical reasons to prefer the hierarchy?
<Yoric[DT]> Neither choice seems to have any direct technical implications.
<Yoric[DT]> Hierarchy makes for programs that are a few lines shorter, while non-hierarchy makes sure that we're less likely to end up with module clashes in Batteries.
<Yoric[DT]> But that's about it.
Kerris7_ has joined #ocaml
<flux> hierarchy might make a some programs shorter, but others longer?
<Yoric[DT]> Longer?
<Yoric[DT]> How so?
<Yoric[DT]> Sorry, I meant "shorter".
<hcarty> Yoric[DT]: I would think it would be the other way around? How does the non-hierarchy lead to fewer module clashes?
<flux> hmm, I'm confused. was the line explaining the difference what you meant?-)
willb has joined #ocaml
<Yoric[DT]> hcarty: no, I maintain that part.
<Yoric[DT]> flux: I meant "sorter? how so?"
<flux> "Hierarchy makes for programs that are a few lines shorter"
<flux> I'm just responding to what you said
<flux> you're wondering how hierarchy makes programs shorter although you just said it does?
<hcarty> Yoric[DT]: That's fine by me - I just don't see how?
<Yoric[DT]> Oh, sorry, I mixed hierarchy and non-hierarchy.
<Yoric[DT]> hcarty: sorry, I mixed there, too.
<Optikal_> ?!@#
* Yoric[DT] might need to catch back on some sleep.
<Yoric[DT]> Optikal_: yourself.
<hcarty> Yoric[DT]: Ah, ok. That makes sense
<hcarty> Lack of sleep can do that to a person :-)
<flux> well, hierarchy likely leads to people using module aliases, which can reduce code readability
<flux> because people always pick different aliases :)
<flux> short but to-the-point names may allow using the original names. it might result in a larger source file, but in the end it might be more usable
<Optikal_> Just assign each module it's own punctuation symbol
<flux> I never alias the module List, for example
<Yoric[DT]> :)
<Optikal_> its
Kerris7 has quit [Read error: 60 (Operation timed out)]
<flux> but, off to sleep
<Optikal_> David's <-- Possessive. It's <-- It is
<Optikal_> I hate english
<Yoric[DT]> flux: that's true.
<hjpark> how to compile with other module?
<hjpark> i use str.cma
<hjpark> when i run the ml program with ocaml blah.ml with #load "str.cma", it works
<hjpark> but, how can i compile with str.cma
<Yoric[DT]> Add str.cma before your .ml in the command-line.
<Yoric[DT]> ocamlc str.cma foobar.ml
<hjpark> oh "before"
<hjpark> i do ocamlc foobar.ml str.cma
<hjpark> haha..
<hjpark> thx
<Yoric[DT]> no
<Yoric[DT]> np
mbishop__ is now known as mbishop
ygrek_ has quit [Remote closed the connection]
ikaros has joined #ocaml
sporkmonger has quit []
middayc has joined #ocaml
seafood has joined #ocaml
<vixey> something like No rule to make target `lib/compat.ml4.ml.d', needed by `lib/compat.cmo'. Stop.
<vixey> is nonsense, right?
<vixey> because nothing will be ml4.ml.d, or could it?
<Yoric[DT]> I strongly doubt anything would have that kind of extension.
middayc_ has joined #ocaml
<alexyk> optikal: pue beats its every time :)
<Camarade_Tux_> something's annoying me with my webkit-gtk bindings =/
<Camarade_Tux_> and I'm starting to wonder how they could work
middayc has quit [Read error: 110 (Connection timed out)]
apples` has joined #ocaml
<Camarade_Tux_> I thought I was lucky they worked
<Camarade_Tux_> actually I was extremely lucky they worked ;)
Camarade_Tux_ is now known as Camarade_Tux
<alexyk> while I'm in the French study mode: so a prpogramming language is "langage", as opposed to human "langue"?
<Camarade_Tux> 'langue' is tongue ; 'langage' is language
<Camarade_Tux> you can translate directly to langage/langue, with the correspondance I gave, there's no catch, it's really a direct translation in that case
<alexyk> ok; Weis/Leroy book is called "La Langage Caml," so I assume langage is the right one
petchema__ has quit [Read error: 113 (No route to host)]
ikaros has quit [".quit"]
sporkmonger has joined #ocaml
<Camarade_Tux> alexyk, in this case, yes ;)
ppsmimou has quit [Read error: 60 (Operation timed out)]
Kerris7_ has quit []
ppsmimou has joined #ocaml
alexyk has quit []
<Yoric[DT]> Well, time to catch some of that sleep.
<Yoric[DT]> Cheers everyone.
Yoric[DT] has quit ["Ex-Chat"]
hkBst has quit [Read error: 54 (Connection reset by peer)]
marmotine has quit ["mv marmotine Laurie"]
Kerris7 has joined #ocaml
<hjpark> is there any math library in ocaml?
<hjpark> kinda sine cosine,
<hjpark> oh, i got it. sorry :)
jeddhaberstro has joined #ocaml
<vixey> what's pa_ifdef.cmo?
<vixey> I'm sure I heard someone here talking about pa before
<Smerdyakov> That's just the convention for prefixing camlp4 filenames.
olgen has quit []
willb has quit [Read error: 60 (Operation timed out)]
mwhitney has quit ["WeeChat 0.2.6"]
vixey has quit ["There exists an infinite set!"]
mtoups has joined #ocaml