<gereedy>
I'm trying to use print_if_newline and it doesn't seem to be working right, anyone have any success using it?
ollehar has joined #ocaml
ollehar has quit [Ping timeout: 246 seconds]
yacks has quit [Quit: Leaving]
dtg has quit [Quit: Leaving...]
caseyjames has joined #ocaml
<caseyjames>
Hi, what is the best way to compare overlaps in two lists of ordered intervals? Is it reasonable to only compare a to b until a's interval is past b at which point the next b would be popped to continue the comparison against a?
ygrek has quit [Remote host closed the connection]
ygrek has joined #ocaml
<adrien>
morning
yezariaely has joined #ocaml
gour has joined #ocaml
Neros has quit [Ping timeout: 256 seconds]
<caseyjames>
How can I find all of the intersections between two ordered lists of intervals. Is there a way to do it so I don't compare every A against every B unnecessarily?
ygrek has quit [Ping timeout: 256 seconds]
ggole has joined #ocaml
ttamttam has joined #ocaml
Yoric has joined #ocaml
<mrvn>
caseyjames: you only compare the heads of each and then recursively throw away the head of one or the other till one list is []
<caseyjames>
Its taking a moment to sink in but I think I get what yo mean
<ggole>
Usually List.hd is better written as pattern matching
ontologiae_ has quit [Ping timeout: 260 seconds]
<ggole>
Also, the patterns there seem to be irrefutable: that's probably a mistake.
<caseyjames>
I updated the code, I wasn't sure how to pattern match in this instnace. Also, I don't know about irrefutable patterns, because list may be empty to begin with?
<ggole>
But you aren't matching the list, you are matching the pair you construct
csakatok_ has joined #ocaml
<ggole>
If you write match a, b with xs, _ -> always | ... -> never, always will always execute and never will never execute.
<ggole>
Do you see why?
<caseyjames>
no, im not following
<ggole>
Well, a pair always has exactly one 'shape'
<ggole>
There's no choice: it's always a, b.
<ggole>
So if you match it with xs, _, the match will always succeed.
<ggole>
What you want to do is match on the list structure.
<caseyjames>
so how would you match it?
<ggole>
Remove the calls to List.hd
<ggole>
And then rewrite the patterns accordingly.
csakatoku has quit [Ping timeout: 268 seconds]
<ggole>
It looks a bit like you are looking for the empty list in the first two matches
<ggole>
If so, use [] there
<ggole>
Etc
<caseyjames>
I just updated it again as I was making those changes. I a bit confused about matching a pair, but having it put in those terms makes it clearer - i thought it was a syntactic thing
<ggole>
No, it's just a regular tuple.
<ggole>
OK, now you've matched on the head::tail of the list, you don't need those List.tl calls.
<ggole>
Replace them with the corresponding variable
<ggole>
By the way, as a minor code nit: you can write the first two matches with a bit less duplication as | _, [] | [], _ -> acc.
<ggole>
But that isn't terribly important.
<caseyjames>
Ahh, it seems to compile but it's skipping values. I was wondering about the order of _, [] so its good to know
<ggole>
That'
<ggole>
s the List.tl, probably
<pippijn>
ok, now it seems I hit omake's scalability limit
<pippijn>
it needs so much time to calculate what can be built next that sometimes it can't use all available CPUs for compiling
manud_ has joined #ocaml
<caseyjames>
Hmm, I don't see why the startp=7;endp=9 interval doesn't show up on the intersect list as I'm passing the original l2 to the aux function. Splitting the list does change the original definition of the list right?
<ggole>
No, lists are immutable.
<ggole>
Like I said, you're probably calling List.tl.
<caseyjames>
I changed those bits to just use pattern matching
kizzx2 has joined #ocaml
kizzx2 has quit [Max SendQ exceeded]
<ggole>
OK. Is the code up to date?
<caseyjames>
though there are some ifs, so maybe I'm confusing the path
kizzx2 has joined #ocaml
<caseyjames>
yes indeed
octet8 has joined #ocaml
<ggole>
Hmm.
csakatok_ has quit [Remote host closed the connection]
<argp>
i'm trying to compile a 32-bit version of ocaml 4.01.0 on osx and i'm having issues
<argp>
anyone done that?
<argp>
(the 64-bit compile works fine)
<ggole>
caseyjames: oops, something I have to take care of afk. Sorry to run, good luck.
ggole has quit []
<caseyjames>
No prob, thanks for your help
<orbitz>
did the ability to comment on things in RWO disappear for anyone else?
csakatoku has joined #ocaml
zpe has joined #ocaml
csakatoku has quit [Ping timeout: 268 seconds]
ontologiae_ has joined #ocaml
<gour>
orbitz: probably it's too late
caseyjames has quit [Ping timeout: 250 seconds]
csakatoku has joined #ocaml
zpe has quit [Remote host closed the connection]
<yezariaely>
can I somehow open a module in a function?
<pippijn>
let open MyModule in
<adrien_oww>
let open module Foo in
<yezariaely>
thx. that was an easy one ^^
<adrien_oww>
or
<pippijn>
adrien_oww: really?
<adrien_oww>
let module F = Foo in
<adrien_oww>
although I think that one has the wrong syntax :P
<adrien_oww>
and you can always
<pippijn>
let open *module* Foo in?
<adrien_oww>
Foo.(do_some operation)
<adrien_oww>
pippijn: yes
<adrien_oww>
and for records, { Foo.field1 = ...; field2 = ...; field3 = ... }
<pippijn>
# let () = let open module Pervasives in ();;
<pippijn>
as they can't come from different modules
<yezariaely>
wow! I always fully specified the module each time
<pippijn>
I usually did Foo.({ field1 ... })
<flux>
that { Foo.a; b }-syntax is much older than that, I suppose it's the same now
csakatoku has quit [Ping timeout: 268 seconds]
gour has quit [Quit: WeeChat 0.4.1]
gour has joined #ocaml
talzeus has joined #ocaml
skchrko has joined #ocaml
mort___ has joined #ocaml
<companion_cube>
yo
<mrvn>
The new part I think is that after you specified the module for the first label all other labels implizitly use the same.
zpe has joined #ocaml
<companion_cube>
I'd like Foo.{a=...; b=...; } ^^
beckerb has joined #ocaml
<mrvn>
you mean without the ()?
ygrek_ has joined #ocaml
<orbitz>
{Foo.bar; baz} has existed at least in 3.12
<pippijn>
so has let open M in
<orbitz>
gour: too late for what? the internet never sleeps
<companion_cube>
mrvn: yep
kizzx2 has quit [Quit: Leaving.]
<gour>
orbitz: book is aleady at oreilly
<orbitz>
gour: it's not done
<orbitz>
and commenting was open on Wed
<yezariaely>
pippijn: let open M works in 4.00.1
zpe has quit [Read error: Connection reset by peer]
zpe has joined #ocaml
thelema has quit [Remote host closed the connection]
thelema has joined #ocaml
mfp has joined #ocaml
Neros has joined #ocaml
<yezariaely>
is it possible that merlin doesn't work with local module openings, e.g. let open MyModule in? All I get at the moment is either '_a or (approx) '_a as types from merlin :(
Yoric has quit [Ping timeout: 260 seconds]
darkf has quit [Quit: Leaving]
Kakadu has joined #ocaml
<pippijn>
yezariaely: and also in 3.12
pippijn has quit [Quit: Segmentation fault]
pippijn has joined #ocaml
thomasga has joined #ocaml
malo has joined #ocaml
Drup has joined #ocaml
csakatok_ has quit [Remote host closed the connection]
<pippijn>
ocamldep.opt returned with exit code 127
<pippijn>
because it doesn't exist
<adrien_oww>
how did it end in your config?
<pippijn>
I don't know
<pippijn>
but now it's installed
johnel_away is now known as johnelse
ontologiae_ has quit [Ping timeout: 248 seconds]
q66 has joined #ocaml
<orbitz>
avsm: Should commenting on RWO be turned off?
<avsm>
orbitz: I'm still going to do one round in the final QC stages, so leaving it open (people still reporting a low level stream of minor typos)
<orbitz>
avsm: Odd, i'm not seeing any links to add comments for some rason
<orbitz>
not sure why
<avsm>
check your javascript console?
<orbitz>
ohhh they just came back..
<orbitz>
I was on a slow network so maybe they don't hsow up until a response is done and now i'm on a fast network
<orbitz>
all is right in the world again
<avsm>
yeah, it's all a bit async
Yoric has joined #ocaml
dvvrd has joined #ocaml
Simn has quit [Ping timeout: 245 seconds]
Simn has joined #ocaml
<yezariaely>
any has experience with ocamlsdl? The last entry on their mailinglist is from 2011. Is it still up to date?
<yezariaely>
(it has a package in opam)
breakds has joined #ocaml
<companion_cube>
avsm: bad idea to demonstrate Async in your comment widget :p
_andre has joined #ocaml
<Drup>
gour: ahah, you did put the funny joke on the ML xD
thomasga has quit [Ping timeout: 246 seconds]
ggole has joined #ocaml
<orbitz>
hah
tane has joined #ocaml
thomasga has joined #ocaml
octet8 has quit []
ygrek_ has quit [Ping timeout: 264 seconds]
<gour>
Drup: yep, why not...ocaml is serious language, but some humour is, i bet, welcome ;)
asmanur has quit [Ping timeout: 248 seconds]
csakatoku has quit [Remote host closed the connection]
<Drup>
I'm not sure everyone is going to treat your mail as a joke =)
asmanur has joined #ocaml
<gour>
i was serious in most of the part
<gour>
..and has constuctive spirit
<adrien_oww>
Drup: you asked me if trolldi/trollday was international; I guess not :P
<Drup>
gour: I'm sure you do :3
<gour>
well, some took the spirit :-)
adrien_o1w has joined #ocaml
* gour
is consulting google's translate to decipher about adrien_oww's plan with lablgtk
adrien_oww has quit [Ping timeout: 268 seconds]
ontologiae_ has joined #ocaml
<gour>
btw, i haven't received any reply on my 'gmane' post on ocaml list nor someone has changed the gmane settings. is it really that none of the folks responsible for mailing list are present here and/or on the list itself?
<gour>
the need to conifrm every single message i post via gmane is getting tedious...
thomasga has quit [Ping timeout: 248 seconds]
<adrien_o1w>
I don't know how much they control that and how much the inria IT handles that
<gour>
in case it can't be configured properly, at least the info @gmane should be fixed...now it's the worst of the two
kerneis has quit [Quit: leaving]
thomasga has joined #ocaml
kerneis has joined #ocaml
ollehar has joined #ocaml
ollehar has quit [Ping timeout: 248 seconds]
ollehar has joined #ocaml
manud_ has quit [Ping timeout: 240 seconds]
ollehar has quit [Ping timeout: 260 seconds]
adrien_o1w is now known as adrien_oww
breakds has quit [Quit: Konversation terminated!]
csakatoku has joined #ocaml
csakatoku has quit [Ping timeout: 264 seconds]
ollehar has joined #ocaml
ttamttam has quit [Quit: ttamttam]
shinnya has joined #ocaml
mlh has joined #ocaml
smondet has joined #ocaml
oriba has joined #ocaml
ygrek_ has joined #ocaml
ollehar has quit [Ping timeout: 240 seconds]
ollehar1 has joined #ocaml
mcclurmc has joined #ocaml
ygrek_ has quit [Ping timeout: 245 seconds]
saml has quit [Quit: Leaving]
ShereKahn has joined #ocaml
yezariaely has quit [Quit: Leaving.]
paddymahoney has quit [Remote host closed the connection]
zpe has quit [Remote host closed the connection]
tani has joined #ocaml
tane has quit [Ping timeout: 256 seconds]
saml has joined #ocaml
contempt has quit [Ping timeout: 248 seconds]
tani is now known as tane
contempt has joined #ocaml
contempt has quit [Ping timeout: 240 seconds]
contempt has joined #ocaml
Yoric has quit [Ping timeout: 240 seconds]
contempt has quit [Ping timeout: 248 seconds]
ollehar1 has quit [Ping timeout: 248 seconds]
contempt has joined #ocaml
skchrko has quit [Quit: Leaving]
contempt has quit [Ping timeout: 240 seconds]
<kerneis>
oh, gasche trolls on the caml-list and he's not even on irc
<jpdeplaix>
:D
contempt has joined #ocaml
<adrien_oww>
yeah...
<adrien_oww>
I cannot understand the link between ocp-build and ocaml-java
<avsm>
waitwaitwait i got this
<avsm>
they both start with o
<adrien_oww>
:D
<kerneis>
I think he means "lack of communication"
<kerneis>
I fail to see how it's "better" though
<kerneis>
(not worse might be more appropriate)
<avsm>
i think it's safe to assume that if someone puts some code on the Internet, that they're under no obligation to communicate until they feel it's ready
<adrien_oww>
well, I agree on that for ocp-build but not so much ocamljava
<adrien_oww>
well, for ocp-build, there's communication but half-communication and I believe that's the most annoying
<kerneis>
you're right adrien_oww, ocaml-java has been advertised many times, including at the first ocaml conference
<gour>
ocp-buuld seems to be not much developed, and there is already new one coming - jenga...
<adrien_oww>
it's not new
<gour>
jenga?
<adrien_oww>
it's an internal tool that is being made available
<adrien_oww>
but there's a lot more to say; it's better to wait a bit
<kerneis>
gour: 1/ diversity is not necessarily a bad thing 2/ you cannot prevent people from independently and simultaneously scratching the same itch
<avsm>
it's only annoying when other people reach over and try to scratch my itches
<gour>
adrien_oww: first commit @github is from march
<gour>
kerneis: sure, but more inter-communication might spare duplicating work...maybe
<gour>
otherwise, it smells like NIH syndrome
<avsm>
gour: do you really jump to assumptions like this all the time?
<avsm>
fwiw, i've had several email exchanges about jenga. it's nothing like the other build systems as it's library based
<avsm>
just a cursory read of the source code reveals that.
<def-lkb>
avsm: <3
<rks`>
second that.
contempt has quit [Ping timeout: 256 seconds]
<adrien_oww>
hmmm
<gour>
avsm: no, but just feel there are too many build system within ocaml community, that's all
<adrien_oww>
well, generally agreed but that one is different
<gour>
*systems
<avsm>
great, i'm glad to hear about your feelings. Now, if you want to take the next step and contribute, do some research…
<adrien_oww>
or at least I've been told
<adrien_oww>
avsm: calm down a bit :)
<rks`>
(also, for the one who didn't understand the remark of gasche on ocaml-java: ocaml-java has been presented multiple times already)
<rks`>
(and each time xavier said "I can give you a binary, but you won't see the sources")
<rks`>
(I believe that's what gasche is refering to.)
contempt has joined #ocaml
<rks`>
(the ones*)
<avsm>
I'm perfectly calm. I'm just pointing out the irony in gour's comments (we've heard the same sort of "we should do this…" comment already, with little follow up). I'd love to see follow up; for example, a blog post comparing all the available build systems pros and cons
<adrien_oww>
(I don't think this channel is used to us writing that many lines with parens around :P )
<avsm>
rks`: he spent some time in my group this summer, and it came down to the ugly bootstrap mechanism in the current tree
<adrien_oww>
avsm: agreed but it's not alays an easy task
<avsm>
never said it was. good way to learn, though
<def-lkb>
I didn't check by myself if sources are not provided, but sources & binaries are not mutually exclusive, both could be provided even if the bootstrap is tedious
<kerneis>
sources are available for ocaml-java 1.4 but not for 2.0-preview
<kerneis>
(at least that's what a cursory look at the website indicates)
<avsm>
def-lkb: right, I just think he thought it wasn't quite good enough
<def-lkb>
kerneis: ok, I was thinking of the 2.0 version, but thanks for clarifications
<rks`>
avsm: yes, that's what I heard him say
<rks`>
and it's perfectly understandable
<avsm>
gour: what about it?
contempt has quit [Ping timeout: 240 seconds]
<rks`>
but he's been saying for a while now, and well, you know gasche :)
<bobzhang>
hi, does any one know how to preprocess several files in a directory in OMake?
<gour>
avsm: manual compares different build systems available for ocaml and gives rationale for ocp-build...you've asked for it ;)
<avsm>
gour: I meant an actual critical comparison. e.g., using OCamlMakefile instead of just Make, testing performance for a project, how well it handles camlp4 or packaging
<gour>
avsm: well, that one is about language replacement, a bit more difficult
<adrien_oww>
how long is it going to take to properly know omake?
<avsm>
just pick a sample project that's representative
<avsm>
output about 40 modules with some random interdeps
<bobzhang>
gour: I tried OMake these days, it gave me at least 2X speed up in quad core
<avsm>
sprinkle some camlp4
<avsm>
and go to town with different build systems
<gour>
when one comes to haskell, it's pretty obvious what's the build system recommended, at least for starters
contempt has quit [Ping timeout: 256 seconds]
contempt has joined #ocaml
cesar_ has joined #ocaml
cesar_ is now known as Guest31358
<bobzhang>
gour: I would prefer ocp-build or Omake
<bobzhang>
I took a look at jenga, the dependency is huge
contempt has quit [Ping timeout: 256 seconds]
thomasga has quit [Quit: Leaving.]
contempt has joined #ocaml
<gour>
bobzhang: thanks for the input
Yoric has joined #ocaml
skchrko has joined #ocaml
<adrien_oww>
I'm not sure we should look at jenga like another build systems; maybe more a separate project
<adrien_oww>
(that happens to be usable for build systems)
contempt has quit [Ping timeout: 252 seconds]
mort___ has quit [Ping timeout: 240 seconds]
<gour>
adrien_oww: jenga has some extra features aside from being a build system?
contempt has joined #ocaml
<gour>
quick-start doc says: "Jenga is a general purpose build system in the mold of make."
Sim_n is now known as Simn|gone
zpe has joined #ocaml
yacks has joined #ocaml
caseyjames has joined #ocaml
Neros has quit [Ping timeout: 245 seconds]
ygrek_ has joined #ocaml
<caseyjames>
if i have two record types {a:int:b:int;c:int} and {d:int;b:int;c:int} can I write patterns like {b=b, c=c} that can polymorphically handle both? I'm getting an error. If not how would I handle this? (This is my first week, practically coding in ocaml, so this may be obvious)
contempt has quit [Ping timeout: 260 seconds]
<adrien_oww>
no you can't
<caseyjames>
actually its more like {a:int;b:int;c:int;d:int} and {b:int;c:int;d:int}
<caseyjames>
oh
<caseyjames>
so it the best method to separate the recordin unwrapping method and use tuplets?
smondet has quit [Quit: leaving]
contempt has joined #ocaml
<caseyjames>
or rather make a function that generates one type of tuplet from either
<Drup>
you can do exactly what you ask with objects
<Drup>
but it's kind of an advance feature, so you may ignore it for now
ShereKahn has quit [Quit: Page closed]
<caseyjames>
So what would be the best practice way to handle it without dipping into arrays?
ontologiae_ has quit [Ping timeout: 240 seconds]
<caseyjames>
or does it go the other route into functors?
<Drup>
functor just for this is quite overkill :D
<adrien_oww>
caseyjames: well, first thing is that you cannot create a record without defining all its fields
<adrien_oww>
you can however create a new record, taking the same values as a previous one and only redefine some of the fiels
<adrien_oww>
fields*
<adrien_oww>
but you're still bound to a single typ
<adrien_oww>
e
contempt has quit [Ping timeout: 240 seconds]
Guest31358 has quit [Remote host closed the connection]
<caseyjames>
In this code - https://gist.github.com/caseybasichis/6724869 - since the lists are two inputs their types can compare either type with those fields in the match. Its just in the final construction i have to construct a record of one type and then adapt it with { myrec with thevals=} would that work?
contempt has joined #ocaml
smondet has joined #ocaml
oriba has quit [Quit: oriba]
zpe has quit [Remote host closed the connection]
contempt has quit [Ping timeout: 245 seconds]
Yoric has quit [Remote host closed the connection]
contempt has joined #ocaml
Yoric has joined #ocaml
talzeus has quit [Remote host closed the connection]
contempt has quit [Ping timeout: 245 seconds]
contempt has joined #ocaml
Neros has joined #ocaml
<caseyjames>
adrien_oow: I realized that the record being formed is complete - unless the pattern matches count as record formation. Since the inputs lists can be different types shouldn't approach I have work? I'm having trouble understanding how to fix it
bobzhang has quit [Remote host closed the connection]
contempt has quit [Ping timeout: 260 seconds]
contempt has joined #ocaml
ygrek has joined #ocaml
mcclurmc has quit [Quit: Leaving.]
yacks has quit [Quit: Leaving]
ygrek_ has quit [Ping timeout: 240 seconds]
ygrek_ has joined #ocaml
ygrek has quit [Remote host closed the connection]
ygrek_ has quit [Ping timeout: 240 seconds]
Kakadu has quit []
<adrien>
hmm, sorry, I really don't have time to think about that =/
thomasga has joined #ocaml
zpe has joined #ocaml
Neros has quit [Ping timeout: 248 seconds]
Simn|gone is now known as Simn
zpe has quit [Ping timeout: 246 seconds]
mcclurmc has joined #ocaml
ontologiae_ has joined #ocaml
ousado has quit [Ping timeout: 260 seconds]
ousado has joined #ocaml
yacks has joined #ocaml
Drup has quit [Ping timeout: 264 seconds]
ontologiae_ has quit [Ping timeout: 245 seconds]
manizzle has quit [Ping timeout: 240 seconds]
cdidd has quit [Remote host closed the connection]
caseyjames has quit [Ping timeout: 250 seconds]
Drup has joined #ocaml
malo has quit [Quit: Leaving]
asmanur has quit [Ping timeout: 245 seconds]
asmanur has joined #ocaml
zpe has joined #ocaml
ulfdoz has joined #ocaml
beckerb has quit [Ping timeout: 245 seconds]
yezariaely has joined #ocaml
tnguyen has joined #ocaml
zpe has quit [Remote host closed the connection]
djcoin has quit [Quit: WeeChat 0.4.1]
mcclurmc has quit [Quit: Leaving.]
ollehar has joined #ocaml
ontologiae_ has joined #ocaml
q66 has quit [Ping timeout: 245 seconds]
q66 has joined #ocaml
thomasga has quit [Quit: Leaving.]
ontologiae_ has quit [Ping timeout: 245 seconds]
Snark has quit [Quit: leaving]
manizzle has joined #ocaml
darkf has joined #ocaml
ihm1 has joined #ocaml
gour has quit [Disconnected by services]
gour_ has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
yezariaely has quit [Quit: Leaving.]
ikudrautsau has joined #ocaml
ikudrautsau has quit [Max SendQ exceeded]
ollehar has quit [Ping timeout: 264 seconds]
ikudrautsau has joined #ocaml
ikudrautsau has left #ocaml []
ihm1 has quit [Quit: ihm1]
Kakadu has joined #ocaml
mort___ has joined #ocaml
ggole has quit []
ihm1 has joined #ocaml
gour_ has quit [Quit: WeeChat 0.4.1]
ihm1 has quit [Quit: ihm1]
<smondet>
hi, with 4.01.0 ocamlfind seems to configure by default ocamldoc to be ocamldoc.opt (whereas in 4.00.1 it didn't), has anyone a piece of (O)Makefile that detects that?
Kakadu has quit []
ihm1 has joined #ocaml
manizzle has quit [Read error: Connection reset by peer]
manizzle has joined #ocaml
_andre has quit [Quit: leaving]
<orbitz>
does the git url type include specifying a specific branch/tag?
<mrvn>
git always clones everything
<mrvn>
--branch <name>, -b <name>
<mrvn>
if you want it to switch to a specific branch
whitequa1k has joined #ocaml
dvvrd has quit [Ping timeout: 250 seconds]
ihm1 has quit [Quit: ihm1]
adrien_o1w has joined #ocaml
<orbitz>
mrvn: whoops i was entirely unclear
<orbitz>
i mean the opam git url type
watermind has joined #ocaml
olasd has quit [Ping timeout: 264 seconds]
<jpdeplaix>
orbitz: « yourrepo.git#yourbranch »
olasd has joined #ocaml
<orbitz>
hrm i was hoping for more stringent control, like tag: <this is checkd for being a tag>
Khady1 has joined #ocaml
<watermind>
how do you increase a mutable int?
<orbitz>
foo := foo + 1
<watermind>
I remember seeing a function for that but forgot the name...
<companion_cube>
incr
<watermind>
companion_cube: that was it
whitequark has quit [Ping timeout: 246 seconds]
adrien_oww has quit [Ping timeout: 246 seconds]
Khady has quit [Ping timeout: 246 seconds]
<watermind>
more importantly how could have I found out the appropriate function?
<companion_cube>
it's one of the two "int ref -> unit" in Pervasives
<watermind>
Pervasives is a std lib right?
chris2 has quit [Ping timeout: 248 seconds]
<watermind>
or am I confused?
<companion_cube>
it's the module that is automatically open, in the standard library
<companion_cube>
the one which defines references, among others
<watermind>
oh right sorry I think I was confusing it with something else
chris2 has joined #ocaml
<watermind>
I'm using Core though... is it still appropriate to check Pervasives or should I be looking into some Core module?
hnrgrgr has quit [Ping timeout: 248 seconds]
hnrgrgr has joined #ocaml
<orbitz>
why you have an int refence anwyways?
<watermind>
why not? right now I'm not programming anything specific, just learning how to use the language
<watermind>
and looking at its imperative features
<orbitz>
oh, i haven't found a need for oen yet
<watermind>
Hash Tables
<watermind>
updatable graph represented in forward star form
<watermind>
etc etc
<watermind>
any mutable structure involving ints
<orbitz>
hash tables aer already mutable
<orbitz>
yeah, i know what you can do with a ref int, i'm just saying i haven't used one yet. I thought you were solving a larger problem, if you're just learning the langauge, continue :)
<companion_cube>
it's useful to implement things like iteri
<watermind>
is there anything like Haskell's Ordering variant type which is just LT | EQ | GT
<watermind>
it's really confusing that these interfaces seem to have minimal to none documentation :/
<watermind>
it'd be good to at the very least have some description for each module
ihm1 has joined #ocaml
tane has quit [Quit: Verlassend]
<orbitz>
watermind: yeah, the ocaml community has been rather small and only now starting to blossom, so we haven't had the attention to such things like other communities
saml has quit [Quit: Leaving]
<watermind>
I can understand that... but then again, one thing is not to have anything like Hoogle, which I can get
<mrvn>
watermind: go and write some
<watermind>
another thing is to have big interfaces like Comparator and Comparable with no description whatsoever
<watermind>
mrvn: well I wouldn't mind, if I could figure out what this does
<orbitz>
watermind: i think there is something like hoogle out there, i don't know if it's public or not
<Drup>
actually, there is exactly this in batteries Incubator
<Drup>
watermind: we have Hoogle too :p
<watermind>
Drup: oh I didn't know
<orbitz>
watermind: i think you'll see some great advances in the next few years, hopefully you contribute to them as well :)
<watermind>
I'm just starting but I wouldn't mind at all
<watermind>
I like the language
<orbitz>
it's a great language
<orbitz>
OUD was fantastic this year
<watermind>
and I can tell the tools are getting better and better
<companion_cube>
compare : t -> t -> int is pretty ok
<Drup>
companion_cube: it's still weird
<orbitz>
An ADT would be clearer for sure
<companion_cube>
it's far better than having lt, gt, leq, geq...
<orbitz>
i don't think there would be any performance penalty
<watermind>
companion_cube: true I get it works
<orbitz>
companion_cube: just lt, gt, eq i would say
<companion_cube>
orbitz: it's less efficient to have those, actually
<orbitz>
companion_cube: how so?
<companion_cube>
compare is the right interface for total orders
<companion_cube>
orbitz: if you need to compare two values, you may have to do several tests
<companion_cube>
with compare, only one
<orbitz>
hrm?
<companion_cube>
it does matter when comparison is expensive
<orbitz>
Huh?
<orbitz>
I'm notsure what that has to do with what I said
<orbitz>
I'm claming compare : t -> t -> Ord.t doens't have a comparison hit
<companion_cube>
ah
<orbitz>
same number of compares
<companion_cube>
ah
<companion_cube>
sure
<Drup>
companion_cube: 2 comparaison vs a pattern match against constant constructors
<Drup>
not sure which win
<companion_cube>
Drup: I meant more efficient than {lt,gt,eq}
mort___ has quit [Quit: Leaving.]
<orbitz>
it should be the same in the end I think
<orbitz>
since lt, gt ,eq would be ints in teh end
<Drup>
companion_cube: yeah, but thats not the point :p
<companion_cube>
I meant more efficient than *functions* lt, gt and eq
<watermind>
oh
<companion_cube>
whether it returns int or Ord.t doesn't matter much indeed
<Drup>
companion_cube: Ord.t seems more natural in ocaml, though.
<companion_cube>
right
<orbitz>
my claim is t -> t -> Ord.t is self evidently clearer, whther it' sthe better choice for other reasons I don't know
<companion_cube>
must be because the stdlib didn't define those in the first place, then retrocompatibility struck
<orbitz>
yeah
<orbitz>
i think we're stuck with -> for awhile :)
nisstyre has joined #ocaml
<orbitz>
-> int i mean
<companion_cube>
apparently there is hardware stuff to branch on <0, =0 or >0
<companion_cube>
I think someone told me that fortran exposes this to the programmer
<orbitz>
ah
<companion_cube>
but in ocaml, 0 is represented as 1 ^^
<companion_cube>
so it wouldn't help
<orbitz>
indeed
<mrvn>
I still wonder if using 0 tag for int and 1 for pointers wouldn't be faster.
<orbitz>
mrvn: you'd havea cost for all pointer access if i understand correctly
<mrvn>
orbitz: most pointers are accessed with an offset anyway
<orbitz>
are they?
<orbitz>
i don't have any stats on that.
<companion_cube>
don't tagged pointers get rounded anyway?
<mrvn>
on some hardware
<orbitz>
besides string i would assume more are accessed on their alignment
<companion_cube>
I contributed to a C project in which lsb of pointers were tagged
<orbitz>
does ocaml do local unboxing?
<orbitz>
or expansion or ints
<companion_cube>
but maybe it was only for big struct pointers
<companion_cube>
ints are unboxed
<mrvn>
orbitz: Only field 0 is without offset. everything else has one.
<orbitz>
so a series of integer arithmetic is detagged once, then retagged at the end
<companion_cube>
oh
<mrvn>
orbitz: some but not much
<orbitz>
ok
<mrvn>
both untagging and unboxing (for floats)
<orbitz>
mrvn: although i gues it's unclear what benefit untagging would have sicne you still have to untag/retag the ints. you get a specialcase for 0 i guess but how often is an int 0?
<mrvn>
orbitz: addition and subtraction wouldn't
<mrvn>
multiplication would only need to shift one number and not untag the other.
<orbitz>
that is true
* orbitz
shrugs, i have no idea
Neros has joined #ocaml
ulfdoz has quit [Read error: Operation timed out]
ng__ has joined #ocaml
<ng__>
how i read 2 numbers in the same line? Ex: Input: 5 5
ihm1 has quit [Quit: ihm1]
<companion_cube>
I'd say Scanf
ollehar has joined #ocaml
breakds has joined #ocaml
<ng__>
companion_cube, ty
<orbitz>
the GADT printf/scanf looks sexy
manud_ has joined #ocaml
<orbitz>
ng__: you could also split it on white space of coures