<orbitz>
BigJ2: if the structure of your function is: let f x = match x with ...; then you can replace it iwth let f = function ...
<BigJ2>
ok great thanks
ikaros has quit ["Leave the magic to Houdini"]
BigJ2_ has joined #ocaml
<BigJ2_>
sorry bad connection
<BigJ2_>
thanks for your help
BigJ2 has quit [Read error: 104 (Connection reset by peer)]
BigJ2_ is now known as BigJ2
<BigJ2>
sorry bad connection
<BigJ2>
thanks for your help
<BigJ2>
I was able to figure out how to print the x and y values that I pass as well
onigiri has quit [Read error: 110 (Connection timed out)]
<BigJ2>
maybe not looks like i am overriding the original function
<orbitz>
ocaml has no overlaodign of functions
Ringo48 has quit [Read error: 131 (Connection reset by peer)]
Ringo48 has joined #ocaml
BigJ2 has quit [Read error: 104 (Connection reset by peer)]
BigJ2 has joined #ocaml
BigJ2_ has joined #ocaml
BigJ2 has quit [Read error: 104 (Connection reset by peer)]
BigJ2_ is now known as BigJ2
BigJ2_ has joined #ocaml
BigJ2 has quit [Read error: 104 (Connection reset by peer)]
BigJ2_ is now known as BigJ2
BigJ2_ has joined #ocaml
BigJ2 has quit [Read error: 104 (Connection reset by peer)]
BigJ2_ is now known as BigJ2
<BigJ2>
let print_value v = print_string (direction v ^ "\n") ;;
<BigJ2>
let print_value (x,y) = print_string (string_of_float x ^ string_of_float y) ;;
BigJ2 has quit [Client Quit]
<orbitz>
print_endline already ads a "\n"
<orbitz>
and yes, that is not going ot work for you
<orbitz>
do you want print_value to do both rather than 2 functions/
verte has joined #ocaml
Ched has quit [Read error: 60 (Operation timed out)]
Ched has joined #ocaml
verte is now known as verte-work
tmaedaZ is now known as tmaeda
Ringo48 has quit [Remote closed the connection]
BigJ2 has joined #ocaml
<BigJ>
orbitz, ya it would be better to have print_value do both
tmaeda is now known as tmaedaZ
BigJ2 has left #ocaml []
mfp has quit [Read error: 110 (Connection timed out)]
mfp has joined #ocaml
jzmer has joined #ocaml
tmaedaZ is now known as tmaeda
jeddhaberstro has quit [Client Quit]
clank has quit [Client Quit]
caligula__ has joined #ocaml
caligula_ has quit [Read error: 110 (Connection timed out)]
caligula_ has joined #ocaml
tiz has quit [Read error: 60 (Operation timed out)]
tiz has joined #ocaml
jzmer has quit [Remote closed the connection]
sporkmonger has joined #ocaml
caligula__ has quit [Read error: 110 (Connection timed out)]
sporkmonger has quit ["Poof!"]
ulfdoz has joined #ocaml
thrasibule has quit [Read error: 110 (Connection timed out)]
verte-work has quit ["~~~ Crash in JIT!"]
Asmadeus_ is now known as Asmadeus
ulfdoz has quit [Read error: 110 (Connection timed out)]
ttamttam has joined #ocaml
f[x] has joined #ocaml
ttamttam has quit ["Leaving."]
<flux>
hmph, it does seem to me pastebin.org _is_ somet kind of deception, as a) whenever I go there, I get a popup, or a ff infobox of it (not so with pastebin.com) b) the ip-addresses of pastebin.org and pastebin.com differ c) the help page of pastebin.{org,com} both mention only pastebin.com
<flux>
(and d), pastebin.org has been registered 2 years later than .com)
Alpounet has joined #ocaml
kaustuv_` has joined #ocaml
kaustuv_ has quit [Read error: 110 (Connection timed out)]
ttamttam has joined #ocaml
<myst>
btw, I asked yesterday how to write (<= x). I found really beautiful solution: ((>=) x).
<Alpounet>
that's cheating
<Alpounet>
:-p
<Alpounet>
(actually, it'd rather be ((>) x)
<Alpounet>
)
<Alpounet>
but flip (<=) x is nice too IMO
<Alpounet>
let flip f x y = f y x ;; let your_function = flip (<=) x
<myst>
I like mine one. )
<myst>
and flip is the only beautiful way if you don't have twin-function
f[x] has quit [Read error: 145 (Connection timed out)]
Demitar has joined #ocaml
smimou has quit ["bli"]
caligula__ has joined #ocaml
caligula_ has quit [Read error: 60 (Operation timed out)]
julm_ has joined #ocaml
julm has quit [Read error: 60 (Operation timed out)]
rwmjones has joined #ocaml
myst has quit [Read error: 113 (No route to host)]
komar_ has joined #ocaml
dmentre has joined #ocaml
ikaros has joined #ocaml
animist has quit [Remote closed the connection]
animist has joined #ocaml
Camarade1Tux is now known as Camarade_Tux
animist has quit [Remote closed the connection]
ikaros_ has joined #ocaml
myst has joined #ocaml
animist has joined #ocaml
animist has quit [Remote closed the connection]
ikaros has quit [Read error: 113 (No route to host)]
animist has joined #ocaml
animist has quit [Remote closed the connection]
ztfw` has quit [Remote closed the connection]
ztfw` has joined #ocaml
tmaeda is now known as tmaedaZ
appletizer has joined #ocaml
animist has joined #ocaml
animist has quit [Remote closed the connection]
mihamina has joined #ocaml
<mihamina>
hi all
<Alpounet>
hi
<mihamina>
in a little project, I have code duplication. I would like to create a module. would you know a tutorial, and the way to compile the new module (the coamlc command line arguments)?
<mihamina>
the module is intended to avoid code duplication
<Alpounet>
hmm
<Alpounet>
ocaml-tutorial.org ?
<Alpounet>
there is a whole part about modules IIRC.
animist has quit [Read error: 60 (Operation timed out)]
animist has joined #ocaml
animist has quit [Remote closed the connection]
Ched has quit [Read error: 101 (Network is unreachable)]
tmaedaZ is now known as tmaeda
thrasibule has quit [Read error: 145 (Connection timed out)]
Yoric[DT] has joined #ocaml
mihamina has left #ocaml []
animist_ has joined #ocaml
animist_ has quit [Remote closed the connection]
derdon has joined #ocaml
hcarty has quit [Read error: 131 (Connection reset by peer)]
brendan has quit [pratchett.freenode.net irc.freenode.net]
brendan has joined #ocaml
maskd has quit [pratchett.freenode.net irc.freenode.net]
julm_ has quit [pratchett.freenode.net irc.freenode.net]
caligula__ has quit [pratchett.freenode.net irc.freenode.net]
jimmyb21871 has quit [pratchett.freenode.net irc.freenode.net]
diml has quit [pratchett.freenode.net irc.freenode.net]
haelix has quit [pratchett.freenode.net irc.freenode.net]
det has quit [pratchett.freenode.net irc.freenode.net]
jonafan has quit [pratchett.freenode.net irc.freenode.net]
Ori_B has quit [pratchett.freenode.net irc.freenode.net]
willb has quit [pratchett.freenode.net irc.freenode.net]
ertai has quit [pratchett.freenode.net irc.freenode.net]
palomer has quit [pratchett.freenode.net irc.freenode.net]
whale has quit [pratchett.freenode.net irc.freenode.net]
aij has quit [pratchett.freenode.net irc.freenode.net]
TaXules has quit [pratchett.freenode.net irc.freenode.net]
mbishop has quit [pratchett.freenode.net irc.freenode.net]
fremo has quit [pratchett.freenode.net irc.freenode.net]
tomaw has quit [pratchett.freenode.net irc.freenode.net]
ttamttam has quit [pratchett.freenode.net irc.freenode.net]
ttamttam has joined #ocaml
julm_ has joined #ocaml
caligula__ has joined #ocaml
maskd has joined #ocaml
willb has joined #ocaml
ertai has joined #ocaml
palomer has joined #ocaml
whale has joined #ocaml
jimmyb21871 has joined #ocaml
diml has joined #ocaml
jonafan has joined #ocaml
Ori_B has joined #ocaml
haelix has joined #ocaml
det has joined #ocaml
TaXules has joined #ocaml
mbishop has joined #ocaml
fremo has joined #ocaml
aij has joined #ocaml
tomaw has joined #ocaml
smimou has joined #ocaml
thelema_ has joined #ocaml
thelema has quit [Read error: 104 (Connection reset by peer)]
hcarty has joined #ocaml
<hcarty>
Are there logs for #debian-ocaml @ irc.debian.org?
<hcarty>
I asked a question there and while I was away my session died, so I
<orbitz>
might be better to askt hem?
<hcarty>
've lost the history
<Alpounet>
hcarty: ask gildor or zach then
<Alpounet>
zack*
<hcarty>
orbitz: Very true :-) I just don't connect over there that often
<hcarty>
Alpounet: Thanks, will do
<gildor>
hcarty: tell me how to setup a irc logger (package on debian stable) and i'll do that for you
<hcarty>
gildor: It
<hcarty>
Sorry .. new keyboard and I keep mistyping
<hcarty>
gildor: It's not a big issue either way. I has asked about getting help packaging PLplot's OCaml portion for Debian.
<hcarty>
gildor: had... ack, I can't type on this
<gildor>
hcarty: this can help other in the future
animist has joined #ocaml
<hcarty>
gildor: If I find some good information on setting up an IRC logger I will pass it along.
<Alpounet>
a bot would just do it, wouldn't it ?
<_zack>
Alpounet: I think there are logs somewhere, but I don't know exactly where, I'd check wiki.d.o for info on irc.d.o
willb has quit ["Leaving"]
willb has joined #ocaml
animist has quit [Remote closed the connection]
<Alpounet>
_zack: since there are some bots around there, I'm pretty sure there are logs
<_zack>
Alpounet: bots are almost all CIA bots. CIA is mostly write only on channels (e.g. for commit notifications), I'm not that sure that they keep logs
<Alpounet>
ok
<Alpounet>
anyway
<Alpounet>
getting xavierbot running and adding a loggin functionality shouldn't take long
<Alpounet>
I'll try to do that soon, but for the moment I don't have any place to put the bot on
dmentre has quit [Read error: 54 (Connection reset by peer)]
tonyIII_ has joined #ocaml
animist has joined #ocaml
tonyIII has quit [Read error: 104 (Connection reset by peer)]
animist has quit [Remote closed the connection]
Alpounet has quit ["Page closed"]
animist has joined #ocaml
animist has quit [Remote closed the connection]
<Camarade_Tux>
kaustuv_`: afaict, yup, it works
<Camarade_Tux>
I also nearly compiled it with mingw-w64's 32bit toolchain but had a naming issue (was looking for stdlibstdlib.cma which doesn't exist afaik)
<Camarade_Tux>
I need to stop having a look at ocamlviz' project page until I really try it, it looks far too nice :)
lutter has quit ["Leaving."]
animist has joined #ocaml
animist has quit [Remote closed the connection]
animist has joined #ocaml
f[x] has quit [Read error: 145 (Connection timed out)]
animist has quit [Remote closed the connection]
ikaros_ has quit ["Leave the magic to Houdini"]
animist has joined #ocaml
ikaros has joined #ocaml
animist has quit [Remote closed the connection]
animist has joined #ocaml
animist has quit [Remote closed the connection]
kaustuv_ has joined #ocaml
_zack has quit ["Leaving."]
animist has joined #ocaml
kaustuv_` has quit [Read error: 110 (Connection timed out)]
animist has quit [Remote closed the connection]
jonafan has quit [Read error: 54 (Connection reset by peer)]
animist has joined #ocaml
komar_ has quit [Read error: 110 (Connection timed out)]
animist has quit [Read error: 60 (Operation timed out)]
animist has joined #ocaml
kaustuv_ is now known as kaustuv
maskd has quit [pratchett.freenode.net irc.freenode.net]
diml has quit [pratchett.freenode.net irc.freenode.net]
haelix has quit [pratchett.freenode.net irc.freenode.net]
det has quit [pratchett.freenode.net irc.freenode.net]
caligula__ has quit [pratchett.freenode.net irc.freenode.net]
jimmyb21871 has quit [pratchett.freenode.net irc.freenode.net]
julm_ has quit [pratchett.freenode.net irc.freenode.net]
Ori_B has quit [pratchett.freenode.net irc.freenode.net]
caligula_ has joined #ocaml
haelix has joined #ocaml
Ori_B has joined #ocaml
julm has joined #ocaml
animist has quit [Remote closed the connection]
animist has joined #ocaml
thelema has joined #ocaml
ztfw` is now known as ztfw
jonafan has joined #ocaml
diml has joined #ocaml
thelema_ has quit [Read error: 104 (Connection reset by peer)]
animist has quit [Remote closed the connection]
det has joined #ocaml
jimmyb2187 has joined #ocaml
ttamttam has quit ["Leaving."]
komar_ has joined #ocaml
onigiri has joined #ocaml
Submarine has quit [Read error: 113 (No route to host)]
willb has quit [Read error: 110 (Connection timed out)]
derdon has joined #ocaml
albacker has joined #ocaml
animist has joined #ocaml
ztfw has quit [Remote closed the connection]
f[x] has joined #ocaml
ztfw has joined #ocaml
animist has quit [Remote closed the connection]
animist has joined #ocaml
tmaeda is now known as tmaedaZ
tmaedaZ is now known as tmaeda
Submarine has joined #ocaml
Yoric[DT] has quit ["Ex-Chat"]
animist has quit [Remote closed the connection]
animist has joined #ocaml
animist has quit [Remote closed the connection]
<thelema>
wow, that's unusual - I 've actually managed to raise an out_of_memory exception
<thelema>
ah, I accidentally used = to compare graph nodes.
Amorphous has quit [Read error: 104 (Connection reset by peer)]
animist has joined #ocaml
ulfdoz has joined #ocaml
Amorphous has joined #ocaml
ttamttam has joined #ocaml
<kaustuv>
In an ideal world where all other problems are fixed, there would be two different exceptions for out of heap space and out of stack space
<albacker>
where can i see the code of ocaml functions?
<kaustuv>
albacker: not sure what you mean. Ocamlc/ocamlopt are compilers, so in general there is no way to get the source of an arbitrary function
<kaustuv>
But if it's a standard library function, you can read the ocaml sources...
<albacker>
yes.
<albacker>
functions like List.rev
<albacker>
that's what i was asking about.
<kaustuv>
That would be in stdlib/list.ml in the ocaml source
<albacker>
in some match with there's a | right in front of the first case.
<albacker>
and in some other code there is not.
<kaustuv>
The first | is optional
<albacker>
is there a rule or ocaml ignores it.
<albacker>
ok.
<derdon>
does the style guide have a convention for this?
<albacker>
i dont think so, since even in list.ml i've seen 2 functions one having | at the first case and the second didn't. :/
<hcarty>
derdon: Both forms seem to be used quite frequently in the code I've read
<derdon>
ok
<hcarty>
If the | is lined up with the "m" in match, then a leading | may make the code easier to read
<kaustuv>
I think it's up to personal preferences. Speaking for myself, I use | for all cases because I don't think of the first case as special. Also sometimes I move cases around
<hcarty>
kaustuv: Seconded, though it something I didn't do for a long time.
<derdon>
I think it's prettier to use it for all cases
<albacker>
one way shows 2;3;4;5 and another way 1;2;3;4
<BigJ>
i think I am finally starting to catch on to ocaml
<albacker>
i can't see a better solution but adding another variable to show that it's the beginning.. is there a more elegant way?
<flux>
albacker, well, you can do it like this: let rec filter_dups l = match l with x::y::rest when x = y -> filter_dups (x::rest) | x::rest -> x::filter_dups rest | other -> other
<albacker>
oh,
<albacker>
thanks
<albacker>
i had to figure out the _::_::_ :/
<flux>
(and you can actually write it like: let rec filter_dups = function x:: ..etc..)
<albacker>
i haven't seen the 'when' yet in fact.
<albacker>
and i dont see what do yo mean with the function x:: there
<flux>
wlet rec filter_dups = function x::y::rest when x = y -> filter_dups (x::rest) | x::rest -> x::filter_dups rest | other -> other
<flux>
minus the 'w' at the front :)
<albacker>
is when x=y equal to if(x=y) do_this
<flux>
well, almost
<flux>
but if the condition is false, it keeps on matching
<flux>
btw, if(x=y) then can be written without parens, like the when
<albacker>
if x=y
<flux>
yes
<albacker>
i'm very Cish
<flux>
:)
<flux>
well, atleast you didn't use references there ;)
<albacker>
my brain is fckdup right now, I'm doing C, Java, Ocaml, Bash(if this counts)..
<flux>
..but the reverse will happen.. you will write C-programs with recursion and use the ?: so much that your friends or colleagues talk of operator abuse..
<albacker>
:)
<albacker>
i wrote a then in java
<albacker>
and opened a { in ocaml
<albacker>
luckyly i have emacs
ztfw has quit [Read error: 60 (Operation timed out)]
ztfw has joined #ocaml
Submarine has quit ["Leaving"]
Yoric[DT] has quit ["Ex-Chat"]
det has quit [Read error: 104 (Connection reset by peer)]
julm has quit [Read error: 110 (Connection timed out)]
ulfdoz has quit [Read error: 110 (Connection timed out)]
<Camarade_Tux>
once I used 't[i] <- 42;' in C, took me a long time to undrstand why gcc was telling me "the statement has no effect" :)
<albacker>
or using = in if statements :/
<Camarade_Tux>
once or twice I also tried to define a function inside another one, hopefully I've always been "errr, I can't even type that"
<derdon>
Camarade_Tux: what's so wrong about nested functions?
<Camarade_Tux>
derdon: in C ;)
<derdon>
oh, I am not experienced with C
<albacker>
C rox
<albacker>
very fast
<Camarade_Tux>
it's just impossible to do that ;)
<derdon>
OCaml is fast, too. and I don't need more speed than this
<hcarty>
If/when an extra boost from C is needed for speed or otherwise, the OCaml C FFI is thankfully rather simple to work with.
<hcarty>
Not as dead-simple as something like Pure, but as or more simple as most other languages I've used.
<albacker>
is ocaml powerful ?
<albacker>
any app programmed in ocaml.
mbishop_ has joined #ocaml
<Camarade_Tux>
(why is Emperor Penguin's wikipedia page locked for editing...)
<Camarade_Tux>
albacker: ocaml is powerful, as for the apps, there is no rule for sure :P
<albacker>
what do you mean?
julm has joined #ocaml
<Alpounet>
albacker, Microsoft, Intel, Dassault, among others, use OCaml
<albacker>
Alpounet, so i've read, but where do they use Ocaml?
<Alpounet>
compiler oriented stuffs
<derdon>
Alpounet: MS? then OCaml is too mainstream, I have to choose s.th. different
<Alpounet>
code generation oriented stuffs
<albacker>
ok, so it's very precise its usage.. no ??
<Alpounet>
albacker, on the other hand, there are many apps here and there in OCaml
<Alpounet>
of all kinds
<Alpounet>
peer-to-peer
<Alpounet>
games
<Alpounet>
editors
<Alpounet>
etc
<Alpounet>
OCaml is a real world language, it's just functional :)
<Camarade_Tux>
intel uses it in circuit design I think but I can't remember more
<albacker>
i use it at school but i started liking it a lot :) since i had some scheme experience.
<Alpounet>
derdon, just because MS uses it internally ? :-)
<derdon>
Alpounet: yep
<Alpounet>
interesting...
<Camarade_Tux>
I'm wondering if MS' license is not because of F#
<Camarade_Tux>
they wanted to be free of any possible claim
f[x] has quit [Read error: 110 (Connection timed out)]
<Alpounet>
possible
<Alpounet>
they may also have picked some stuffs from ocaml{c,opt}'s frontend :-p
<Camarade_Tux>
and I'm getting close to a web browser :)
<albacker>
i thought it was common only in france.
<albacker>
people at my uni use it a lot.
<albacker>
even at the uni research labos i think.
<hcarty>
It is probably most common in France
<hcarty>
But it is used outside of France. I know there are at users in the US and Japan (Jane St. operates in both locations IIRC, and there are other folks who are not Jane St. related)
<Camarade_Tux>
the map on ohloh shows a trend but nothing more: there is nobody from japan but is has beeen proven lots of ocaml programmers aret here
<Alpounet>
there's an OCaml User Group in Japan, IIRC.
<Camarade_Tux>
the ocaml meeting in japan was pretty crowded in japan iirc
<albacker>
:)
<Alpounet>
yeah
<Alpounet>
ocaml meeting
<Alpounet>
not user group
<hcarty>
Yaron Minsky, one of the Jane St. folks, called OCaml comically unpopular in one of his talks. Or something close to that.
<albacker>
are there libraries for X programming in caml?
<albacker>
ocaml*
<albacker>
gui
<hcarty>
lablgtk2 provides fairly complete access to Gtk+ 2
<Camarade_Tux>
lablgtk is good :)
<hcarty>
No maintained Qt or wx bindings though.
<Camarade_Tux>
there is one thing with qt... there is qtbindinggenerator now, it basically documents the api in a machine-friendly way
<Camarade_Tux>
it was released right after the summer project for qtcaml
det has joined #ocaml
<hcarty>
Camarade_Tux: Yes, there seems to be some activity now and then with that project. Hopefully it will see eventually be reasonably complete and see a proper release.
<hcarty>
I'm quite content with lablgtk though
mbishop has quit [Connection timed out]
<Camarade_Tux>
but as I've learned the hard way, if you want good bindings, you need detailled annotations (not just the types) and I'm not sure the tools targetting scripting language (python comes to my mind) do that
<Camarade_Tux>
I have to say I'm enjoying lablgtk2 more now that I've "hacked" a bit on it
<hcarty>
I'm hoping to get Gtk_light to the point where it is useful for small projects. It will have to wait until I need it though, which will likely be a few weeks or months from now.
<albacker>
night all
albacker has quit ["_"]
maskd has joined #ocaml
_JusSx_ has quit ["leaving"]
willb has quit [Read error: 113 (No route to host)]
willb has joined #ocaml
derdon has quit []
derdon has joined #ocaml
derdon has quit [Client Quit]
Alpounet has quit ["Leaving"]
willb has quit [Read error: 110 (Connection timed out)]
thrasibule has joined #ocaml
jzmer has quit [Remote closed the connection]
thrasibule_ has joined #ocaml
thrasibule has quit [Read error: 104 (Connection reset by peer)]