mbishop changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | Grab Ocaml 3.10.0 from http://caml.inria.fr/ocaml/release.html (featuring new camlp4 and more!)
fulgencio has left #ocaml []
ednarofi has quit [Read error: 110 (Connection timed out)]
ednarofi has joined #ocaml
buluca has quit [Read error: 113 (No route to host)]
fulgencio has joined #ocaml
seafoodX has joined #ocaml
fulgencio has left #ocaml []
seafoodX has quit []
ednarofi has quit [Read error: 110 (Connection timed out)]
ednarofi has joined #ocaml
seafoodX has joined #ocaml
seafoodX has quit [Remote closed the connection]
seafoodX has joined #ocaml
ednarofi has quit [Read error: 110 (Connection timed out)]
seafoodX has quit []
ednarofi has joined #ocaml
G has quit [Connection timed out]
piggybox_ has joined #ocaml
seafoodX has joined #ocaml
netx has quit [Read error: 110 (Connection timed out)]
fulgencio has joined #ocaml
piggybox has quit [Connection timed out]
fulgencio has quit []
ednarofi_ has joined #ocaml
ednarofi has quit [Read error: 104 (Connection reset by peer)]
ednarofi_ has quit [Read error: 110 (Connection timed out)]
ednarofi has joined #ocaml
Smerdyakov has quit ["Leaving"]
netx has joined #ocaml
netx has quit ["Leaving"]
netx has joined #ocaml
bluestorm has joined #ocaml
pantsd has quit [Read error: 104 (Connection reset by peer)]
pants1 has joined #ocaml
slipstream-- has joined #ocaml
ednarofi has quit [Read error: 110 (Connection timed out)]
slipstream has quit [Read error: 113 (No route to host)]
netx has quit ["Leaving"]
ShockSMX has quit [Read error: 104 (Connection reset by peer)]
ShockSMX has joined #ocaml
G has joined #ocaml
l_a_m has joined #ocaml
screwt8 has joined #ocaml
netx has joined #ocaml
ygrek has joined #ocaml
rwmjones has joined #ocaml
TFK has joined #ocaml
slipstream-- has quit [Read error: 104 (Connection reset by peer)]
ygrek has quit [Remote closed the connection]
dmentre has joined #ocaml
slipstream has joined #ocaml
m3ga has joined #ocaml
xavierbot has joined #ocaml
buluca has joined #ocaml
cpst has quit [Read error: 104 (Connection reset by peer)]
cpst has joined #ocaml
Hadaka has quit [heinlein.freenode.net irc.freenode.net]
ulfdoz has quit [heinlein.freenode.net irc.freenode.net]
arcatan has quit [heinlein.freenode.net irc.freenode.net]
TFK has quit [heinlein.freenode.net irc.freenode.net]
piggybox_ has quit [heinlein.freenode.net irc.freenode.net]
EliasAmaral has quit [heinlein.freenode.net irc.freenode.net]
smkl has quit [heinlein.freenode.net irc.freenode.net]
flux has quit [heinlein.freenode.net irc.freenode.net]
danderson has quit [heinlein.freenode.net irc.freenode.net]
TFK has joined #ocaml
piggybox_ has joined #ocaml
danderson has joined #ocaml
EliasAmaral has joined #ocaml
Hadaka has joined #ocaml
arcatan has joined #ocaml
flux has joined #ocaml
smkl has joined #ocaml
ulfdoz has joined #ocaml
mari-trevelez has joined #ocaml
mari-trevelez has quit [Client Quit]
bluestorm has quit [Read error: 104 (Connection reset by peer)]
bluestorm has joined #ocaml
ygrek has joined #ocaml
Hadaka has quit [heinlein.freenode.net irc.freenode.net]
ulfdoz has quit [heinlein.freenode.net irc.freenode.net]
arcatan has quit [heinlein.freenode.net irc.freenode.net]
smkl has quit [heinlein.freenode.net irc.freenode.net]
danderson has quit [heinlein.freenode.net irc.freenode.net]
piggybox_ has quit [heinlein.freenode.net irc.freenode.net]
flux has quit [heinlein.freenode.net irc.freenode.net]
TFK has quit [heinlein.freenode.net irc.freenode.net]
EliasAmaral has quit [heinlein.freenode.net irc.freenode.net]
cpst has quit [heinlein.freenode.net irc.freenode.net]
l_a_m has quit [heinlein.freenode.net irc.freenode.net]
ShockSMX has quit [heinlein.freenode.net irc.freenode.net]
vuks has quit [heinlein.freenode.net irc.freenode.net]
authentic has quit [heinlein.freenode.net irc.freenode.net]
shrimpx has quit [heinlein.freenode.net irc.freenode.net]
Oatmeat|umn has quit [heinlein.freenode.net irc.freenode.net]
cmeme has quit [heinlein.freenode.net irc.freenode.net]
Tortugo has quit [heinlein.freenode.net irc.freenode.net]
Sparkles has quit [heinlein.freenode.net irc.freenode.net]
Ycros has quit [heinlein.freenode.net irc.freenode.net]
ramkrsna has quit [heinlein.freenode.net irc.freenode.net]
bluestorm has quit [heinlein.freenode.net irc.freenode.net]
buluca has quit [heinlein.freenode.net irc.freenode.net]
slipstream has quit [heinlein.freenode.net irc.freenode.net]
rwmjones has quit [heinlein.freenode.net irc.freenode.net]
G has quit [heinlein.freenode.net irc.freenode.net]
tsuyoshi has quit [heinlein.freenode.net irc.freenode.net]
m3ga has quit ["disappearing into the sunset"]
zmdkrbou_ has joined #ocaml
__mattam__ has joined #ocaml
bebui has joined #ocaml
bluestorm has joined #ocaml
buluca has joined #ocaml
slipstream has joined #ocaml
rwmjones has joined #ocaml
G has joined #ocaml
tsuyoshi has joined #ocaml
ygrek has quit [Remote closed the connection]
bebui_ has quit [Read error: 110 (Connection timed out)]
zmdkrbou has quit [Read error: 110 (Connection timed out)]
mattam has quit [Read error: 110 (Connection timed out)]
pattern has quit [Killed by ballard.freenode.net (Nick collision)]
smimou has quit [Read error: 110 (Connection timed out)]
ygrek has joined #ocaml
cpst has joined #ocaml
l_a_m has joined #ocaml
ShockSMX has joined #ocaml
vuks has joined #ocaml
authentic has joined #ocaml
Ycros has joined #ocaml
Sparkles has joined #ocaml
ramkrsna has joined #ocaml
Tortugo has joined #ocaml
cmeme has joined #ocaml
shrimpx has joined #ocaml
Oatmeat|umn has joined #ocaml
pattern has joined #ocaml
TFK has joined #ocaml
piggybox_ has joined #ocaml
danderson has joined #ocaml
EliasAmaral has joined #ocaml
Hadaka has joined #ocaml
arcatan has joined #ocaml
flux has joined #ocaml
smkl has joined #ocaml
ulfdoz has joined #ocaml
smimou has joined #ocaml
piggybox__ has joined #ocaml
jlouis has quit [Read error: 110 (Connection timed out)]
seafoodX has quit []
piggybox_ has quit [Success]
seafoodX_ has joined #ocaml
seafoodX_ has quit [Client Quit]
authentic has quit [Read error: 113 (No route to host)]
cpst has quit []
ygrek has quit [Remote closed the connection]
ygrek has joined #ocaml
hcarty has joined #ocaml
hcarty has quit [Client Quit]
authentic has joined #ocaml
hcarty has joined #ocaml
Demitar has quit [Remote closed the connection]
seafoodX has joined #ocaml
__mattam__ is now known as mattam
Demitar has joined #ocaml
Tetsuo has joined #ocaml
netx has quit ["Leaving"]
piggybox__ has quit [Read error: 110 (Connection timed out)]
ednarofi has joined #ocaml
as has joined #ocaml
as is now known as gene9
gene9 has quit [Client Quit]
ygrek has quit [Remote closed the connection]
ygrek has joined #ocaml
seafoodX has quit []
pango has quit [Remote closed the connection]
pango has joined #ocaml
crathman has joined #ocaml
<svenl> hi.
<svenl> anyone familiar with the postgresql bindings around ?
<flux> I've used them
<flux> got anything more specific?-)
<svenl> flux: i wanyt to create the database from inside ocaml.
<svenl> this is done by doing a CREATE DATABASE foo call.
<flux> yes?
<svenl> sadly, if you create a psql connection, it needs an already created database in dbname.
<svenl> so i was not able to do that.
<flux> oh, well I don't think that's related to the bindings
<flux> the same problem elsewhere
<flux> usually you can connect to database template1
<svenl> flux: well.
<rwmjones> svenl, which bindings ...
<svenl> ah ..
<flux> if not, ask the user for it
<svenl> libpostgresql-ocaml in debian, wait.
<svenl> PostgreSQL-OCaml from alain and markus.
<svenl> flux: mmm.
<svenl> flux: the C binding says you can do CREATE DATABASE, which createdb uses, and is documented in -S 7 create_database man page.
<flux> svenl, do you have an url handy?
<flux> svenl, from createdb.c: conn = connectDatabase(strcmp(dbname, "postgres") == 0 ? "template1" : "postgres", host, port, username, password, progname);
<svenl> flux: of the binding ?
<flux> looks very much to me like it's creating a connection to the database temlpate1 or postgres
<flux> svenl, to where it says 'you can use CREATE DATABSE'
<svenl> flux: man -S 7 create_database
<flux> yes, that's the sql command
<flux> and you need a database connection to enter that command
<svenl> mmm, i have a meeting, let's talk later.
<svenl> flux: indeed, so i connect tro template1 or one of the pre-existing databases.
<flux> svenl, yes
Smerdyakov has joined #ocaml
gaja has joined #ocaml
_JusSx_ has joined #ocaml
dmentre has quit ["Leaving."]
crathman_ has joined #ocaml
tty56_ has quit [Read error: 110 (Connection timed out)]
ednarofi_ has joined #ocaml
crathman has quit [Read error: 110 (Connection timed out)]
slipstream-- has joined #ocaml
slipstre1m-- has joined #ocaml
_andre has joined #ocaml
<_andre> does anyone know what is the home page of the syslog-ocaml project? all i can find is debian packages, but no project page
slipstream has quit [Read error: 110 (Connection timed out)]
buluca has quit [Read error: 113 (No route to host)]
slipstream-- has quit [Read error: 113 (No route to host)]
ednarofi has quit [Read error: 110 (Connection timed out)]
<flux> _andre, maybe it's written by a debian maintainer?
<flux> _andre, anyway, such bindings might not even have a home page.. or their home page is one line in a page with dozens of other similar bindings
<svenl> _andre: /usr/share/doc/<pkg>/copyright should give info on the upstream home.
<svenl> let me check.
<svenl> Downloaded from http://homepage.mac.com/letaris/
<_andre> svenl: i've just found that page, thanks :)
<svenl> it doesn't say much though.
<_andre> well, it does have a newer version that debian's :P
<svenl> _andre: heh.
<_andre> s/that/than/
ita has joined #ocaml
<ita> hola
<bluestorm> hi
<ita> bluestorm: i think i have talked to you some time ago
<bluestorm> yes you have
<ita> was it about graph coloring ?
<bluestorm> hm
<bluestorm> about semantik
<bluestorm> i talked about graph coloring on the chan, tough
<ita> ah
<bluestorm> s/i/you/
<ita> i am still in graphs lately
<ita> currently implementing a shortest path routine
<ita> bluestorm: and you, what's up ?
<bluestorm> hm
<bluestorm> i have played with camlp4 recently
<ita> bluestorm: tried twt ?
<bluestorm> exactly :]
<bluestorm> i have something that have some results but would require more work
<bluestorm> but i'm doing other things now, and preparing for school
<ita> there is a preprocessor that does programming by contract, i wish i had time to try it
<ita> shool
<ita> haha
<bluestorm> ^^
<ita> long time i have not typed that word
<bluestorm> actually that's a rather pleasant place
<bluestorm> .. sometimes
<ita> like, it is less frightening than the outside ?
<ita> :-)
<bluestorm> and i can spend more time doing nothing
<bluestorm> wich is very cool
arcatan has quit ["menen nukkumaan."]
<bluestorm> hm
<bluestorm> during my camlp4 adventure i've been using the revised syntax
<bluestorm> and i think some parts of it are really cool
<ita> like ?
<bluestorm> curryfied constructors and types
<flux> btw, that cmigrep from that page (ref svenl less than one hour ago) is useful
<ita> do you prefer twt or p4 ?
<bluestorm> i tried to do a camlp4-twt :p
<bluestorm> type tree = Node | Tree of 'a and 'a tree and 'a tree
<bluestorm> then Tree a left right
<bluestorm> ah
<bluestorm> module functor application is curryfied too
<bluestorm> (types are curryfied too but i'm not sure list (array 'a) is so much better than 'a array list )
<flux> bluestorm, does the revised syntax look to you a bit bracket-heavy?
<bluestorm> yes
<bluestorm> i dislike the brackets and the use of ;
<bluestorm> i may end up trying a extension to add curryfied things in the classical syntax, and nothing more
<bluestorm> the camlp4 3.10 framework is rather nice
<bluestorm> (but i don't know the older one so i can't compare)
<flux> I don't know if it's possible to add curryfying with an extension.. I mean, you can't use any type information in the camlp4-extension, right_
<flux> ?
<bluestorm> hm
<bluestorm> i don't see the relation between those two things
<flux> perhaps I'm misunderstanding what you're thinking to do
<bluestorm> hm
<bluestorm> modifying the parser to use curryfied constructors, for example
<bluestorm> (with a camlp4 extension)
<bluestorm> actually
<bluestorm> in the camlp4 code, the classical syntax is designed as an extension of the revised one
<flux> what kind of transformation would it do when it encounters this code: let a = Foo in a 4 ?
<bluestorm> hum
<bluestorm> you can't do that easily
<bluestorm> hm
<bluestorm> by curryfied i mean the parenthis-free application, but not the partial application semantic
<flux> you atleast need to keep track of constructor arity
<flux> oh, ok
<bluestorm> « This does not mean that the ``partial evaluation'' of constructors is accepted: accept it or not is a semantic issue, treated at OCaml typing time. »
<bluestorm> hm
<bluestorm> btw flux, let a = Foo in a 4 was doable in caml light
<bluestorm> do you have an idea of why it was removed ?
<bluestorm> this was rather nice
<bluestorm> ( if you by chance were interested in seeing my toy twt-camlp4 extension, you can see the source here http://bluestorm.info/projects/awt-0.6-.zip )
<bluestorm> hm
<bluestorm> in camlp4 i discovered a funny way to use the object orientation of OCaml, btw
<pango> bluestorm: XL answered somewhere in the mailing list...
<bluestorm> they use objects in a purely functional, to fold and map on AST trees
<bluestorm> that's neat
<flux> I don't know if there was a real reason.. I think it was just that it could negatively impact code quality or some such excuse ;)
<pango> bluestorm: I think it's something like "it was seldom used, its readability is debatable, and can be emulated using curried function => dropped"
<bluestorm> hm
<bluestorm> it's a shame ^^
<bluestorm> (fun x -> Num x) is not really nice to write
<ita> never add a feature until compelled to do so else users will curse you when you remove it
<bluestorm> :p
<flux> I think it's a bit asymmetric to not have that. it's not like constructors couldn't be viewed as specially-named functions.
<bluestorm> i recently found an old little caml light code in my ~/tmp file (you know, bi-annual tmp cleaning) that used that feature
<bluestorm> hm
<bluestorm> flux: maybe they wanted to keep symmetry with pattern matching
smimou has quit ["bli"]
<bluestorm> pango:
<bluestorm> in this post he highlight the difference between C of int * int and C of (int * int)
<bluestorm> wich i find dangerous and confusing
<bluestorm> revised syntax fixed that nicely, i think
<flux> well, on the other hand I've got atleast one module where I have let foo a b c = Foo a b c for all the constructors related to a type
<bluestorm> C of int and int
<flux> but that's mostly because I also have some functions that don't directly map into a single constructor
<flux> but it gives me the advantage that I can use them with List.map etc nicely
bluestorm is now known as bluestorm_afk
<flux> (actually my "constructor currying" use cases are only with one argument)
cpst has joined #ocaml
ita has quit [Read error: 104 (Connection reset by peer)]
<flux> perhaps a language extension could be deviced
<flux> type foo = Foo | Bar of int | Baz with constructors
<flux> -> let foo = Foo let bar a = Bar a etc
slipstream has joined #ocaml
ednarofi_ has quit [Read error: 104 (Connection reset by peer)]
<Smerdyakov> How about a "language extension" that says "use SML if you want this"? :P
slipstre1m-- has quit [Read error: 110 (Connection timed out)]
<bluestorm_afk> flux:
<bluestorm_afk> hm
<bluestorm_afk> campl4 can declare foo bar and baz automagically
ygrek has quit [Remote closed the connection]
<bluestorm_afk> altought _Foo may be a better choice, to avoid name clashes
<Smerdyakov> Oh, yeah, code generation that defines identifiers that begin with underscores! This is great stuff! :D
jlouis has joined #ocaml
joshcryer has quit [Client Quit]
mattam has quit [Read error: 110 (Connection timed out)]
<bluestorm_afk> hm Smerdyakov
<bluestorm_afk> it may actually even be possible to use Foo itself
<bluestorm_afk> by expanding Foo in (fun x -> Foo x) in every expression, that may work
leo037 has joined #ocaml
slipstream-- has joined #ocaml
<Smerdyakov> You want campl4 to do that?
_andre has quit ["Lost terminal"]
<bluestorm_afk> Smerdyakov: why not ?
<Smerdyakov> It's just icky!
buluca has joined #ocaml
slipstream has quit [Read error: 110 (Connection timed out)]
mattam has joined #ocaml
thruspa has joined #ocaml
<thruspa> Hi.
<thruspa> I've been trying to solve a beginner's doubt for some time, and I confess I'm absolutely lost.
<thruspa> Would someone please explain me what's wrong with a small imperative function?
<Smerdyakov> Give a URL to its code and find out!
<thruspa> Thanks! Just a moment...
<Smerdyakov> BTW, it's probably a bad idea to be writing imperative OCaml code as a beginner.
<thruspa> I come from Haskell, and I wanted something a little more manageable than mutable arrays and monads.
<thruspa> The problem with the code is that, for example, arr.(0).(0) is (99,0), when it should be (0,0), I think.
<thruspa> There seems to be some problem when assigning i to the array.
<Smerdyakov> OCaml has no referential transparency.
<Smerdyakov> Does that hint help you see the problem?
ita has joined #ocaml
<thruspa> I'm afraid it does not. Sorry.
<Smerdyakov> Do you understand what Array.make does?
<thruspa> Of course.
<Smerdyakov> What does it do?
<thruspa> It creates a mutable array of the given size, initialised to the given value.
<Smerdyakov> OK. How many array cells total do you think your first line creates?
<thruspa> An array consisting of 100 arrays, with 100 tuples of type (int, int) each.
<thruspa> A 100x100 matrix of tuples.
<Smerdyakov> And which expressions are responsible for which (and how many) array cell allocations?
<thruspa> The outer Array.make allocates 100 cells, each one initialised (then allocated), to contain another array of 100 cells, each one initialised (then allocated) to contain a tuple (0,0).
<thruspa> I think :-) .
<Smerdyakov> Well, you only call Array.make twice, with an argument sum of 200, so your first line can only allocate 200 cells.
Len1 has joined #ocaml
<thruspa> I don't think so.
<thruspa> It's a recursive call.
<Smerdyakov> Where's the recursion?
<thruspa> The first Array.make performs 100 allocations (initialisations).
<thruspa> Each of these 100 allocations performs another 100 allocations.
<Smerdyakov> Array.make doesn't do anything but copy a value into every new cell.
<Smerdyakov> It doesn't execute custom code for you.
<Smerdyakov> Its type alone is enough to prove that.
<thruspa> It's type is (int * int) Array Array, that is, a matrix.
<thruspa> Besides, I can print, say, arr.(99).(99) with no error in bounds, so I think it contains 10,000 cells.
<Smerdyakov> The type of Array.make is int -> 'a -> 'a array.
<Smerdyakov> It doesn't contain 10,000 *distinct* cells.
<Smerdyakov> Only 200 distinct cells.
<thruspa> Hum...
<thruspa> If I try:
<thruspa> # let mk2 a b = Array.make a (Array.make b (0,0)) ;;
<thruspa> I get:
<thruspa> val mk2 : int -> int -> (int * int) array array = <fun>
<thruspa> It creates an array of arrays, that is, a matrix.
<Smerdyakov> Yes. What does that have to do with what I'm saying?
<thruspa> That's the first line in my program, with a=100, b=100.
<thruspa> I create an array of arrays.
<Smerdyakov> Let's try an analogy from everyday life.
<Smerdyakov> Every kid in the class is going to bring in a postcard from another country.
<Smerdyakov> There is a big difference between these two scenarios:
<Smerdyakov> There is a country called Foo, and every kid has a postcard from Foo.
<Smerdyakov> There is a family of countrys Foo1 through FooN, and kid I has a postcard from FooI. Every FooI looks the same, and so has the same picture on the postcard.
<Smerdyakov> But we could nuke Foo8 and Kid8's postcard would become inaccurate. The rest would still be accurate.
<Smerdyakov> Nuke Foo and every kid in the first scenario has an inaccurate postcard.
<Smerdyakov> <end of parable>
_JusSx_ has quit ["leaving"]
<thruspa> I think I understand what you are trying to say.
<thruspa> The array array is created, but each entry is an aliased reference to the same vector.
<Smerdyakov> Your code now implements the first scenario.
<thruspa> That is, the inner Make Array is only called once.
<thruspa> Of course, once I see it it's clearly obvious.
<thruspa> Thank you very much!
<Smerdyakov> Any time. :)
<Smerdyakov> This is a demonstration of why imperativity is bad.
<thruspa> I'd say that imperativity is evil, but sometimes a neccesary evil :) .
<thruspa> How do you think I should define an array of arrays in OCaml. With a loop?
<Smerdyakov> Array.create_matrix seems to do what you want handily.
<Smerdyakov> I guess Array.make_matrix is the non-deprecated name.
<Smerdyakov> I never use loops, personally, and I yell at people who _do_ use them. :-)
<thruspa> Thanks. I think a need a good session of RTFM :-)
<thruspa> Yes, it's Array.make_matrix.
<thruspa> Well, I am really grateful. I was about to return to Haskell in desperation.
<Smerdyakov> BTW, if you want high-performance numeric array code, consider SML w/ MLton instead of OCaml.
<Smerdyakov> I guess OCaml special-cases representation of numeric arrays, but it won't do that for other related structures.
<Smerdyakov> Boxing floating point values left and right
<thruspa> OCaml has some great libraries. I chose it for that, besides the performance.
<thruspa> I love the Graphics library. The Haskell equivalent is currently rather broken.
<danderson> so, if I wanted to learn ocaml coming from a C/C++/Python background, where should I start?
<danderson> I've also done a little lisp, but I do feel like I'm stepping into a very alien world with ocaml
<Smerdyakov> danderson, you will want a book that introduces functional programming.
<danderson> like I said, I have done some functional programming in the past, so it's not entirely alien. Just very :-)
<Smerdyakov> If you can grok the tutorial in the OCaml manual, then that should do fine.
<thruspa> Functional programming looks strange at first, but is very rewarding and productive.
<Smerdyakov> People without significant FP experience generally can't, though.
<thruspa> I love it.
<danderson> right, I hear that of FP. But I'm still in the head-scratching phase so far.
<danderson> so, a book it is then.
jlouis_ has joined #ocaml
<thruspa> I liked this intro: http://www.ocaml-tutorial.org/
<thruspa> Besides, there are some books. Let me look a bit...
<thruspa> This books compares features of C and OCaml.
<danderson> thanks.
jlouis has quit [Read error: 110 (Connection timed out)]
<thruspa> This other book, I think, is rather complex (BNF diagrams and all that): http://caml.inria.fr/pub/docs/u3-ocaml/index.html
<thruspa> But it is, along with other references, in the OCaml documentation page: http://caml.inria.fr/resources/doc/index.en.html
<thruspa> I'm currently learning OCaml, but I have been working with FP for some time. I started with Haskell, and I think OCaml is much more accesible.
<Smerdyakov> I'm sorry to have to tell you that you may have trouble with OCaml if you find BNF diagrams complex. ;)
<ita> what is a bnf diagram once again ? :-)
<Smerdyakov> Just a context-free grammar in usual notation.
<Smerdyakov> Folks generally feel free to include syntactic sugar for things like repetition, but it's basically CFG.
<thruspa> Well, I've been having trouble with OCaml, as you know... :)
<ita> thruspa: try http://people.csail.mit.edu/mikelin/ocaml+twt/ to make it look like python
<ita> with this the source code compresses better too :-)
<thruspa> It looks good. I don't very much like the ;; thing.
<hcarty> thruspa: ;; isn't usually needed outside of the toplevel from what I've seen/understand
<thruspa> Anyway, I'd like to learn the true OCaml before adding syntactic sugar.
<ita> thruspa: lol
smimou has joined #ocaml
<bluestorm_afk> thruspa:
<bluestorm_afk> to avoid Array.make aliasing in situations were you won't use Array.make_matrix
<bluestorm_afk> use Array.init
<bluestorm_afk> (for example for a 3D array creation)
<thruspa> Great! I was wondering how to make a n-dimensional array, but I was afraid to ask :)
<bluestorm_afk> hm
<bluestorm_afk> a generic function for a n-dimensional array will require a recursive algebraic type
<thruspa> I wonder why the type of Array.init is int->(int->'a)->a' array instead of int->('b->'a)->'a array.
<bluestorm_afk> where would the 'b come from ?
bluestorm_afk is now known as bluestorm
<thruspa> Well, just to make it more general. Why restrict the function to integer values?
<bluestorm> hm
<bluestorm> what else could Array.init give ?
<thruspa> Of course, the int is for the index of the array.
<thruspa> I see.
<bluestorm> this is not the "logical" choice, it is the only one ^^
<thruspa> :)
<bluestorm> Array.init couldn't have a 'b coming from her hat magically
crathman_ has quit ["ChatZilla 0.9.78.1 [Firefox 2.0.0.6/2007072518]"]
seafoodX has joined #ocaml
leo037 has quit ["Leaving"]
bluestorm has quit ["Konversation terminated!"]
pants1 has quit ["Leaving."]
Len1 has quit ["Leaving."]
Tetsuo has quit ["Leaving"]
ita has quit [Remote closed the connection]