mfp changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.11.2 released | Inscription for OCaml Meeting 2010 is opened http://wiki.cocan.org/events/europe/ocamlmeetingparis2010
thieusoai has quit [Quit: Leaving]
sepp2k has quit [Quit: Leaving.]
joewilliams is now known as joewilliams_away
silas has quit [Ping timeout: 248 seconds]
SEcki has quit [Ping timeout: 260 seconds]
silas has joined #ocaml
enthymeme has quit [Quit: rcirc on GNU Emacs 23.1.1]
dark has joined #ocaml
Associat0r has quit [Ping timeout: 265 seconds]
psnively has joined #ocaml
Associat0r has joined #ocaml
boscop has quit [Ping timeout: 246 seconds]
jakedouglas has quit [Quit: Leaving.]
Associat0r has quit [Quit: Associat0r]
Morphous has quit [Ping timeout: 245 seconds]
joewilliams_away is now known as joewilliams
enthymeme has joined #ocaml
psnively has quit [Quit: psnively]
jonathandav has quit [Ping timeout: 276 seconds]
jonathandav has joined #ocaml
M| has quit [Quit: leaving]
M| has joined #ocaml
Morphous has joined #ocaml
M| has quit [Ping timeout: 264 seconds]
joewilliams is now known as joewilliams_away
jakedouglas has joined #ocaml
maskd has quit [Quit: leaving]
M| has joined #ocaml
barismetin has joined #ocaml
barismetin has quit [Changing host]
barismetin has joined #ocaml
drk-sd has joined #ocaml
jeddhaberstro has quit [Quit: jeddhaberstro]
ttamttam has joined #ocaml
barismetin has quit [Remote host closed the connection]
ttamttam has quit [Quit: Leaving.]
barismetin has joined #ocaml
barismetin has quit [Changing host]
barismetin has joined #ocaml
ygrek has joined #ocaml
jsk has joined #ocaml
enthymeme has quit [Quit: rcirc on GNU Emacs 23.1.1]
jakedouglas has quit [Quit: Leaving.]
barismetin has quit [Remote host closed the connection]
komar_ has quit [Ping timeout: 240 seconds]
barismetin has joined #ocaml
barismetin has quit [Changing host]
barismetin has joined #ocaml
barismetin has quit [Remote host closed the connection]
komar_ has joined #ocaml
ttamttam has joined #ocaml
munga_ has joined #ocaml
ttamttam has quit [Quit: Leaving.]
Associat0r has joined #ocaml
barismetin has joined #ocaml
barismetin has quit [Changing host]
barismetin has joined #ocaml
boscop has joined #ocaml
avsm has joined #ocaml
barismetin has quit [Remote host closed the connection]
gildor has quit [Quit: leaving]
gildor has joined #ocaml
munga_ has quit [Ping timeout: 246 seconds]
pikachuyann has joined #ocaml
barismetin has joined #ocaml
barismetin has quit [Changing host]
barismetin has joined #ocaml
ikaros has joined #ocaml
ttamttam has joined #ocaml
barismetin has quit [Quit: Leaving...]
ttamttam has quit [Quit: Leaving.]
sepp2k has joined #ocaml
avsm has quit [Quit: Leaving.]
ygrek has quit [Ping timeout: 245 seconds]
derdon has joined #ocaml
maskd has joined #ocaml
derdon has quit [Read error: Operation timed out]
Narrenschiff has joined #ocaml
f[x] has quit [Ping timeout: 240 seconds]
f[x] has joined #ocaml
ikaros has quit [Quit: Leave the magic to Houdini]
jsk has quit [Quit: Leaving.]
krankkatze has joined #ocaml
lvillani has joined #ocaml
jonafan_ has joined #ocaml
krankkatze has quit [Remote host closed the connection]
jonafan has quit [Ping timeout: 245 seconds]
lokydor has joined #ocaml
dmhouse has joined #ocaml
fschwidom has joined #ocaml
munga_ has joined #ocaml
ztfw has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
bzzbzz has joined #ocaml
dmhouse has quit [Read error: Operation timed out]
ygrek has joined #ocaml
lvillani has quit [Quit: Leaving]
<orbitz> where can I find information on things like the range an int can represent, and what happens on overflow
<Camarade_Tux> Pervasives' documentation: === Integers are 31 bits wide (or 63 bits on 64-bit processors). All operations are taken modulo 2^{31} (or 2^{63}). They do not fail on overflow. ===
<orbitz> hrm
<orbitz> That's good
fschwidom has quit [Remote host closed the connection]
<orbitz> i'm a bit sadened tehre is no log for Num or Int64
<orbitz> well i guess it makes sense
<orbitz> since htose are floa tops
_unK has joined #ocaml
<gildor> all: hi, forge.ocamlcore.org seems to have DNS issue (as usual every 6 months or so)
<gildor> anyone can confirm this or I am alone ?
<Camarade_Tux> working here
<gildor> (a ticket has been opened into OVH BTS)
<gildor> Camarade_Tux: you can "dig forge.ocamlcore.org"
<gildor> ?
<gildor> Camarade_Tux: who's your FAI ?
<Camarade_Tux> not working on my server in Los Angeles
<Camarade_Tux> free
<gildor> DNS propagation issue, quite sure
<gildor> working at free, not working at orange, not working in Los Angeles
<gildor> the issue disappear in 2 hours or so, like the last time I think
<gildor> I hope that I will be able to bash OVH before
Narrenschiff_ has joined #ocaml
Narrenschiff has quit [Ping timeout: 252 seconds]
Narrenschiff_ is now known as Narrenschiff
f[x] has quit [Ping timeout: 268 seconds]
f[x] has joined #ocaml
avsm has joined #ocaml
kriko has joined #ocaml
_unK has quit [Remote host closed the connection]
dmhouse has joined #ocaml
derdon has joined #ocaml
<gildor> all: DNS of forge.ocamlcore.org is back online
<kriko> how do I iterate over list elements with ocaml?
<kriko> e.g. I have [1;2;3]
<gildor> List.iter
<kriko> oh, tnx
dmhouse has quit [Ping timeout: 240 seconds]
ztfw has joined #ocaml
lvillani has joined #ocaml
thrasibule has quit [Ping timeout: 252 seconds]
thrasibule has joined #ocaml
<kriko> if is_inside List.hd hd List.hd tl then []; -> function is inside takes 2 params, how do I fix this if so it stops complaining? :)
<orbitz> kriko: ()
<Camarade_Tux> yeah, you're missing parenthesis ;-)
<kriko> hm, but then I have to modify other function, so it accepts in ()?
<kriko> let rec is_inside elt seznam = match seznam with ...
<kriko> this is like now
<kriko> if is_inside (3 [1;2]) tl then [];
<kriko> this is still incorrect
<Camarade_Tux> where is '3 [1;2]' from?
<kriko> it's just a test value
<kriko> later it will be from head of some list ant heads tail from that same list
<Camarade_Tux> it's not valid ocaml
<kriko> why not?
<Camarade_Tux> what do you think it represents?
<kriko> an int and a list
<kriko> this is what I've cooked up till now
<kriko> problem is 13th line
<flux> well, you are passing a function as is_inside's second parameter
<Camarade_Tux> | hd::tl -> if (is_inside (List.hd hd) (List.hd)) tl then [];
<Camarade_Tux> that just won't work
<kriko> ah I see
<kriko> (List.hd hd) (List.hd tl)
<Camarade_Tux> and 'List.hd hd', you're trying to take the head of an int which makes no sense
<Camarade_Tux> err, wait
<Camarade_Tux> it'll work since you have 'int list list' (had assumed it was 'int list')
ztfw` has joined #ocaml
<kriko> ok, I've found some problems
ztfw` has left #ocaml []
ztfw has quit [Ping timeout: 246 seconds]
<kriko> I don't get it: let res = (is_inside 1 [2;3]);; -> where is syntax error in there?
pikachuyann has quit [Remote host closed the connection]
lvillani has quit [Quit: Leaving]
f[x] has quit [Ping timeout: 276 seconds]
pimmhogeling has joined #ocaml
<Camarade_Tux> it's 'let ... = ........ in let ... = ...... in ...'
<Camarade_Tux> what do you want to do with 'res' after?
<kriko> if res then ... else....
<Camarade_Tux> well, do it then: 'let res = ... in if res then ... else ...'
munga_ has quit [Ping timeout: 264 seconds]
ulfdoz_ has joined #ocaml
ulfdoz has quit [Read error: Operation timed out]
ulfdoz_ has quit [Client Quit]
ulfdoz has joined #ocaml
f[x] has joined #ocaml
<kriko> finally: let res = is_inside (List.hd hd) (List.hd tl) in if res then (Printf.printf "true"; [1]) else (Printf.printf "false";[2]);
<kriko> :D
<kriko> thank you
<Camarade_Tux> :-)
<Camarade_Tux> why return [1] and [2] instead of simple 1 and 2?
<kriko> em, this is just stub implementation XD
<Camarade_Tux> also, if your list has one element or less, your program will crash
<Camarade_Tux> ok ;-)
avsm has quit [Quit: Leaving.]
jakedouglas has joined #ocaml
jakedouglas has quit [Client Quit]
jakedouglas has joined #ocaml
_2x2l has quit [Ping timeout: 265 seconds]
psnively has joined #ocaml
pimmhogeling has quit [Ping timeout: 245 seconds]
psnively has quit [Quit: psnively]
f[x] has quit [Ping timeout: 276 seconds]
f[x] has joined #ocaml
f[x] has quit [Ping timeout: 268 seconds]
f[x] has joined #ocaml
catsai has joined #ocaml
lvillani has joined #ocaml
thrasibule has quit [Ping timeout: 240 seconds]
Submarine has joined #ocaml
thrasibule has joined #ocaml
Submarine has quit [Ping timeout: 248 seconds]
f[x] has quit [Ping timeout: 260 seconds]
f[x] has joined #ocaml
<kriko> function "skupno" can return a list or []. how can I use "if (skupno hd) == [] then 0 else 1;" properly?
<kriko> I need to test if it returned empty list
<kriko> normally it returns list -> int list
<orbitz> kriko: = not ==
<orbitz> kriko: and why are you returning 0 or 1? why not ismply: foo = (skupno = []) ?
<kriko> it's not done yet
<orbitz> what isn't?
<orbitz> kriko: is your output really integers? or just the itnegers 0 and 1? if just 0 and 1 make i ta bool
<kriko> no, will be something else at the end
<kriko> still complaining at 38
<kriko> I just want to test if the result is [] :)
<orbitz> kriko: when you ask questions please A) Use an ocaml pastebin (I suggest ideone.com) B) state the error. I amnot a human compiler
<kriko> sorry, line 38: Error: This expression has type int list -> int list but is here used with type 'a list
<orbitz> prefer print_endline over your printf's there, they are useless
<orbitz> kriko: compare lien 16 to line 38
<kriko> yes, one is a function the other is an if statement
<orbitz> how many funcitons does skupno take?
<orbitz> rr
<orbitz> how many paraemters?
<kriko> awww
<kriko> thanks :D
<kriko> I'm kinda tired, seems like it's getting to me
<orbitz> then sleep
Submarine has joined #ocaml
<orbitz> can i 'open' a specific type form a module into my curren tmodule?
maskd- has joined #ocaml
ikaros has joined #ocaml
thrasibule has quit [Ping timeout: 240 seconds]
maskd has quit [Ping timeout: 248 seconds]
<flux> hmm
<flux> well, not exactly
<flux> you can do: type t = Foo.t = A of int | B of string
<flux> obviously that has its downside..
<flux> but that brings the constructors to the current scope if that's what you want
lvillani has quit [Quit: Leaving]
maskd- is now known as maskd
lvillani has joined #ocaml
<orbitz> flux: but i have to redefine teh constructors?
<orbitz> i can't just do type t = Foo.t
<flux> sure you can
<flux> but that doesn't bring the constructors into current scope if that's what you want
<flux> (it sounded like you ded from the 'open' term)
Submarine has quit [Ping timeout: 276 seconds]
<orbitz> Yeah, i want the ctor' sin my scope
<orbitz> oh well, it was just for conveience I can get by without it
Narrenschiff has quit [Quit: Narrenschiff]
thieusoai has joined #ocaml
_unK has joined #ocaml
<flux> in code that uses them a lot you can possibly use module aliases: module A = AbstractionLayer (or the expression version: let module A = B in .. )
<flux> or in 3.12-to-be: open AbstractionLayer in expr or AbstractionLayer.(expr)
lvillani has quit [Quit: Leaving]
Submarine has joined #ocaml
lvillani has joined #ocaml
Submarine has quit [Read error: Operation timed out]
f[x] has quit [Ping timeout: 248 seconds]
ttamttam has joined #ocaml
f[x] has joined #ocaml
wormphlegm has joined #ocaml
Submarine has joined #ocaml
<kriko> is there a way to dump a list into printf, so you can see exact structure? if there are nested lists....
Submarine has quit [Ping timeout: 240 seconds]
<Camarade_Tux> you can use the toplevel's pretty-printing functionnality for that, you also have other dumpers (ocaml-show from kaustuv, or caml-inspect [ https://forge.ocamlcore.org/projects/caml-inspect/ ] )
<orbitz> kriko: i generally work in the REPL for awhiel palying with things until i'm comfortable wiht the types then move to making front end apps
<Camarade_Tux> I have to say I'm wondering if there's anything to dump a big tree to a file (an AST)
<orbitz> one thing that is nice abotu haskell type classes is "derivign Show"
<orbitz> just makes lifea lot easier in debuggin
<Camarade_Tux> right ;-)
<orbitz> excelelnt, hav eyou used it?
<orbitz> I was thinking Jane St's sexpr conv woudl be used for this too
jnss93 has joined #ocaml
<Camarade_Tux> no, I had completely forgotten about it, I would probably have used it today otherwise ;-)
<orbitz> hehe
ttamttam has quit [Quit: Leaving.]
Submarine has joined #ocaml
Submarine has quit [Quit: Leaving]
Submarine has joined #ocaml
Submarine has quit [Read error: Operation timed out]
ygrek has quit [Ping timeout: 245 seconds]
<kriko> in what type of apps is ocaml being used today?
<orbitz> kriko: Jane St uses it for almost everythign they do
<orbitz> kriko: MS allegedly uses it to verify third partydrivers
<orbitz> kriko: Intel uses it to verify their floating point math
<Camarade_Tux> static code verification, semantic patching, networking, databases/search, parsing, web servers/apps/..., ...
<orbitz> F# is used a lot in finance
<kriko> arent web server apps easier in java - done that ?
<orbitz> kriko: depend son who you ask
<kriko> and probably what kind of server apps again...
pimmhogeling has joined #ocaml
<orbitz> Python/Ruby/PHP probably own the web app space right now
<Camarade_Tux> kriko: I know of some people using ocsigen happily with great performance
<derdon> orbitz: yes
<orbitz> kriko: I am using Ocaml righ tnwo for Gene prediciton
<orbitz> and I use it at work for scripting that would normally be done in Pyhon/Perl/Bash
<kriko> and I asume it's faster
<orbitz> speed isn't really a concern for most scripting jobs in my experience
<orbitz> right now it takes me longer to generate a solution just because I'm still learning
<orbitz> i'm still figuring out how to structure ocaml programs
<Camarade_Tux> most often, if speed is a concern for scripting, then you're not really scripting ;-)
<orbitz> heh yeah
<orbitz> i've been using ocaml for things like doing transformations on CSV files
avsm has joined #ocaml
Camarade_Tux is now known as adrien
Submarine has joined #ocaml
lvillani has quit [Ping timeout: 248 seconds]
<kriko> List.iter (List.iter(Printf.printf "test %d,")) ((List.tl (tl))); -> that should print only a list with list elements, right?
<adrien> oh, lisp :P
<orbitz> heh
<kriko> no, its ocaml :D
<adrien> it works on 'int list list'
<kriko> right
<kriko> is there a debugger for ocaml?
<orbitz> what problem are you experiencing/
<kriko> incorrect result :)
<kriko> but I know where the problem is... I think
<orbitz> kriko: it sounds like you're rushign thoruhg erlang without taking a lot of time to learn it. you shoudl slow down
<kriko> probably
<orbitz> kriko: the REPL works inmany ways like a debugger
<drk-sd> orbitz: why are you talking about erlang?
<adrien> btw, List.hd/tl aren't great, pattern matching is often better
<orbitz> dam
<orbitz> i mean ocaml
<orbitz> drk-sd: brain fart
<drk-sd> they all say that.
dark has quit [Ping timeout: 265 seconds]
Submarine has quit [Quit: Leaving]
komar_ has quit [Quit: WeeChat 0.2.6]
<orbitz> hrm
<orbitz> (reverse) looks fascinating..
jnss93 has left #ocaml []
fraggle_ has quit [Quit: -ENOBRAIN]
lvillani has joined #ocaml
fraggle_ has joined #ocaml
lvillani has quit [Client Quit]
smimou has joined #ocaml
maattd has quit [Remote host closed the connection]
maattd has joined #ocaml
lokydor has quit [Ping timeout: 276 seconds]
<kriko> if tl is a list, then "if (tl = [])" or "if (tl == [])" is the same comparison?
<adrien> you probably want to avoid == for now
<adrien> # [ 1 ] == [ 1 ];;
<adrien> - : bool = false
<kriko> hm
<kriko> tnx
<derdon> this shouldn't be a surprise
<adrien> == means the two elements are the same in memory, here the two lists are different
<adrien> = compares values
<kriko> tnx for explanation - clear now
<kriko> negation of = is != ?
<adrien> <>
<kriko> aaaahhh
<adrien> negation of == is !=
ikaros has quit [Quit: Leave the magic to Houdini]
ikaros has joined #ocaml
catsai has quit []
ikaros has quit [Quit: Leave the magic to Houdini]
ikaros has joined #ocaml
<adrien> woot, I think I'm going to deprecate/kill ocaml-gir :-)
<kriko> is it possible to assign a value to global variable from a function, so the change is visible after the fun finishes?
<adrien> kriko: you can use references for that
<kriko> ok, will take a look
<kriko> do you have any sample how to do that?
<adrien> it's with 'ref': you create an int ref with 'let a = ref 42 in ...', you access the value of the reference with '!a' and you assign to the reference with 'a := 0;'
<kriko> awesome, works. thanks
<adrien> :-)
<orbitz> kriko: it's a bad idea probably thouhg
wormphlegm has quit [Quit: wormphlegm]
<adrien> yeah, it works but global variables are a great way to create bugs
<adrien> oops
<adrien> 7zip used to be able to extract the scripts from nsis installers but because of (stupid) complaints, this got removed, last time I checked, uniextract used an older version of 7zip because of that but that may have changed
<adrien> in any case, an old version of 7zip (check the changelogs to know when that was introduced) will do it
<adrien> blearg
<adrien> wrong channel
<adrien> ah
<adrien> ok, I *really* should go to bed ;p
derdon has quit [Ping timeout: 248 seconds]
<kriko> ok I'm in trouble: http://ocaml.pastebin.com/r9hQLGnB - so when tl is not [] presek gives the right result, however when presek is [] I should return last value from that call
<kriko> I'm not sure how to resolve this
<kriko> line 18 and line 25
<kriko> basically on line 25 should be what is on 18 at last recursion
<kriko> http://ocaml.pastebin.com/6XRZLBkf this is whole program
<kriko> the idea is to get intersect between lists
<orbitz> what is the point of all tehe []' nd (@) on line 18?
dark has joined #ocaml
<orbitz> kriko: why don't you take some time to clearly define teh sitautiosn you wan tot handle, write specific functions to handle those situations, and then combine them inot a function that dispatches to each oen properly?
<orbitz> long functions in a language like ocaml tend ot mean you'ar edoing soemthign wrong in my experience
ikaros has quit [Quit: Leave the magic to Houdini]
sepp2k has quit [Quit: Leaving.]
<orbitz> I have the following functions defined:
<orbitz> do I have to specify that statemap_of_list shoudl work for *any* statemap?
<orbitz> i seem ot be getting an error where I use it for a statemap holding one type and then again on statemap with a diferen ttype and it fails
pimmhogeling has quit [Ping timeout: 245 seconds]