nikki93 has quit [Remote host closed the connection]
nikki93 has joined #ocaml
nikki93 has quit [Remote host closed the connection]
cesar_ has joined #ocaml
mcclurmc has quit [Quit: Leaving.]
cesar_ is now known as Guest71444
nikki93 has joined #ocaml
gour has joined #ocaml
Guest71444 has quit [Remote host closed the connection]
nikki93 has quit [Remote host closed the connection]
nikki93 has joined #ocaml
nikki93 has quit [Remote host closed the connection]
Fusebox has joined #ocaml
f[x] has quit [Ping timeout: 240 seconds]
manizzle has quit [Remote host closed the connection]
manizzle has joined #ocaml
<adrien>
morning
<manizzle>
how can i get the raw byte value of a integer?
<manizzle>
like byte_of_int or something
<adrien>
say for 42, what would be output?
ggole has joined #ocaml
<manizzle>
'\x42'
<manizzle>
i mean sorry \x2a
<adrien>
:)
<adrien>
# Printf.printf "%x\n" 42;;
<adrien>
2a
<manizzle>
hm k
<adrien>
that outputs on stdout; if you want a string, use "sprintf" instead of "printf"
<manizzle>
is that in printf module?
<manizzle>
yeah it is
<manizzle>
nvm
<manizzle>
okay but still 2a is 2 characters
<manizzle>
i want the character '\x2a'
<flux>
Char.chr 42
<manizzle>
thanks flux
<manizzle>
- : ('a, unit, string) format -> 'a = <fun> what does this type mean?
<manizzle>
'a means like anything right? then unit = void? string = a string
<manizzle>
then all of that is one argument
<flux>
format is a parametric type of three argument types
<manizzle>
or is the () an "any of these" operaor?
<flux>
() is the value unit, 'unit' is the type unit
<flux>
like 5 is the value 5, int is the type of integers
<flux>
and your 'a means like.. is correct
<manizzle>
i mean ('a, unit, string) means any of those types is the first argument
<manizzle>
of that type definition?
<flux>
it's a type instance
<manizzle>
i dont understand that type definition
<manizzle>
- : ('a, unit, string) format -> 'a = <fun>
<flux>
like you could have int list, similarly you can have ('a, unit, string) format except that the type takes three arguments instead of one
<manizzle>
what? i am new to ocaml, i dont understand
<flux>
-> in a type means it's a function from the argument types at the left side to the return type at the right side
<manizzle>
okay i get that
<flux>
let foo x = x + 1 would be a function: int -> int (it takes an integer, it returns an integer)
<manizzle>
i guess i dont get the arguments part
<manizzle>
the type taking arguments thing
serge has quit [Remote host closed the connection]
<flux>
similarly ('a, unit, string) format -> 'a is a function from ('a, unit, string) format (it takes a format string) and returns 'a which is bound in the format argument type
<flux>
well, think of lists. you get that you can implement a list but not care what you put inside it?
<manizzle>
yeah sure
<manizzle>
k well the first argument to sprintf
<manizzle>
is a char* usually in c
<flux>
then your implementation calls that 'what you put in' with the name 'a
<flux>
the user gets to decide what that 'a becomes later on
<flux>
he could choose for example a string
<flux>
but within the same expression he cannot choose both 'string' and 'int'
<flux>
sprintf/printf and friends are slightly magical in ocaml
<manizzle>
how is ('a, unit, string) the same as char*? or the same?
<adrien>
manizzle: the types that are related to the format strings are also a bit special
<flux>
'usually' it would be string in ocaml as well but in this case the compiler converts the format string into something that embeds the types in the same way
<flux>
I think at this time you don't much need to care about it, unless you plan to pass format strings as parameters
<adrien>
in other words, there is a dirty hack for format strings in the compiler :)
<flux>
so while "foo" is a string in ocaml, when given as a parameter to a formatting function it gets converted into something that embeds the types of the %-arguments in it
<manizzle>
hm okay
Neros has quit [Read error: Operation timed out]
<manizzle>
('a, unit, string) is something with parameters i dont need to supply, i just need to give the string
<flux>
this allows the compiler to stop this code: let foo x = Printf.printf "Hello %s!\n" let main () = foo 42
<flux>
manizzle, yes
<flux>
well, not quite ;-)
<flux>
you need to give a string literal
<manizzle>
yup k thanks
<flux>
so if you need to have that value parametrized, you may need to think about the type thing more precisely
<manizzle>
ggole, i got that, i thought i was doing string comparison with == and was still returning true, i thought some weird stuff about local scope and blocks or something, but not the case
serge has joined #ocaml
<ggole>
The only == there is an int comparison
<ggole>
(For which you should probably be using =)
<ggole>
(If that comment wasn't about your latest paste, just ignore what I said.)
<manizzle>
heh
f[x] has joined #ocaml
<adrien>
manizzle: you use "open" too much
Neros has joined #ocaml
<adrien>
and if you open Foo, you don't have to use "Foo." anymore
<adrien>
but generally speaking, you should use open less
<manizzle>
i can get rid of 2
<adrien>
better things:
<adrien>
- module P = Printf
<manizzle>
but how do i get rid of the rest?
<manizzle>
one line?
<adrien>
- let module P = Printf in (that's inside blocks)
<adrien>
- let open P in (that's also inside blocks)
<adrien>
- let sprintf = Printf.sprintf (or, what I often do: let sp = Printf.sprintf) when you only need one (or a few) value(s)
<ggole>
opening Printf is probably not so bad, but Char and String should not be opened
<adrien>
an issue here is that both Printf and Scanf define values which have the same name
<ggole>
They contain things like compare which will shadow the Pervasives definition
<manizzle>
i guess, what does open do?
<ggole>
Pulls everything in the module into the current scope
<adrien>
so the module that you open after the other will hide (we say "shadow") the definition from the previously-opened module
<manizzle>
ah, so i can just use the module without having to open it
<ggole>
Yep
<manizzle>
cool
<manizzle>
then i can get rid of all of them
<ggole>
Yes
<manizzle>
okay so now, the code, i get a syntax error
<adrien>
manizzle: basically, you don't have to write "Printf." in front of "sprintf"
<manizzle>
when i call the step 1 of my recursive function
Snark has joined #ocaml
<manizzle>
i like to, to see where things come from i havent defined besides being in pervasives
<ggole>
Looks like you are missing an in
<ggole>
At the end of hexraw
yacks has quit [Ping timeout: 246 seconds]
Neros has quit [Ping timeout: 245 seconds]
Simn has joined #ocaml
Neros has joined #ocaml
Neros has quit [Remote host closed the connection]
ontologiae_ has quit [Ping timeout: 246 seconds]
gour has quit [Ping timeout: 245 seconds]
gour has joined #ocaml
mort___ has joined #ocaml
yezariaely has joined #ocaml
yacks has joined #ocaml
djcoin has joined #ocaml
thomasga has joined #ocaml
mort___ has quit [Quit: Leaving.]
ontologiae_ has joined #ocaml
zpe has joined #ocaml
Yoric has joined #ocaml
gour has quit [Ping timeout: 245 seconds]
gour has joined #ocaml
Kakadu has joined #ocaml
ollehar has joined #ocaml
Fusebox has quit [Ping timeout: 256 seconds]
Yoric has quit [Ping timeout: 264 seconds]
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
Fusebox has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
ontologiae has joined #ocaml
ontologiae_ has quit [Read error: Connection reset by peer]
chrisdotcode has quit [Ping timeout: 245 seconds]
Fusebox has quit [Ping timeout: 248 seconds]
zpe has quit [Remote host closed the connection]
csakatok_ has quit [Ping timeout: 240 seconds]
ocp has joined #ocaml
darkf has quit [Quit: Leaving]
lopex has quit [Ping timeout: 248 seconds]
malo has joined #ocaml
zpe has joined #ocaml
Yoric has joined #ocaml
Drup has joined #ocaml
zpe has quit [Remote host closed the connection]
q66 has joined #ocaml
csakatoku has joined #ocaml
<pippijn>
Reference to undefined global `Camlp4OCamlRevisedParser'
<pippijn>
what can I do to get this in ocaml 3.12?
ollehar1 has joined #ocaml
ontologiae has quit [Ping timeout: 256 seconds]
<pippijn>
I think the only place where this can be found is camlp4.fulllib, which ocaml 3.12 doesn't have
ollehar has quit [Ping timeout: 245 seconds]
csakatoku has quit [Remote host closed the connection]
csakatoku has joined #ocaml
csakatoku has quit [Ping timeout: 256 seconds]
zpe has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
<f[x]>
> camlp4.fulllib, which ocaml 3.12 doesn't have
<f[x]>
not $ ocamlfind query camlp4.fulllib
<f[x]>
/home/ygrek/.opam/3.12.1/lib/ocaml/camlp4
zpe has quit [Remote host closed the connection]
dezzy has quit [Quit: leaving]
<pippijn>
f[x]: hmm
<pippijn>
odd
<f[x]>
if you use debian ocaml ensure camlp4-extra is installed
<pippijn>
ocamlfind: Package `camlp4.fulllib' not found
<f[x]>
and camlp4.lib?
<f[x]>
they should be in the same META
* f[x]
afk
<pippijn>
yes
<pippijn>
f[x]: lib is there, but lib is not enough
<f[x]>
check the META
<pippijn>
it's not in there
<pippijn>
when I build my packages at travis-ci, which uses ubuntu, one of the pre-build steps is to patch the ocaml installation by appending the fulllib subpackage
<f[x]>
hm
<f[x]>
META is not in std ocaml distribution
<f[x]>
it is from ocamlfind
<pippijn>
but that doesn't work when I build packages at launchpad
<f[x]>
and it doesn't have fullib indeed
<f[x]>
I wonder where it does come from.. because I remember using it..
<pippijn>
maybe you added it
<f[x]>
no
<f[x]>
definitely not
<pippijn>
I did, in my local installation
<f[x]>
but now in opam it is present, so I don't have any idea
<pippijn>
maybe it's an opam patch
* f[x]
definitely afk
* pippijn
patches findlib
lopex has joined #ocaml
f[x] has quit [Ping timeout: 245 seconds]
Yoric has quit [Ping timeout: 256 seconds]
talzeus has quit [Remote host closed the connection]
mchqwerty has joined #ocaml
mch has joined #ocaml
f[x] has joined #ocaml
ontologiae has joined #ocaml
zpe has joined #ocaml
zpe has quit [Remote host closed the connection]
Yoric has joined #ocaml
mcclurmc has joined #ocaml
<pippijn>
adrien: do you know what wmeyer is doing?
<adrien_oww>
pippijn: not really
<pippijn>
ok
<adrien_oww>
any specific reason?
<adrien_oww>
he mentionned he was going to look at my patches yesterday on the bug tracker but it was a bit weird because he mixed patchsets
<pippijn>
he wanted to take a look at the introduction and conclusion of my master's thesis
<adrien_oww>
and he probably only showed up because of some breakage on the svn after my last patches
<adrien_oww>
I'm under the impression he doesn't have much free time right now
<adrien_oww>
well, send him an email
<pippijn>
it's irrelevant now
<pippijn>
it was due yesterday
<pippijn>
no, monday
<adrien_oww>
ah =/
<pippijn>
so it doesn't matter anymore, I'm just wondering where he went
Sim_n has joined #ocaml
skchrko has joined #ocaml
Simn has quit [Ping timeout: 240 seconds]
Neros has joined #ocaml
maufred has quit [Ping timeout: 248 seconds]
maufred has joined #ocaml
Neros has quit [Ping timeout: 245 seconds]
zpe has joined #ocaml
zpe has quit [Ping timeout: 252 seconds]
Neros has joined #ocaml
kay_ has joined #ocaml
shinnya has joined #ocaml
Yoric has quit [Ping timeout: 240 seconds]
Neros has quit [Ping timeout: 245 seconds]
yezariaely has quit [Quit: Leaving.]
Guest94822 is now known as amiller
amiller has quit [Changing host]
amiller has joined #ocaml
Fusebox has joined #ocaml
AltGr has joined #ocaml
travisbrady has joined #ocaml
talzeus has joined #ocaml
cesar_ has joined #ocaml
cesar_ is now known as Guest32237
zpe has joined #ocaml
zpe has quit [Remote host closed the connection]
ontologiae has quit [Read error: Connection reset by peer]
dpk` has joined #ocaml
Fusebox has quit [Ping timeout: 246 seconds]
ollehar1 has quit [Ping timeout: 252 seconds]
nisstyre has quit [Quit: Leaving]
zpe has joined #ocaml
zpe has quit [Remote host closed the connection]
Kakadu has quit []
ollehar has joined #ocaml
Neros has joined #ocaml
zpe has joined #ocaml
ollehar has quit [Ping timeout: 252 seconds]
manizzle has quit [Ping timeout: 240 seconds]
ocp has quit [Read error: Operation timed out]
ollehar has joined #ocaml
dpk` has left #ocaml []
tane has joined #ocaml
nikki93 has joined #ocaml
nikki93 has quit [Ping timeout: 260 seconds]
nikki93 has joined #ocaml
thomasga has quit [Quit: Leaving.]
ulfdoz has joined #ocaml
Guest32237 has quit [Remote host closed the connection]
maufred_ has joined #ocaml
maufred has quit [Ping timeout: 252 seconds]
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
nikki93 has quit [Remote host closed the connection]
nikki93 has joined #ocaml
nikki93 has quit [Remote host closed the connection]
f[x] has quit [Ping timeout: 240 seconds]
zpe has quit [Ping timeout: 248 seconds]
AltGr has quit [Quit: Konversation terminated!]
adam-- has joined #ocaml
<adam-->
hey! what's the preferred way to build a web app in Ocaml?
<adam-->
Is the Ohm project still active?
<mrvn>
carefully
<adam-->
what do you mean by that?
<mrvn>
pick the buildsystem that works for you.
ttamttam has quit [Quit: ttamttam]
zpe has joined #ocaml
nikki93 has joined #ocaml
nikki93 has quit [Remote host closed the connection]
adam-- has quit [Ping timeout: 250 seconds]
travisbrady has quit [Quit: travisbrady]
thomasga has joined #ocaml
nikki93 has joined #ocaml
nikki93 has quit [Remote host closed the connection]
<Drup>
mrvn: that was not the question.
f[x] has joined #ocaml
Yoric has joined #ocaml
<mrvn>
Drup: wasn't it? Well, better questions get better answeres.
travisbrady has joined #ocaml
travisbrady has quit [Client Quit]
zpe has quit [Ping timeout: 248 seconds]
<Drup>
build a *web* app
<mrvn>
*build* a web app
<Drup>
u_u'
<mrvn>
someone here was using js_of_ocaml (or what's it called?). wouldn't that be great for web apps?
yezariaely has joined #ocaml
<Drup>
that's not a simple question and he is gone anyway
shinnya has quit [Ping timeout: 248 seconds]
djcoin has quit [Quit: WeeChat 0.4.1]
chrisdotcode has joined #ocaml
jle` has joined #ocaml
<jle`>
is there an ocaml function that is similar to haskell's `const x`, which ignores its second parameter and always returns x?
gour has quit [Disconnected by services]
gour_ has joined #ocaml
<companion_cube>
I don't think it's standard
<companion_cube>
maybe in batteries
<Qrntz>
Batteries and Core I believe
<jle`>
something like fun x -> fun y -> x
<Qrntz>
it's fairly trivial to implement though, «let const x _ = x»
<Qrntz>
yes, that works just as well
<jle`>
ah, thanks
<jle`>
yeah, still getting used to the syntax
<Drup>
jle`: you can do "fun x _ -> x"
<Qrntz>
you don't actually need to bind y
<Qrntz>
since it's unused anyway
<Qrntz>
so yes
pango_ is now known as pango
Yoric has quit [Ping timeout: 240 seconds]
<smondet>
adam--: if you like handling low-level stuff you can build your webapp with cohttp + js_of_ocaml + whatever you like
f[x] has quit [Ping timeout: 240 seconds]
<smondet>
if not, there is ocsigen (ocsigen.org, #ocsigen)
nikki93 has joined #ocaml
<Drup>
smondet: he's not here :(
nikki93 has quit [Remote host closed the connection]
<smondet>
Drup: ah indeed (that keeps happening to me …)
travisbrady has joined #ocaml
<adrien>
unless I'm 100% sure the other is connected, I always tab-complete nicks, even when I type them in full
<Qrntz>
why would you type nicks in full when you have tab completion though?
<adrien>
sometimes it's quicker
<adrien>
for nicks with 3 or 4 characters, it's sometimes faster because of collisions
<smondet>
thanks for the advice (just changed IRC client I did not know it was so clever :)
<adrien>
we even have people with 2-char nicks on this channel ;p
Drup has quit [Read error: Operation timed out]
yezariaely has quit [Quit: Leaving.]
Yoric has joined #ocaml
mch has quit [Ping timeout: 240 seconds]
mchqwerty has quit [Ping timeout: 252 seconds]
Yoric has quit [Ping timeout: 240 seconds]
Drup has joined #ocaml
mcclurmc has quit [Ping timeout: 246 seconds]
ng_ has joined #ocaml
<ng_>
so, i have a recursive function that printing correctly outputs, now i need a hash table for the calculations more quickly.How can I do this?
<ggole>
There's a Hashtbl module.
<ng_>
and how to apply?
thomasga has quit [Ping timeout: 248 seconds]
<ggole>
See the documentation?
<ggole>
(You should install and/or bookmark the documentation for the stdlib, if you haven't already)
<ng_>
I'll read the documentation better...
mcclurmc has joined #ocaml
mcclurmc1 has joined #ocaml
mcclurmc has quit [Read error: Connection reset by peer]
thomasga has joined #ocaml
thomasga has quit [Client Quit]
zpe has joined #ocaml
Yoric has joined #ocaml
mcclurmc1 has quit [Ping timeout: 245 seconds]
mcclurmc has joined #ocaml
nikki93 has joined #ocaml
mcclurmc has quit [Quit: Leaving.]
mcclurmc has joined #ocaml
Yoric has quit [Ping timeout: 240 seconds]
mcclurmc1 has joined #ocaml
Snark has quit [Quit: leaving]
mcclurmc2 has joined #ocaml
mcclurmc has quit [Ping timeout: 252 seconds]
mcclurmc1 has quit [Ping timeout: 240 seconds]
chrisdotcode_ has joined #ocaml
chrisdotcode has quit [Ping timeout: 246 seconds]
UncleVasya has joined #ocaml
Yoric has joined #ocaml
Anarchos has joined #ocaml
ng_ has quit [Quit: Leaving]
ocp has joined #ocaml
caseyjames has joined #ocaml
<caseyjames>
Hi, will this match ever get to the second case? match set with | (_, []) -> [] | (card, slist) ->...
<adrien>
yes, if slist is not empty
<caseyjames>
cool thank you
ggole has quit [Ping timeout: 264 seconds]
mcclurmc2 is now known as mcclurmc
caseyjames has quit [Ping timeout: 250 seconds]
ulfdoz has quit [Ping timeout: 260 seconds]
nikki93 has quit [Remote host closed the connection]
steshaw has joined #ocaml
malo has quit [Quit: Leaving]
yacks has quit [Quit: Leaving]
Kakadu has joined #ocaml
UncleVasya has quit [Remote host closed the connection]
gour_ has quit [Quit: WeeChat 0.4.1]
UncleVasya has joined #ocaml
yacks has joined #ocaml
darkf has joined #ocaml
octet8 has joined #ocaml
ulfdoz has joined #ocaml
steshaw has quit [Ping timeout: 264 seconds]
<ollehar>
can't I pattern match like
<ollehar>
| odd x :: y => x :: oddmembers(y)
<ollehar>
_
<ollehar>
?
<adrien>
=>
<adrien>
?
<ollehar>
oh, wrong channel :P should be coq
<adrien>
also, no, not "odd x"; what would that mean?
<ollehar>
;)
<adrien>
ah :D
<companion_cube>
ollehar: | x :: y when odd x -> ...
<companion_cube>
?
<Anarchos>
ollehar be careful with (odd x)::y and odd (x::y)
<rks`>
companion_cube: in coq, constructors can start with a lowercase.
<companion_cube>
oh.
<companion_cube>
I thought it was a predicate function
<adrien>
that would have been my guess if that wasn't meant to be coq :)
_andre has quit [Quit: leaving]
steshaw has joined #ocaml
q66_ has joined #ocaml
q66 has quit [Disconnected by services]
q66_ is now known as q66
mcclurmc has quit [Read error: No route to host]
Sim_n is now known as Simn
octet8 has quit []
mcclurmc has joined #ocaml
technomancy has joined #ocaml
<technomancy>
I'm looking at packaging an ocaml binary for download; would I need a different binary for each version of a given gnu/linux distro?
<technomancy>
do people typically use PPAs for targeting ubuntu versions?
mcclurmc1 has joined #ocaml
<companion_cube>
technomancy: I think binaries are statically linked
<companion_cube>
so it should be ok reusing it
mcclurmc1 has quit [Client Quit]
pango has quit [Remote host closed the connection]
<Anarchos>
technomancy why don't you distribute a .cmo or .cma ?
<technomancy>
Anarchos: the target audience will not have ocaml installed
mcclurmc1 has joined #ocaml
mcclurmc has quit [Ping timeout: 240 seconds]
<companion_cube>
you need native binaries in 32 and 64 bits, though
mcclurmc1 is now known as foobaro32o235
foobaro32o235 is now known as mcclurmc
<technomancy>
heh; if I hear from anyone on a 32-bit machine I'll consider it =)
<technomancy>
companion_cube: does using ctypes make that question more complicated though?
<technomancy>
I make calls to libreadline
<companion_cube>
oh.
<companion_cube>
no idea really :(
<technomancy>
I should just try it, I guess
<technomancy>
readline fails hard when compiling on macosecks though =\
pango has joined #ocaml
<technomancy>
native binary built on debian segfaults on fedora; hrm
<companion_cube>
:(
<technomancy>
on the bright side, I do have a fedora machine I can do compilation on
<technomancy>
I had forgotten about that
<adrien>
technomancy: watch out for differences in C libraries
<companion_cube>
can't you link the C library statically too?
<adrien>
you're bound to the same old rules about portability of binaries
<adrien>
companion_cube: *NO*
<technomancy>
no idea; never used C
<adrien>
(well, you can, but it's not the right solution)
<companion_cube>
adrien: why not?
<technomancy>
I don't think readline changes very often though luckily =)
<adrien>
companion_cube: well, make a dumb C program, link glibc statically and read the warning
<kerneis>
My_param_module_that_needs_to_be_rebound_and_named does not contain remove_edge_e etc.
<kerneis>
maybe the interface of ocamlgraph has evolved since this code has been written
<kerneis>
a cleaner way to do it would be: module G = SchemaGraph0 include G
<kerneis>
and keeping just let copy g = g
<kerneis>
but avoiding the explicit redefinition of every function
<kerneis>
this code is really ugly
nikki93 has quit [Remote host closed the connection]
manizzle has joined #ocaml
steshaw has quit [Ping timeout: 246 seconds]
<GlenK>
thanks kerneis.
<GlenK>
haha. I think. I'm still trying to digest all that.
tane has quit [Quit: Verlassend]
<GlenK>
strikes me as odd because the same code compiled fine on centos 6. Just sorta insane to get it to do so, but it compiled eventually. never had this problem.
<GlenK>
but hey, that sorta worked. I hade to leave the empty redefinition. Thanks kerneis!
ollehar1 has quit [Ping timeout: 252 seconds]
zpe has joined #ocaml
zpe has quit [Ping timeout: 248 seconds]
ulfdoz has quit [Read error: Operation timed out]
arquebus has joined #ocaml
shinnya has joined #ocaml
UncleVasya has quit [Read error: Operation timed out]
travisbrady has quit [Quit: travisbrady]
arquebus has quit [Quit: Konversation terminated!]