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
Amorphous has joined #ocaml
pimmhogeling has quit [Ping timeout: 265 seconds]
SEcki has quit [Remote host closed the connection]
elehack has quit [Quit: Goodbye...]
jeddhaberstro has joined #ocaml
boscop_ has joined #ocaml
boscop has quit [Ping timeout: 240 seconds]
boscop__ has joined #ocaml
yakischloba has quit [Quit: Leaving.]
boscop_ has quit [Ping timeout: 268 seconds]
yakischloba has joined #ocaml
sepp2k1 has quit [Quit: Leaving.]
Shoggoth has joined #ocaml
ulfdoz_ has joined #ocaml
drk-sd has quit [Quit: dodo]
ulfdoz has quit [Ping timeout: 276 seconds]
jeddhaberstro has quit [Read error: Connection reset by peer]
jeddhaberstro has joined #ocaml
miyako has joined #ocaml
<miyako> hello
seafood has quit [Quit: seafood]
maskd has quit [Quit: leaving]
Shoggoth_ has joined #ocaml
Shoggoth_ has quit [Read error: Connection reset by peer]
seafood has joined #ocaml
<orbitz> miyako: hi
<miyako> anyone willing to take a look at my first two short ocaml programs and provide some feedback?
Shoggoth has quit [Quit: Ex-Chat]
<orbitz> miyako: sure
<orbitz> miyako: I'm no expert but I can try my best
ccasin has quit [Quit: Leaving]
caligula__ has joined #ocaml
caligula_ has quit [Ping timeout: 260 seconds]
krankkatze has quit [Ping timeout: 246 seconds]
seafood has quit [Quit: seafood]
goncalo has joined #ocaml
thrasibule has quit [Remote host closed the connection]
goncalo has quit [Ping timeout: 276 seconds]
_unK has joined #ocaml
ssamoon has joined #ocaml
yakischloba has quit [Quit: Leaving.]
Snark has joined #ocaml
_zack has joined #ocaml
jeddhaberstro has quit [Quit: jeddhaberstro]
Snark has quit [Ping timeout: 276 seconds]
MrEvil has joined #ocaml
MrEvil has quit [Quit: This computer has gone to sleep]
pimmhogeling has joined #ocaml
ttamttam has joined #ocaml
ttamttam has quit [Client Quit]
<Camarade_Tux> I guess there's no way to match all the exceptions from a module with try...with? like 'try Foo.bar () with Foor._ -> "blabla"'
ygrek has joined #ocaml
boscop__ has left #ocaml []
ulfdoz_ has quit [Quit: Reconnecting]
ulfdoz has joined #ocaml
alpounet has quit [Ping timeout: 260 seconds]
alpounet has joined #ocaml
ygrek has quit [Remote host closed the connection]
ygrek has joined #ocaml
pimmhogeling has quit [Remote host closed the connection]
_zack has quit [Remote host closed the connection]
ttamttam has joined #ocaml
<flux> correct
_zack has joined #ocaml
<flux> what modules often times do is that they put all their exceptions inside one exception structure
<Camarade_Tux> I would have liked something like '| Sexp._ -> prerr_endline "invalid metadata"' but it's no big deal
<flux> hmph.. my remote git repository has gone all wanky and I've done nothing too-difficult with it
krankkatze has joined #ocaml
<Camarade_Tux> what do you call all wanky?
<flux> it doesn't accept my pushes and when I pull from it, it determines I have a conflicts
<flux> but all I've done is pushed into it from a single source..
<flux> and no branches either
<flux> oh well, I just redid it
<Camarade_Tux> I managed something like that by amending a commit I had already pushed once
_unK has quit [Read error: Connection reset by peer]
_unK has joined #ocaml
<flux> hey, that might be it
<flux> I've amended patches, but I was pretty sure I hadn't pushed them
<flux> but I could've always made a mistake I guess
<flux> although I would like my remote repository to handle amended patches as well, I wonder if that's possible to set up?
<Camarade_Tux> well, the problem is that someone may have pulled from your repo and then he'll be in troubles if you amend something
<Camarade_Tux> I think you can --force it anyway
<Camarade_Tux> and the problem is described in git-rebase's manpage under "RECOVERING FROM UPSTREAM REBASE"
_unK has quit [Quit: Konversation terminated!]
_zack has quit [Quit: Leaving.]
ttamttam has quit [Quit: Leaving.]
mehdid has quit [Quit: leaving]
jonafan_ has joined #ocaml
jonafan has quit [Ping timeout: 245 seconds]
mehdid has joined #ocaml
fraggle has joined #ocaml
maskd has joined #ocaml
_unK has joined #ocaml
Yoric has joined #ocaml
Demitar has quit [Quit: Bubbles!]
rwmjones has quit [Ping timeout: 245 seconds]
Demitar has joined #ocaml
ttamttam has joined #ocaml
ygrek has quit [Remote host closed the connection]
ygrek has joined #ocaml
ttamttam has quit [Quit: Leaving.]
grettke has joined #ocaml
fraggle has quit [Quit: -ENOBRAIN]
fraggle has joined #ocaml
Yoric has quit [Ping timeout: 276 seconds]
sepp2k has joined #ocaml
grettke has quit []
ikaros has joined #ocaml
ccasin has joined #ocaml
Associat0r has quit [Quit: Associat0r]
drk-sd has joined #ocaml
ikaros has quit [Quit: Leave the magic to Houdini]
derdon has joined #ocaml
<flux> hm, how does one use locales in ocaml (or batteries)? for example if I have character literal 'ä' in my source code and I'd like it to output properly to both ISO-8859-15 and UTF-8 terminals, how should I do it?
<flux> apparently only camomile is the only lib that considers such things..
thrasibule has joined #ocaml
<thelema> flux: I don't really know.
<thelema> I guess camomile might have (or you'd have to write) code to look up the locale (get_locale() in C, iirc) and do the right thing bsed on that
<flux> lablgtk has glib bindings which have functions val locale_from_utf8 : string -> string and val locale_to_utf8 : string -> string
<flux> but it's a stupid dependency to have just for that :)
<Camarade_Tux> iirc (but that was really a long time ago), I had no problem when my source file was encoded as the same locale as my terminal
<thelema> Camomile has a Locale module
<thelema> but it doesn't seem to have much
<flux> camarade_tux, well, most encodings work out that way just fine.. but it'd nice to support other than my locale as well :)
<flux> even if it just for displaying my name properly :)
okagawa has joined #ocaml
okagawa has left #ocaml []
companion_cube has joined #ocaml
<Camarade_Tux> flux: yeah, of course ;-)
<Camarade_Tux> there's something I've wanted to do for quite a long time now but now I finally have the time and resources to set it up: automated tests for all ocaml libraries and programs: commit some changes and have your library compiled and tested, along with everything depending on it, on different OSes and architectures
<Camarade_Tux> my questions is: has anyone heard of something like that? it's probably very easy to do but it's always better to not reinvent the wheel
<Camarade_Tux> (as long as the wheel has not been written in python :-) )
<flux> so hooking running automated tests into your commits?
<flux> I would imagine such beasts exist already, except possibly written in java :)
<Camarade_Tux> heheh :P
<Camarade_Tux> and most probably _for_ java ;-)
<Camarade_Tux> I know of buildbot but it looks quite complicated and I'm not sure it does everything I want
yakischloba has joined #ocaml
fraggle has quit [Quit: -ENOBRAIN]
fraggle has joined #ocaml
thrasibule has quit [Ping timeout: 276 seconds]
ikaros has joined #ocaml
fraggle has quit [Client Quit]
fraggle_ has joined #ocaml
avsm has joined #ocaml
avsm has left #ocaml []
avsm1 has joined #ocaml
avsm1 has quit [Client Quit]
goncalo has joined #ocaml
sid has joined #ocaml
sid has left #ocaml []
sidolin has joined #ocaml
struktured has joined #ocaml
struktured has quit [Ping timeout: 246 seconds]
<flux> thelema, hmm, you said you pushed none_of fix, but I can't find it? got commit id?
<flux> (or maybe I misinterpreted what you said)
hcarty has joined #ocaml
hcarty has quit [Client Quit]
<thelema> flux: checking...
drewby has joined #ocaml
<flux> I guess my git-fu is low, my remote apparently needs to know also the branch :)
<drewby> hey guys, I'm a little confused, http://pastebin.ca/1856746 the code in the linux returns 4, when i would expect it to return 7 and the last line to take one less argument
<drewby> can someone explain to me what's going on?
<drewby> I would think that in intermediate f n would be evaluated to 8 - 1 = 7, but instead it just returns f and then the last line return 4
<drewby> maybe I don't understand the function keyword
<flux> you are passing a two-parameter function to intermediate, which looks like it's expecting a one-parameter function f
<flux> (it accepts any function really, due to currying)
<flux> maybe annotating some types would help you find the problem
<flux> like let intermediate (f : int -> num) = ..
<flux> (where num is the type with the constructor Num)
<drewby> ah
<flux> function xxx is the same as fun a -> match a with xxx
<flux> (without the named variable a of course)
<drewby> oh hahahaah!
<drewby> yes, the type annotations did help
<drewby> fun minus a -> a-1
<drewby> minus shouldn't be there, the function is anonymous
<flux> I did wonder what the variable 'minus' was for
<drewby> and because I tried to name an anonymous function, it thought that I wanted two variable
<flux> didn't the compiler warn about that?
<flux> (maybe it doesn't because of the error or for other reasons)
<drewby> I had some thing that ran without error and returned 4 with no warning
<drewby> :-\
<drewby> or maybe I was just really confused
<drewby> which I usually am in ocmal
<drewby> ocaml*
mutewit has joined #ocaml
AxleLonghorn has joined #ocaml
rwmjones has joined #ocaml
EliasAmaral has joined #ocaml
<flux> you'll get over it :)
thieusoai has quit [Quit: Leaving]
bzzbzz has joined #ocaml
<drewby> I dunno, I hope so, but the possibility seems slim.
<flux> all it takes is 10000 lines of more code
thieusoai has joined #ocaml
mutewit has quit [Quit: leaving]
mutewit has joined #ocaml
ygrek has quit [Ping timeout: 245 seconds]
* thelema always turns on "-w Z" when compiling so I get notice of unused variables
ygrek has joined #ocaml
<thelema> has anyone tried to use ocamlviz in the toplevel?
EliasAmaral is now known as dark
struktured has joined #ocaml
<drewby> hi dark
mutewit has quit [Ping timeout: 264 seconds]
mutewit has joined #ocaml
mutewit has quit [Remote host closed the connection]
mutewit has joined #ocaml
ikaros has quit [Quit: Leave the magic to Houdini]
<drewby> there are different typing rules for inner functions and global functions?
<thelema> slightly.
<drewby> grrr
<thelema> global functions can't have any '_a
<drewby> I can pass both 'a->'b->'c and 'a_>'b to something expecting 'a->'b for a global function, but for an inner function i have to pick one and stick with it?
<thelema> that should be the same
<drewby> same in that I can vary either which way
* drewby is confused to the point of crankiness. :-(
<thelema> yes, a function of type ('a -> 'b -> 'c) is a function of type ('a -> 'b) where 'b = ('b -> 'c)
mutewit has quit [Quit: Lost terminal]
xavierbot has joined #ocaml
<rwmjones> xavierbot, hello
<rwmjones> xavierbot, help
<xavierbot> hello rwmjones, I am xavierbot 0.8, an OCaml toplevel
<xavierbot> expr ;; evaluate expr in toplevel and print result
<xavierbot> help help message
<xavierbot> restart restart the toplevel
<xavierbot> sleep go to sleep
<xavierbot> wake wake me up from sleep
<orbitz> rwmjones: i just eread yoru phantom types post from 2008, much enjoyed
<rwmjones> heh ages ago :-)
* rwmjones considers rewriting virt-resize in ocaml
<rwmjones> it would be much easier than using fscking perl
<orbitz> hah you work for citrix?
<rwmjones> orbitz, no, Red Hat
<orbitz> do you write ocaml for red hat?
<rwmjones> I certainly do
<orbitz> what stuff do they use ocaml for?
<rwmjones> ocaml will be in Red Hat Enterprise Linux 6
<derdon> xavierbot, Sys.argv ;;
<xavierbot> Characters 0-9:
<xavierbot> xavierbot, Sys.argv ;;
<xavierbot> ^^^^^^^^^
<xavierbot> Error: Unbound value xavierbot
<rwmjones> behind the scenes stuff
<rwmjones> derdon, it's fairly bullet-proof, but you can try and exploit it if you want
<derdon> rwmjones: do I have to talk with him directly?
<rwmjones> xavierbot, (Obj.magic 1 : string)
<rwmjones> xavierbot, (Obj.magic 1 : string);;
<xavierbot> Characters 1-10:
<xavierbot> xavierbot, (Obj.magic 1 : string);;
<xavierbot> ^^^^^^^^^
<xavierbot> Error: Unbound value xavierbot
<derdon> xavierbot: Sys.argv ;;
<xavierbot> Characters 1-10:
<xavierbot> xavierbot: Sys.argv ;;
<xavierbot> ^^^^^^^^^
<xavierbot> Error: Parse error: [str_item] or ";;" expected (in [top_phrase])
<rwmjones> (Obj.magic 1 : string);;
<xavierbot> Characters 2-11:
<xavierbot> (Obj.magic 1 : string);;
<xavierbot> ^^^^^^^^^
<xavierbot> Error: Unbound value Obj.magic
<derdon> Sys.argv ;;
<xavierbot> Characters 1-9:
<xavierbot> Sys.argv ;;
<xavierbot> ^^^^^^^^
<xavierbot> Error: Unbound value Sys.argv
<rwmjones> derdon, not sure what you mean, but if he disturbs you, give him the "sleep" command
<derdon> rwmjones: he doesn't disturb me
<derdon> rwmjones: I want to find out how he works
<rwmjones> derdon, open source, download it :-)
<orbitz> rwmjones: does it run in a VM or omsethign liek geordi?
<derdon> rwmjones: ha! you don't know it either!
<derdon> Sys.ocaml_version ;;
<xavierbot> Characters 1-18:
<xavierbot> Sys.ocaml_version ;;
<xavierbot> ^^^^^^^^^^^^^^^^^
<xavierbot> Error: Unbound value Sys.ocaml_version
<derdon> open Pervasives; Sys.ocaml_version ;;
<xavierbot> Characters 6-16:
<xavierbot> open Pervasives; Sys.ocaml_version ;;
<xavierbot> ^^^^^^^^^^
<xavierbot> Error: Parse error: [str_item] or ";;" expected (in [top_phrase])
<rwmjones> it uses a suid wrapper to run the bot as a "nobody" user
<rwmjones> in a chrooted environment
<derdon> interesting
<rwmjones> and with most of the stdlib disabled, hopefully to make it safe
<rwmjones> and with an ocamlp4 preprocessor to disable use of things like "external"
<rwmjones> otherwise you'd be able to write
<rwmjones> external magic : 'a -> 'b = "%identity"
<rwmjones> external magic : 'a -> 'b = "%identity";;
<xavierbot> 'external' keyword disabled
<xavierbot> - : unit = ()
<rwmjones> however that doesn't necessarily mean it is bullet-proof, there are probably security issues
<rwmjones> eg. we still allow parts of the stdlib's OO internal module
<rwmjones> CamlinternalOO
<rwmjones> anyhow, you can download the source and try to find bugs if you want
<orbitz> cool
<orbitz> i want to do similar with an Erlang bot
<rwmjones> http://people.redhat.com/~rjones/xavierbot/ in case you were having trouble using google
<derdon> ah cool. I can define a function someone else executes
<derdon> let hello () = print_endline "hello, world";;
<xavierbot> val hello : unit -> unit = <fun>
<orbitz> hello ();;
<xavierbot> hello, world
<xavierbot> - : unit = ()
<derdon> yay, it wokrs :)
<derdon> *works
<alpounet> hooray
<alpounet> xavierbot's back
<derdon> rwmjones: no public repo in github?
<rwmjones> just a sec
<derdon> ugh, a table for the code example oO
<alpounet> type foo = Foo of int;;
<xavierbot> type foo = Foo of int
<alpounet> Foo 1;;
<xavierbot> - : foo = Foo 1
<derdon> foo;;
<xavierbot> Characters 1-4:
<xavierbot> foo;;
<xavierbot> ^^^
<xavierbot> Error: Unbound value foo
<derdon> this is something I will never understand :S
<alpounet> it's the type's name
<alpounet> how would you like it to answer you ?
<derdon> alpounet: but why does this type have a name if I cannot access it?
<rwmjones> ok I just pushed the new version: http://people.redhat.com/~rjones/xavierbot/
<alpounet> you can derdon
<thelema> derfoo isn't bound to any value.
<derdon> it could be anonymous. in fact it *is* anonymous
<rwmjones> derdon, no there's no public repo for this
<derdon> rwmjones: ok
<alpounet> rwmjones, what's new ?
<rwmjones> alpounet, not very much, mainly it now sends a nickserv password, which is now required for freenode AFAICT
<rwmjones> and it doesn't barf with ocaml 3.11
<drewby> constructors are not first order?
<derdon> alpounet: how can I acess it using the name ``foo``?
<alpounet> yeah #ocaml is for registered users only rwmjones now
<rwmjones> derdon, at compile time? using (v : foo)
<alpounet> derdon, what do you mean by "accessing" ? you can create values of that type
<rwmjones> (Foo 3 : foo) ;;
<xavierbot> - : foo = Foo 3
<rwmjones> a type assertion
<alpounet> <drewby> constructors are not first order? <<< nope, they're not functions.
<derdon> alpounet: I don't want to create values of this type
<drewby> rawr!
<alpounet> derdon, what do you want to do with them ?
<derdon> rwmjones: thanks, that's it!
<drewby> is there a place where I can find a bunch of ocaml code snippets?
<derdon> alpounet: see it's possible values
<drewby> I think I need to look at more code before I can't write anything.
<drewby> Cause this is not working ...
<rwmjones> yeah there is a project ... with snippets in lots of different languages
<rwmjones> can't recall the name of that right now
<alpounet> derdon, hm, you mean the declaration of the type ?
<derdon> alpounet: yes
<alpounet> hmm afaik there is no way to do that within the ocaml toplevel
<derdon> I don't see any sense in giving types a name
<thelema> derfoo isn't bound to any value.
<drewby> I need to get around the fact that I'm just going to have to blast 10 million match statements everywhere to deall with non-native types?
<alpounet> derdon, what if you want to use these types in other types ?
<alpounet> like in : type 'a tree = Leaf of a | Node of 'a tree list
<alpounet> here we use list withing the tree type
<alpounet> within*
<derdon> alpounet: oh yeah, I forgot recursive types
<alpounet> that isn't the only use case
<alpounet> type foo = Bar of some_type | Baz of some_other_type
<alpounet> you generally declare types, and use them within other types to make more complex types, etc
<derdon> I see
ygrek has quit [Ping timeout: 245 seconds]
<alpounet> so you _need_ to name types so that you can refer to them later, for example within other types' declarations
<alpounet> `Foo 1;;
<xavierbot> - : [> `Foo of int ] = `Foo 1
drunK has joined #ocaml
_unK has quit [Ping timeout: 240 seconds]
ygrek has joined #ocaml
<alpounet> rwmjones, will xavierbot be online 24/24 ?
<rwmjones> alpounet, if you want :-) people have complained
<rwmjones> let foo () = foo () ;;
<xavierbot> Characters 14-17:
<xavierbot> let foo () = foo () ;;
<xavierbot> ^^^
<xavierbot> Error: Unbound value foo
<rwmjones> let rec foo () = foo () ;;
<xavierbot> val foo : unit -> 'a = <fun>
<rwmjones> foo () ;;
miyako has quit [Quit: leaving]
<xavierbot> Objective Caml version 3.11.2
<xavierbot> Unix.Unix_error(30, "chroot", "/var/local/xavierbot/chroot")
<xavierbot> Objective Caml version 3.11.2
<xavierbot> Unix.Unix_error(30, "chroot", "/var/local/xavierbot/chroot")
<xavierbot> Objective Caml version 3.11.2
<xavierbot> Unix.Unix_error(30, "chroot", "/var/local/xavierbot/chroot")
<xavierbot> Objective Caml version 3.11.2
<rwmjones> hmm bug
xavierbot has quit [Remote host closed the connection]
<dark> drewby, hi
<alpounet> rwmjones, well, the channel isn't *that much* active, and i remember many situations when i'd have appreciated having an irc toplevel around
<dark> <thelema> global functions can't have any '_a > all '_a must be resolved to a single type, right?
<rwmjones> alpounet, ok I'll try to find a server to run him from
avsm has joined #ocaml
<dark> but what about having a global variable that has a ref to [], and having two global functions that add and remove elements from it?
<dark> that global function should have a temporary type of '_a, until it is resolved for the first time
<rwmjones> dark, that's right .. in the toplevel it'll be '_a, but in a compiled program the compiler will be able to work out the "first" type and resolve what '_a is
<dark> but what if the function isn't called in a way that makes the compiler able to resolve it? the compiler will resolve '_a to 'a?
<rwmjones> I think in a standalone program that would be an error
<dark> hmm yes it would complicate matters of compilation units
<dark> separate compilation, and further type-safe linking
Demitar has quit [Quit: Bubbles!]
derdon has quit [Quit: leaving]
mjonsson has quit [Ping timeout: 268 seconds]
Demitar has joined #ocaml
ikaros has joined #ocaml
<companion_cube> hi, I've got a problem compiling a small program with threads and Dynlink : http://ocaml.pastebin.com/kAWfNsui
inkbottle has joined #ocaml
inkbottle has left #ocaml []
<rwmjones> companion_cube, that link gives me an error
<companion_cube> http://ocaml.pastebin.com/Cqytq7dJ this should work better, I'm sorry
<rwmjones> companion_cube, the problem is just that you need to move 'main.ml' along the command line until *after* the *.cmxa files
<rwmjones> so ..... unix.cmxa main.ml .....
geb has quit [Excess Flood]
<companion_cube> the error is still there :/
<companion_cube> should i put main.ml after the c libs linking options ?
geb has joined #ocaml
AxleLonghorn has left #ocaml []
<rwmjones> companion_cube, no, -cclib shouldn't matter ... are you sure that you've moved it? maybe the Makefile needs to be recompiled itself (eg. if it's a Makefile.in file)
<companion_cube> well, i moved the object files (.cmx) at the end of the line, and it worked :)
<companion_cube> thanks !
xavierbot has joined #ocaml
<rwmjones> let foo () = foo () ;;
<xavierbot> Characters 13-16:
<xavierbot> let foo () = foo () ;;
<xavierbot> ^^^
<xavierbot> Error: Unbound value foo
<rwmjones> let rec foo () = foo () ;;
<xavierbot> val foo : unit -> 'a = <fun>
<rwmjones> foo () ;;
<xavierbot> Objective Caml version 3.11.2
<xavierbot> Camlp4 Parsing version 3.11.2
Associat0r has joined #ocaml
avsm has quit [Quit: Leaving.]
<rwmjones> let x y = y x ;;
<xavierbot> Characters 12-13:
<xavierbot> let x y = y x ;;
<xavierbot> ^
<xavierbot> Error: Unbound value x
<rwmjones> let rec x y = y x ;;
<xavierbot> Characters 17-18:
<xavierbot> let rec x y = y x ;;
<xavierbot> ^
<xavierbot> Error: This expression has type ('a -> 'b) -> 'c
<xavierbot> but an expression was expected of type 'a
<rwmjones> let rec fix f x = f (fix f) x;;
<xavierbot> val fix : (('a -> 'b) -> 'a -> 'b) -> 'a -> 'b = <fun>
<rwmjones> fix (fun x -> x * 2) 4 ;;
<xavierbot> Characters 15-16:
<xavierbot> fix (fun x -> x * 2) 4 ;;
<xavierbot> ^
<xavierbot> Error: This expression has type 'a -> 'b
<xavierbot> but an expression was expected of type int
<rwmjones> fun x -> x * 2 ;;
<xavierbot> - : int -> int = <fun>
<rwmjones> let f x = x * 2 ;;
<xavierbot> val f : int -> int = <fun>
<rwmjones> fix f f ;;
<xavierbot> Characters 5-6:
<xavierbot> fix f f ;;
<xavierbot> ^
<xavierbot> Error: This expression has type int -> int
<xavierbot> but an expression was expected of type ('a -> 'b) -> 'a -> 'b
<rwmjones> fix f map ;;
<xavierbot> Characters 5-6:
<xavierbot> fix f map ;;
<xavierbot> ^
<xavierbot> Error: This expression has type int -> int
<xavierbot> but an expression was expected of type ('a -> 'b) -> 'a -> 'b
<rwmjones> fix map f ;;
<xavierbot> Characters 5-8:
<xavierbot> fix map f ;;
<xavierbot> ^^^
<xavierbot> Error: Unbound value map
<rwmjones> fix List.map f ;;
<xavierbot> Characters 5-13:
<xavierbot> fix List.map f ;;
<xavierbot> ^^^^^^^^
<xavierbot> Error: This expression has type ('a -> 'b) -> 'a list -> 'b list
<xavierbot> but an expression was expected of type ('a -> 'b) -> 'a -> 'b
* rwmjones harumphs
<alpounet> let fix f = let rec x = f x in x;;
<xavierbot> Characters 25-28:
<xavierbot> let fix f = let rec x = f x in x;;
<xavierbot> ^^^
<xavierbot> Error: This kind of expression is not allowed as right-hand side of `let rec'
<alpounet> let rec fix f x = f (fix f) x;;
<xavierbot> val fix : (('a -> 'b) -> 'a -> 'b) -> 'a -> 'b = <fun>
<flux> maybe xavierbot could compress more of its output into a single line :-)
<rwmjones> patches welcome :-)
<alpounet> let factaux fact = function | 0 -> 1 | n -> n * fact(n-1) in (fix factaux) 6
<alpounet> let factaux fact = function | 0 -> 1 | n -> n * fact(n-1) in (fix factaux) 6;;
<xavierbot> - : int = 720
<orbitz> does it handle infinite loops properly?
<flux> yes
<orbitz> let rec f () = f () in f;;
<xavierbot> - : unit -> 'a = <fun>
septract has joined #ocaml
<rwmjones> orbitz, you need to call f ()
<orbitz> oh durh
<orbitz> let rec f () = f () in f ();;
<xavierbot> Objective Caml version 3.11.2
<xavierbot> Camlp4 Parsing version 3.11.2
hcarty has joined #ocaml
<orbitz> does xavierbot basically just do tail -n 2 on the output?
ulfdoz has quit [Quit: reboot]
<hcarty> rwmjones
<hcarty> oops - that was meant to be "rwmjones++ for the new xavierbot release"
<rwmjones> orbitz, download the source and find out :-)
<hcarty> And the comment about 1970's programming
<orbitz> rwmjones: Dam you win :)
<rwmjones> orbitz, actually it uses a bunch of perl to provide the interface to IRC, of course because Perl _has_ those libraries
<orbitz> rwmjones: is it easy to setup teh chroot jail?
<orbitz> Hrm
<orbitz> With a reasonabel ideone interface, I could just outsource running arbitrary code to that
ulfdoz has joined #ocaml
Submarine has quit [Ping timeout: 248 seconds]
drunK has quit [Remote host closed the connection]
drewby has left #ocaml []
<flux> it mostly works
<flux> :)
<rwmjones> flux, hmm .. problem is it removes the self-limit on flooding
ftrvxmtrx has quit [Quit: Leaving]
<flux> rwmjones, does it? I thought that limit is intact
<flux> rwmjones, it's just called 'line_number' instead of 'flood_limit'
<rwmjones> ok right I see
<flux> there appears to be an off-by-one there (in the end of the hilighted region), but the offset changes from the first produced error to the following ones, I don't know why it does that :)
yakischloba has quit [Ping timeout: 260 seconds]
ftrvxmtrx has joined #ocaml
krankkatze has quit [Remote host closed the connection]
krankkatze has joined #ocaml
enthymeme has joined #ocaml
ygrek has quit [Ping timeout: 245 seconds]
jeddhaberstro has joined #ocaml
septract has quit [Quit: septract]
SEcki has joined #ocaml
Amorphous has quit [Ping timeout: 265 seconds]