<roconnor>
thelema: ya, I'm tempted to rename OCAMLPATH TO OCAMLPAHT
rudi_s has quit [Ping timeout: 276 seconds]
SEcki has quit [Read error: Connection reset by peer]
rudi_s has joined #ocaml
pheredhel has joined #ocaml
jakedouglas has joined #ocaml
jakedouglas has quit [Quit: Leaving.]
chee has joined #ocaml
valross has joined #ocaml
Edward has quit []
Edward has joined #ocaml
wormphlegm has quit [Quit: hmm]
verte has joined #ocaml
uho has joined #ocaml
dhilbert has quit [Quit: dhilbert]
Edward has quit []
<uho>
Can someone help me with scope? http://codepad.org/s5gOoGGI <- In this function, I don't think count is being passed back to the group function correctly.
Edward has joined #ocaml
Edward has quit []
joewilliams is now known as joewilliams_away
joewilliams_away is now known as joewilliams
wormphlegm has joined #ocaml
metasyntax has quit [Quit: ♫ In our sky there is no limits, and masters we have none; heavy metal is the only one! ♫]
mjonsson has quit [Remote host closed the connection]
mjonsson has joined #ocaml
<verte>
uho: do you mean (group (iterate count xs)) to use the last count value in (peek x list count) ?
<verte>
uho: count is local to peek, if you want to use the value calculated, you will have to return it
<uho>
ah I see. Should I make a seperate function to do the same steps but return the count? I'm not sure how else to do it
<verte>
you can return the pair (list, count)
mjonsson has quit [Remote host closed the connection]
mjonsson has joined #ocaml
jakedouglas has joined #ocaml
mjonsson has quit [Remote host closed the connection]
mjonsson has joined #ocaml
joewilliams is now known as joewilliams_away
ulfdoz has joined #ocaml
valross has quit [Remote host closed the connection]
mjonsson has quit [Remote host closed the connection]
wormphlegm has quit [Quit: hmm]
ftrvxmtrx has quit [Quit: Leaving]
ulfdoz has quit [Ping timeout: 272 seconds]
uho has quit [Ping timeout: 245 seconds]
mlh has joined #ocaml
jakedouglas has quit [Quit: Leaving.]
Pepe_ has quit [Ping timeout: 276 seconds]
hyperboreean has quit [Ping timeout: 240 seconds]
palomer has joined #ocaml
<palomer>
whoa, this channel's gotten bigger
<palomer>
could someone explain to me the %a flag in Printf ?
ikaros has joined #ocaml
_unK has quit [Ping timeout: 264 seconds]
_unK has joined #ocaml
<thelema>
palomer: I use the batteries version of %a all the time since batteries has lots of nice print functions
<palomer>
but what is the use of %a ?
<thelema>
to nest printing functions
<palomer>
can you give me an example where life without %a would be hard?
<thelema>
+#include <alloca.h>
<thelema>
hmm, my copy/paste is defying me
<thelema>
let index_print print_v oc i v = fprintf oc "#%d) %a\n" i print_v v
<palomer>
what does that do?
<thelema>
of course this could be done with multiple print statements, but doing it in one place makes it compact and more readable
<thelema>
given a print_v function, it creates a printer for an integer and whatever the print_v prints
<thelema>
printing the integer (i) and the value (v) using whatever printer given
ftrvxmtrx has joined #ocaml
<thelema>
I guess it's equivalent to fprintf oc "#%d) " i; print_v oc v; fprintf oc "\n"
<thelema>
but easier to read
<thelema>
and more efficient than stringifying everything
<thelema>
and using %s
<palomer>
ahhhh!
<palomer>
print_v also takes a channel then?
<thelema>
yes
<palomer>
it'll be something like channel -> format6 ('a,...) -> 'a ?
Amorphous has quit [Ping timeout: 276 seconds]
hyperboreean has joined #ocaml
<thelema>
print_v is [channel -> 'a -> unit]
<thelema>
so the whole thing is [(output -> 'a -> unit) -> output -> int -> 'a -> unit
<palomer>
ah, righto
<thelema>
]
<palomer>
great explanation!
<palomer>
(especially that equivalence part)
<palomer>
now...can you explain format :P?
<thelema>
lol
<palomer>
or, rather, Format
<thelema>
I haven't worked out all the details of boxes - they magically control indenting
<palomer>
that's all they do?
<thelema>
I don't use format in my own code, despite its promise of making things line up properly (handling nested indentation)
<palomer>
can't you put them side by side too?
<thelema>
maybe. as I said, I haven't worked out their details
<palomer>
oh
<thelema>
I think no side-by-side, i t mainly handles indentation and word wrap