<hcarty>
adrien: Perhaps, but I think it still looks better than the f.o.o version.
<adrien>
not very difficult :P
<adrien>
I'll probably push that in a few days
<hcarty>
adrien: You have "LablGtk2 Tutorial" listed twice, each linking to a different tutorial.
<hcarty>
adrien: True :-)
<adrien>
hah, thanks, copy-paste =)
<adrien>
btw, "an historical branch" or "a historical branch" or something else?
<adrien>
hmm, I'm fairly happy with the current version
Yoric has joined #ocaml
hkBst has quit [Quit: Konversation terminated!]
Fnar has quit [Ping timeout: 246 seconds]
eikke has joined #ocaml
osa1 has joined #ocaml
Yoric has quit [Ping timeout: 240 seconds]
Yoric has joined #ocaml
ftrvxmtrx has joined #ocaml
Anarchos has joined #ocaml
diego_diego has joined #ocaml
diego_diego has quit [Client Quit]
diego_diego has joined #ocaml
diego_diego has quit [Client Quit]
gnuvince has quit [Quit: Remember when men were men and regular expressions recognized regular languages?]
BiDOrD has joined #ocaml
osa1 has quit [Quit: Konversation terminated!]
BiDOrD_ has quit [Ping timeout: 272 seconds]
jamii has quit [Ping timeout: 240 seconds]
gnuvince has joined #ocaml
Yoric has quit [Ping timeout: 256 seconds]
smondet has joined #ocaml
Yoric has joined #ocaml
Yoric has quit [Ping timeout: 244 seconds]
avsm has joined #ocaml
sepp2k has joined #ocaml
Mnabil has quit [Ping timeout: 248 seconds]
avsm has quit [Quit: Leaving.]
avsm has joined #ocaml
Yoric has joined #ocaml
Progster has joined #ocaml
avsm has quit [Quit: Leaving.]
<hcarty>
I submitted a ( |? ) operator to Batteries which acts like Option.default ("None |? 1" returns 1, "Some 2 |? 1" returns 2). Unfortunately the operator does not short-circuit, so the right side always evaluates.
<hcarty>
A recent question on stackoverflow is making me wonder if making the second argument lazy would be a good idea. That would help avoid unexpected execution if the expressions on the right hand side of |? involves side effects.
<hcarty>
So the lazy version would be: let ( |? ) a b = match a with Some x -> x | None -> Lazy.force b
<hcarty>
This could be helpful for cases like: let do_stuff configuration = let configuration = configuration |? lazy (load_default_config ()) in ...
<hcarty>
thelema_ or anyone else - Opinions?
<hcarty>
To be more specific - I am curious to hear opinions on whether a |? operator as described above should be lazy or eager when evaluating its fallback argument.
Yoric has quit [Ping timeout: 240 seconds]
Mnabil has joined #ocaml
<Drakken>
hcarty do you expect the rhs expression to be evaluated more than once?
<Drakken>
You didn't bind a name to it in your example.
<hcarty>
Drakken: In some cases, yes. Not always.
<Drakken>
I would put that in a special module.
<hcarty>
Drakken: The lazy version of the operator?
<Drakken>
The one that takes a Lazy.t
<Drakken>
that sounds like a special-purpose operator
<hcarty>
More so than the one that isn't lazy?
sepp2k has quit [Ping timeout: 246 seconds]
<hcarty>
I've been bitten by the fact that the operator doesn't short-circuit like || and &&. That's primarily where my interest in a lazy form comes from.
<Drakken>
Same thing with BatPervasives.filter_map
<Drakken>
That's a terrible choice, at least the name, for a general-purpose function.
<hcarty>
A large number of Enum.* values are exposed in BatPervasives.
<nicoo>
adrien: « an historical branch » is correct, AFAIK
<adrien>
nicoo: thanks
<nicoo>
You are welcome ;)
<Drakken>
filter_map and |? both seem to be oriented toward I/O
<hcarty>
I don't think I've ever used filter_map for I/O, and it use it often - at least the List version.
<Drakken>
not directly of course, but they both seem to be useful for things like package managers and other code that interacts with the RW.
<hcarty>
My use of |? is sometimes I/O related, but not always.
<hcarty>
s/and it use/and I use/
<Drakken>
no, not always.
<Drakken>
but it seems like the kind thing one would design for operating on data that was downloaded from somewhere.
<Drakken>
the kind OF thing
Yoric has joined #ocaml
<Drakken>
It would be simpler for |? to take a thunk if that's acceptable, and if it's not, how common is that operation?
<Drakken>
on Lazy.t?
<hcarty>
Lazy.t would prevent repeated evaluation of the RHS if it is a named value. A thunk requires a bit more typing and forces repeated evaluation of the RHS.
<hcarty>
I don't know which evaluation form is better. I tend to think less typing is better if no clarity is lost.
<hcarty>
I should probably take this to the Batteries mailing list if I'm going to seriously consider it.
sepp2k has joined #ocaml
iago has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
iago has quit [Quit: Leaving]
iago has joined #ocaml
<hcarty>
Drakken: Thank you for the comments
<Drakken>
no prob
eni has quit [Ping timeout: 244 seconds]
gnuvince has quit [Ping timeout: 256 seconds]
<flux>
hcarty, would it be a good feature for odb to list 'available package' separated by newlines instead of spaces? so I can do odb.ml | grep ..
<flux>
actually I think it's faster for glancing the list by eye as well..
<flux>
(sadly I noticed it doesn't yet have stuff for ocsigen)
<flux>
also ospec doesn't compile with ocaml 4.0.0, probably because of missing compiler-libs compile-time dependency (how to fix?), resulting in ocaml-uint not compliling, resulting in zmq not compiling :)
Progster has quit [Ping timeout: 240 seconds]
Mnabil has quit [Ping timeout: 245 seconds]
Yoric has quit [Ping timeout: 245 seconds]
<flux>
I crudely patched it but it with true: pkg_compiler-libs but now it wants toplevellib.cma, which appears to exist on the older system-installed ocaml.. (3.11.2)
Progster has joined #ocaml
Yoric has joined #ocaml
Progster has quit [Client Quit]
emmanuelux has joined #ocaml
Yoric has quit [Remote host closed the connection]
Yoric has joined #ocaml
Progster has joined #ocaml
Tobu has quit [Ping timeout: 272 seconds]
beckerb has quit [Ping timeout: 245 seconds]
Tobu has joined #ocaml
emmanuelux has quit [Quit: emmanuelux]
diego_diego has joined #ocaml
diego_diego has quit [Client Quit]
emmanuelux has joined #ocaml
Yoric has quit [Ping timeout: 245 seconds]
emmanuelux has quit [Quit: emmanuelux]
sepp2k has quit [Quit: Leaving.]
sepp2k has joined #ocaml
sgnb` has joined #ocaml
fasta_ has joined #ocaml
TaXules has joined #ocaml
rixed_ has joined #ocaml
adrien_oww has joined #ocaml
bacam_ has joined #ocaml
ivan\_ has joined #ocaml
jlouis_ has joined #ocaml
ivan\ has quit [*.net *.split]
TaXules_ has quit [*.net *.split]
adrien_o1w has quit [*.net *.split]
sgnb has quit [*.net *.split]
pango has quit [*.net *.split]
fraggle_ has quit [*.net *.split]
bacam has quit [*.net *.split]
jlouis has quit [*.net *.split]
olasd has quit [*.net *.split]
thizanne has quit [*.net *.split]
rixed has quit [*.net *.split]
fasta has quit [*.net *.split]
ivan\_ is now known as ivan\
eikke has quit [Ping timeout: 244 seconds]
olasd has joined #ocaml
olasd has quit [Changing host]
olasd has joined #ocaml
fraggle_ has joined #ocaml
pango has joined #ocaml
thizanne has joined #ocaml
gnuvince has joined #ocaml
smondet has quit [Read error: Connection reset by peer]
Mnabil has joined #ocaml
eikke has joined #ocaml
gnuvince has quit [Ping timeout: 240 seconds]
eikke has quit [Ping timeout: 252 seconds]
eikke has joined #ocaml
gnuvince has joined #ocaml
bacam_ is now known as bacam
Fnar has joined #ocaml
Fnar has quit [Changing host]
Fnar has joined #ocaml
<hcarty>
flux: I have a bug in for ospec and made pull requests on github for ocaml-uint and zmq which were both accepted.
<hcarty>
flux: I (or someone else) "just" need(s) to make new .tar.gz archives of the updated code and upload uint and zmq to oasis-db
gnuvince has quit [Ping timeout: 272 seconds]
<flux>
great :)
<flux>
btw, I have an issue with csv.. ;-)
<hcarty>
flux: Regarding \n for package separation in odb - I've considered that as well. Given a patch, I would guess thelema_ may agree, or at least be willing to add ' ' vs '\n' as different options for printing packages.
<flux>
E: Malformed log file '/tmp/install-csv/csv-1.2.2/setup.log' at line 1 -> the first line says: "is_built_lib_csv" "true"
<hcarty>
flux: (and the updated uint doesn't rely on ospec since it is only needed for testing... still good to have, but not 100% required for a build)
<hcarty>
flux: And that sounds like csv needs to have its oasis version updated too :-)
<flux>
hcarty, it's just that I'm always doing odb.ml | tr ' ' '\n' | grep .. - I guess an option would do but.. I suppose the flipside is that when there will be lots of packages, the default output of odb.ml will be long, but perhaps it should have a separate command for listing available packages and default to usage
avsm has joined #ocaml
<hcarty>
flux: Agreed.
<flux>
especially as it can sometimes take a few seconds to retrieve the list, so when I start odb.ml for the first time I'm wondering if it's wanting some data from standard input or what
<flux>
but thanks for great works, I'm going to sleep :)
<hcarty>
flux: Enjoy the break! And you're welcome - I'm glad it's useful.
<flux>
'oasis setup' fixed csv, thanks for the pointer
<flux>
(btw, next up: extlib, the version known by odb won't compile by default with 4.0.0 ;) )
<flux>
((but now I'm actually going to brush my teeth etc->))
Yoric has joined #ocaml
gnuvince has joined #ocaml
osa1 has joined #ocaml
gildor has quit [Ping timeout: 265 seconds]
jamii has joined #ocaml
Yoric has quit [Ping timeout: 246 seconds]
eikke has quit [Ping timeout: 246 seconds]
Progster has quit [Ping timeout: 260 seconds]
emmanuelux has joined #ocaml
<thelema_>
hcarty: the operator |? thing is a weakness of ocaml; without having if/then/else hoisted through function definition (i.e. syntactic substitution), lazy arguments are a poor hack. Maybe with the -ppx extension in 4.00, this can be done properly
<thelema_>
Drakken: what's wrong with filter_map? when batteries lifts a function to pervasives, it's generally a function on enums