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!)
psnively has quit [Connection timed out]
piggybox has joined #ocaml
piggybox_ has joined #ocaml
seafoodX has joined #ocaml
piggybox has quit [Connection timed out]
psnively_ has quit []
CosmicRay has quit [Read error: 110 (Connection timed out)]
Amorphous has quit [Read error: 104 (Connection reset by peer)]
Amorphous has joined #ocaml
piggybox__ has joined #ocaml
pion has quit [Read error: 110 (Connection timed out)]
piggybox_ has quit [Read error: 110 (Connection timed out)]
seafood has joined #ocaml
<seafoodX> Who uses tuareg of the original ocaml emacs environment here?
<seafoodX> of -> or
<Smerdyakov> I use caml-mode. I think I install it from the Debian package of that name.
<seafoodX> Smerdyakov: Hiya. I've got a question about indentation and, indirectly, nesting...
<seafoodX> Look at this program;
<seafoodX> let nest0 x =
<seafoodX> let nest1_0 x =
<seafoodX> let nest2_0 x = x + 2
<seafoodX> in 2 + nest2 x in
<seafoodX> let nest1_1 x =
<seafoodX> let nest2_1 x = x + 3
<seafoodX> in 4 + nest2_1 x
<seafoodX> in
<Smerdyakov> Too many lines pasted.
<seafoodX> nest1_0 x + nest1_1 x
<seafoodX> Argh. That didn't come out right.
<Smerdyakov> Never do more than 3 lines of pasting on IRC without explicit verification that channel policies permit.
<seafoodX> 3 lines... Okay, I was just trying to restrict myself to "not many".
<seafoodX> Okay, I'm going to write this by hand.
<seafoodX> let nest0 x =
<seafoodX> let nest1_0 = ...
<seafoodX> let nest1_1 = ...
<mbishop> probably better to just use a pastebin :P
<seafoodX> Okay, so I realise that nest1_1 is, in fact, nested within nest1_0 since nest1_0 is in scope inside nest1_1.
<seafoodX> However, most indentation packages will put them at the same level of indentation.
<mbishop> I think that's bad style?
<seafoodX> You do or you don't. The question mark makes it a bit hard to understand.
<seafoodX> (And the lack of a question mark after "You do or you don't" makes it hard to understand that I'm asking a question ;P
<Smerdyakov> seafood, you're asking a question?
<seafoodX> Yes. I'm asking whether people consider that bad style or not.
<Smerdyakov> You're asking whether the indentation present in your pasted version is bad style?
<seafoodX> Anyway, here's an alternative. http://rafb.net/p/tsMuAx63.html
<seafoodX> Smerdyakov: Yes, I'm asking that.
<Smerdyakov> I think your original uses the right style.
<seafoodX> So did I.
<Smerdyakov> (I personally like to put 'in's at line ends, not line beginnings.)
<seafoodX> Smerdyakov: I actually put the 'in' at the beginning only when I get to what I call the "body" of the function.
<seafoodX> (Which we discussed before...)
<mbishop> I suppose the first is correct, yes, just looks weird on multiple lines, mine are usually single lines, and the let's line up
<seafoodX> Anyway, I recently started using an IDE called OcaIDE for Eclipse. It's pretty cool. It has an outline window which shows a tree-like structure of functions. It's really handy for jumping to different parts of the function. Unfortunately, it puts nest1_1 at a deeper level of indentation than nest1_0, even though I think of them as being at the same level of nesting.
<seafoodX> (This is for the first example.)
<seafoodX> The only way to get nest1_0 and nest1_1 to appear at the same level is to use the second variant I pasted above.
<seafoodX> But that forces me to make the functions mutually recursive.
<seafoodX> (I may not want that.)
<seafoodX> I've spoken to the developer, but as yet have failed to communicate exactly what I mean about nesting. Do you guys think I have a case for changing the indentation scheme?
<seafoodX> (For the outline window)
<Smerdyakov> I think the change you are asking for is a good idea.
mphill22 has joined #ocaml
<mphill22> how do i exit the console if i run ocaml lol
Submarine has quit [Remote closed the connection]
<seafoodX> Smerdyakov: Actually I'm only hoping that he'll provide it as an extra option so that users can select between one of two nesting styles. That way everyone is happy.
<Smerdyakov> mphill22, send end-of-file.
<mphill22> how??
<seafoodX> The funny thing is his auto-indent package already indents in the style I wrote in my first paste.
<seafoodX> mphill22: Ctrl-d will often do it.
<mphill22> there we go. thankyou
<seafoodX> mphill22: Depends on your terminal package of course. But glad that did the trick.
<seafoodX> Okay guys, I've got another observation about OCaml. Doing arbitrary precision integer arithmetic in OCaml is syntactically verbose. Any way around this?
<seafoodX> Perhaps using the module system?)
Smerdyakov has quit ["Leaving"]
piggybox__ is now known as piggybox
slipstream-- has joined #ocaml
slipstream has quit [Read error: 110 (Connection timed out)]
CosmicRay has joined #ocaml
USACE_ has quit [Client Quit]
piggybox has quit [Read error: 104 (Connection reset by peer)]
piggybox has joined #ocaml
shrimpx has joined #ocaml
<shrimpx> anyone know how to force mlyacc to parse "a b c" as "(a b) c" ?
<shrimpx> ocamlyacc that is
CosmicRay has quit ["Client exiting"]
m3ga has joined #ocaml
cmeme has quit ["Client terminated by server"]
cmeme has joined #ocaml
m3ga has quit ["disappearing into the sunset"]
m3ga has joined #ocaml
m3ga has quit ["disappearing into the sunset"]
Hadaka has quit [anthony.freenode.net irc.freenode.net]
Hadaka has joined #ocaml
cmeme has quit ["Client terminated by server"]
cmeme has joined #ocaml
Mr_Awesome has quit ["time to get a new keyboard..."]
thesoko has quit [Remote closed the connection]
<tsuyoshi> seafoodX: you can define operators
<seafoodX> tsuyoshi: True. But what if you want two forms of arithmetic in the same module?
<tsuyoshi> like
<seafoodX> I dunno, int32s and big_ints
<shrimpx> tsuyoshi: ya fixed it
<tsuyoshi> let (+@) = Num.add_num
<tsuyoshi> goddamn
<tsuyoshi> I am not yet used to where they put punctuation on a japanese keyboard
<tsuyoshi> and then you can do
<tsuyoshi> bignum1 +@ bignum2
<tsuyoshi> or whatever
<seafoodX> That's very nice. But you would have to define other operators like +@@ for int32s if you wanted to use them in the same file.
<seafoodX> I suppose that works...
<tsuyoshi> yeah, no overloading
<tsuyoshi> because of the type inference
<shrimpx> seafoodX: is your nick really seafoodX or are you making fun of mine
<seafoodX> tsuyoshi: Or because of the lack of type classes.
<seafoodX> shrimpx: It doesn't seem credible, but my answer is yes, my name is really seafoodX.
<seafoodX> But I will tell you about the etymology.
<tsuyoshi> type classes? I don't know what those are
<seafoodX> tsuyoshi: Haskell feature.
<shrimpx> seafoodX: sweet
<seafoodX> seafood is me too.
<seafoodX> seafood is a lurker.
<tsuyoshi> haskell makes my head hurt
<seafoodX> tsuyoshi: But it's so much like OCaml!
<tsuyoshi> maybe after I finish learning japanese I will try learning it again
<seafoodX> shrimpx: So, my real name is Sean Seefried. Seefried -> sea fried -> seafood.
<tsuyoshi> haskell seems like the new lisp
<shrimpx> wasn't there a proposal to add haskell-like typeclasses to ocaml?
<seafoodX> seafoodX is the sporadically connecting version of seafood.
<seafoodX> It's the real me.
<shrimpx> and people say that caml functors are better than typeclasses anyway something something
<seafoodX> shrimpx: Wouldn't know about type class proposal since I've only been part of the OCaml community for a short while.
<seafoodX> shrimpx: If someone can show me how you use functors to simulate type classes then I'm all ears.
<tsuyoshi> like all the people who learn new languages even when they don't need to for work, are all flocking to haskell
<seafoodX> shrimpx: Can you give me a reference?
<shrimpx> searching
<seafoodX> Cheers!
<shrimpx> check out the "modular type classes"
<seafoodX> Ah, Derek Dreyer's. I've met him.
<seafoodX> He visited us in Sydney for a few months.
<shrimpx> ah
<shrimpx> is that where univ of south wales is?
<seafoodX> Yup
<seafoodX> shrimpx: The paper looks interesting. (That's what they were working on when he visited.) But the functionality of type classes only comes if the proposed extension to the module language is implemented.
<seafoodX> So for now I have to do without ....
<shrimpx> manuel chakravary knows all about typeclsses<->functors =)
<seafoodX> He's my former advisor ;)
<shrimpx> ok i think this is the paper i was thikning about http://www.cse.unsw.edu.au/~chak/papers/modules-classes.pdf
<shrimpx> haha
<shrimpx> nice
<seafoodX> Hehe. I know Stefan Wehr too ;) Again, this is only a translation between the two.
<seafoodX> I need it as a feature! :)
<seafoodX> But thanks for the links.
<seafoodX> Where are you from shrimpx?
<seafoodX> Or rather, where are you?
<shrimpx> seattle us
<tsuyoshi> oh, I am from seattle
<shrimpx> weird
<shrimpx> let's go to bars
<tsuyoshi> but I am in tokyo now
<shrimpx> oh
<tsuyoshi> I used to live in pioneer square
<shrimpx> i hear people get shot there
<shrimpx> especially seahawks players
<shrimpx> or no seahawks beat up people there
<tsuyoshi> there was a guy that got shot about 50 feet from where I lived
<shrimpx> crazy
<tsuyoshi> it was actually the only time I've ever heard gunshots
<shrimpx> the new place to get shot now is tommy's on the ave
<shrimpx> i live in capitol hill where people just get drunk and avoid jobs
<tsuyoshi> how can you afford to live in capitol hill without a job?
<shrimpx> i have a job =)
<tsuyoshi> I see
<shrimpx> but you can share a 4-bedroom house with 9 people otherwise
<tsuyoshi> here I share a 4 bedroom house with 20 people
<tsuyoshi> rent is cheaper than anything I ever found in seattle though
<shrimpx> haha
<shrimpx> isnt pioneer sq expensive?
<tsuyoshi> well, I was living in my office
<tsuyoshi> I went to the gym for showers
<shrimpx> there are these old warehouse buildings down there i was wondering if i could live in one
<tsuyoshi> ate only microwavable food
<shrimpx> haha
<tsuyoshi> so rent was free
<shrimpx> wow
<tsuyoshi> if you get an actual apartment in pioneer square, it's pretty expensive
<tsuyoshi> but offices are cheap... there are actually quite a few people who just rent offices to live in
<shrimpx> yea i should look into that
<shrimpx> i want ot live in a warehouse type thing and build a makeshift loft
<shrimpx> and put a basketball hoop in there
<shrimpx> and throw andy warhol parties
<shrimpx> like in midnight cowboy
<shrimpx> hmm
<seafoodX> tsuyoshi: Why are you living with 20 people?
seafoodX has quit []
xavierbot has quit [Remote closed the connection]
rwmjones has quit [Remote closed the connection]
rwmjones has joined #ocaml
xavierbot has joined #ocaml
G_ has joined #ocaml
kosmikus has quit ["leaving"]
G has quit [Read error: 110 (Connection timed out)]
<tsuyoshi> because this way I get to live in shinjuku for only 42000 yen a month
beschmi has joined #ocaml
piggybox_ has joined #ocaml
descender has quit [Remote closed the connection]
piggybox has quit [Read error: 110 (Connection timed out)]
G has joined #ocaml
G_ has quit [Connection timed out]
piggybox has joined #ocaml
Smerdyakov has joined #ocaml
piggybox_ has quit [Read error: 110 (Connection timed out)]
eradman has quit [Client Quit]
pion has joined #ocaml
piggybox_ has joined #ocaml
pango has quit [Remote closed the connection]
piggybox__ has joined #ocaml
seafoodX has joined #ocaml
pango has joined #ocaml
piggybox has quit [Connection timed out]
piggybox_ has quit [Connection timed out]
seafoodX has quit []
twobitsp1ite has quit ["Lost terminal"]
pantsd has quit ["Leaving."]
seafoodX has joined #ocaml
pion has quit [Read error: 110 (Connection timed out)]
CosmicRay has joined #ocaml
descender has joined #ocaml
piggybox_ has joined #ocaml
seafoodX has quit []
piggybox__ has quit [Read error: 110 (Connection timed out)]
ygrek has joined #ocaml
alfredr_ has joined #ocaml
<alfredr_> how do i print a list? i think it's too big for the whole thing to display at the command prompt
<alfredr_> it did this weird [...]..] thing near the end
<alfredr_> it's an int list list to be exact, and i need the whole thing
<Smerdyakov> You want to alter the depth cut-off of the repl, or you actually want to write a stand-alone program that outputs to the screen?
<alfredr_> not sure what a repl is... but i'm going to go with that since i don't want to write a stand alone program
<Smerdyakov> "REPL" stands for "read-eval-print loop."
<Smerdyakov> The "ocaml" program provides a REPL.
<alfredr_> yeah thats the one
<Smerdyakov> I think you'll find the information you seek on the manual page for "ocaml".
<alfredr_> although i'm computing a huge space of topological invariants
<alfredr_> so i'll need to be able to dump them to a file at some point
<alfredr_> is there any hope of just being able to make the repl output unbounded and redirect the output with >> ?
<rwmjones> alfredr_, what exactly is the problem? You can easily print a list, eg:
<alfredr_> or will i have to write a stand alone program?
<rwmjones> List.iter print_endline ["a"; "b"; "c" ] ;;
<xavierbot> a
<xavierbot> b
<xavierbot> c
<xavierbot> - : unit = ()
<Smerdyakov> You can add your own printing function for a particular type, and it could play naughty and output to a file instead of the requested file.
<Smerdyakov> s/requested file/requested channel
<alfredr_> uh for one, there are 320,000 lists for a certain space
<Smerdyakov> But, seriously, you should easily find out how to increase printing depth by reading the manual page. I knew nothing about how to do this, and I found it in a minute.
<alfredr_> my man page for ocaml is like 1 page and doesn't say anything about anything useful
<alfredr_> it's fine... i'll just figure it out
<rwmjones> search for "depth"
<alfredr_> got it
<alfredr_> and length
<alfredr_> thank you
CosmicRay has quit [Read error: 110 (Connection timed out)]
CosmicRay has joined #ocaml
ygrek has quit [Remote closed the connection]
ygrek has joined #ocaml
love-pingoo has joined #ocaml
CosmicRay has quit [Read error: 104 (Connection reset by peer)]
david_koontz has joined #ocaml
dam1 has joined #ocaml
CosmicRay has joined #ocaml
piggybox__ has joined #ocaml
Submarine has joined #ocaml
piggybox_ has quit [Read error: 110 (Connection timed out)]
Mr_Awesome has joined #ocaml
leo037 has joined #ocaml
CosmicRay has quit [Read error: 110 (Connection timed out)]
CosmicRay has joined #ocaml
ygrek has quit ["Leaving"]
CosmicRay has quit ["Client exiting"]
love-pingoo has quit ["Connection reset by pear"]
malc_ has joined #ocaml
malc_ has quit ["leaving"]
jsnx has joined #ocaml
<jsnx> what is the recommended way to write cross-platform OCaml GUI applications?
<jsnx> tk, wxwidgets, or something else?
<zmdkrbou> gtk (using lablgtk2) is really nice, and works on multiple platforms
<jsnx> zmdkrbou: well, it isn't native, though
<jsnx> but that's not the real issue
<jsnx> i would have to ship gtk along with my apps
<jsnx> whereas i think wxwindows would allow me to just compile an executable and go...
<jsnx> but i wonder if wxwindows interacts poorly with the garbage collector
dam1 has quit ["Leaving."]
leo037 has quit ["Leaving"]
<jsnx> anybody online have experience with cross platform GUI development?
jlouis has quit [Remote closed the connection]
Submarine has quit [Remote closed the connection]
jlouis has joined #ocaml
jsnx has left #ocaml []
TFK has joined #ocaml
Submarine has joined #ocaml
TFK has quit ["Leaving"]