<context>
pango: is there any generalized method of getting packages asside from godi
<context>
macports 3.10 loads cma files fine, ocaml on godi is 3.09 and says dynamic loading isnt supported on os x
<pango>
I'm using Debian, that comes with a good set of packaged ocaml libs
<pango>
so I never used tried Godi
<context>
kk
Mr_Awesome has joined #ocaml
yminsky has joined #ocaml
dbueno has quit ["Leaving"]
yminsky has quit []
buluca has quit [Read error: 113 (No route to host)]
seafood_ has quit []
mordaunt has quit [Read error: 104 (Connection reset by peer)]
<context>
mm i think i need like an ocaml faq
<context>
whats the diff between 'let f () = ...' and 'let f = function ...'
<tsuyoshi>
felix^^: what is the type of Gdome.nodeList#item?
<tsuyoshi>
let f () = and let f = function () -> are the same thing
<context>
kk
<context>
tsuyoshi: and is there a way to pass functions themselves as params or return values, or store them in a struct
<context>
:x
<tsuyoshi>
sure..
<tsuyoshi>
functions are just regular variables
<tsuyoshi>
let foo bar = bar 1 in foo (fun n -> n + 1)
<context>
ahh gotcha
<context>
yeah i need to start trying stuff out before asking questions for stuff like that
<tsuyoshi>
operators are functions too.. if you put parentheses around them you can treat them like regular functions
<tsuyoshi>
so with currying you can do that same example like
<tsuyoshi>
let foo bar = bar 1 in foo ((+) 1)
<context>
heh, i think the first one is a little mor readable :p
<context>
oh now i get it
<context>
how would you define unknown # of function arguements
<context>
like printf does/can
<tsuyoshi>
that is the only part of ocaml I don't understand yet
<context>
haha
<tsuyoshi>
the printf code makes no sense to me
<context>
thats acceptable ;)
Yoric[DT] has joined #ocaml
Yoric[DT] has quit ["Ex-Chat"]
felix^^ has quit [Remote closed the connection]
<flux>
ooh, darcs 2.0pre1 is out
ttamttam has joined #ocaml
ertai has joined #ocaml
filp has joined #ocaml
<context>
im a git man myself
<context>
never touched darcs much :x
<flux>
I've used darcs for small projects; I think my personal projects hit that category nicely ;)
<flux>
perhaps I should switch a few older svn-repos to darcs too..
<flux>
also my ~/.*-files are in darcs nowadays (they used to be in cvs, then I switched to subversion, now darcs)
<flux>
darcs needs no configuration to talk about (it asks for your email address when you initialize a new repository) and pushing and pulling is a breeze.. also the cherry-picking of individual thunks while committing is nice, although I hear that's in its competitors also nowadays
<context>
yeah i stated with svn, then hg for a couple weeks then git
<flux>
perhaps the other dvcs-systems are just as nice, I haven't tried
<context>
the idea of darcs sounds funny, the way it works :/
<context>
meh ill save it for a boring sunday afternoon
sadmac has quit [Read error: 110 (Connection timed out)]
sadmac has joined #ocaml
__suri has quit []
ygrek_ has joined #ocaml
bringert has joined #ocaml
bringert has quit [Client Quit]
smimou has joined #ocaml
<lbc>
why is ocamlc having problems with "/usr/lib/caml/config.h:140: error: parse error before "int64"" when working on a C source file that #includes mlvalues.h ?
<lbc>
(I'm on a 32 bit 686)
<lbc>
nevermind
<flux>
what was the problem?
<lbc>
I had the wrong config.h on my path
<lbc>
the one for a native win32 ocamlc, but I was working in a cygwin environment
<Associat0r>
question, will ocaml allow me todo pure functional programming like haskell also with monads and stuff
<Associat0r>
I want to explore pure functional programming but don't want to have to learn haskell and ocaml at the same time
bongy has joined #ocaml
<flux>
monadic programming is possible in ocaml, but it's not quite as easy as with haskell.
<flux>
there are syntax extensions for writing monadic code
<flux>
I'm sure a quick google will find a lot of related resources
<Associat0r>
also is there any other thing that is missing?
<Associat0r>
other than monads
<flux>
type classes
<Associat0r>
haskell has those?
<flux>
yes
<Associat0r>
that I can also simulate in ocaml?
<flux>
module system has equivalent power, but you cannot emulate it syntax-wise
<Associat0r>
ok thanks for advice man
<Associat0r>
I will try haskell for a week first then and then switch to ocaml for real work
<Associat0r>
it is just that I want to feel what pure functional looks like
<lbc>
'lo again ...
<lbc>
ocamlopt is finding a "Corrupted compiled interface /usr/lib/ocaml/lablgtk2/gdk.cmi". lablgtk2 is pulled out of a cygwin repo. Can that be do to a version mismatch ?
<lbc>
s/do/due/
ertai has quit [Read error: 110 (Connection timed out)]
asmanur has joined #ocaml
Proteus has joined #ocaml
bongy has quit ["Leaving"]
bringert has joined #ocaml
ertai has joined #ocaml
hkBst has joined #ocaml
bringert has quit []
rwmjones has joined #ocaml
jdh30 has joined #ocaml
Associat0r has quit []
Yoric[DT] has joined #ocaml
ikaros has joined #ocaml
bongy has joined #ocaml
jdh30 has quit ["using sirc version 2.211+KSIRC/1.3.12"]
ygrek_ has quit [Remote closed the connection]
Tetsuo has joined #ocaml
__suri has joined #ocaml
RobertFischer has joined #ocaml
RobertFischer has left #ocaml []
pango has quit [Remote closed the connection]
pango has joined #ocaml
marmottine has joined #ocaml
buluca has joined #ocaml
suppaman has joined #ocaml
ttamttam has left #ocaml []
<jonafan>
ASDF
<jonafan>
does anyone use the GTK bindings?
<Yoric[DT]>
I've used them a bit.
<Yoric[DT]>
Can't say I remember much.
<jonafan>
well i just want to know generally how they work
<jonafan>
you might remember enough to tell me that?
<Yoric[DT]>
I remember that starting is tricky.
<Yoric[DT]>
You need to understand the local GObject.
<Yoric[DT]>
"local" as in "OCaml version of"
<Yoric[DT]>
The good thing is that the library doesn't let you make much mistakes.
<jonafan>
how do you get events?
<Yoric[DT]>
Callbacks.
<jonafan>
hmm
<Yoric[DT]>
You attach them to objects using some method.
<jonafan>
i'm trying to understand how to write a GUI as functionally as possible
<Yoric[DT]>
Check Chris King's OCaml RT.
<Yoric[DT]>
Functional Reactive toolkit.
<jonafan>
if you must use callbacks, then the function that is being called by GTK must get its state from somewhere else while the function is running
<jonafan>
i just learned how to use monads and wrote some in ocaml a couple of days ago
<Yoric[DT]>
I have only very little experience with monads.
<jonafan>
monads are nifty but i guess you don't really need them in this language
<Yoric[DT]>
At the moment, I'm playing with streams :)
<jonafan>
lazy lists?
<jonafan>
also very awesome
<Yoric[DT]>
Nope, streams are destructive by opposition to lazy lists.
<jonafan>
ohhhhh?
<Yoric[DT]>
Note that I do find lazy lists very nice.
kelaouchi has joined #ocaml
<Yoric[DT]>
I might add some syntax for these whenever I find time.
<jonafan>
anyway, hooray for writing code that has no practical usage!
Associat0r has joined #ocaml
<Yoric[DT]>
Yep :)
<jonafan>
i also feel like i even understand OOP better even though i think it's 90% crap
ertai has quit [Read error: 110 (Connection timed out)]
<jonafan>
the core of the OOP philosophy is to never return anything. it's getter functions, not setter functions in oop that are evil
<hkBst>
Yoric[DT]: "streams are destructive by opposition to lazy lists"? Are you talking about memoization?
<Yoric[DT]>
No, I'm talking about Stream.t .
<Yoric[DT]>
Once you have read the first element of a stream, it disappears.
<Yoric[DT]>
jonafan: Well, I have the feeling that people who come from functional programming tend to think that OOP solves all the wrong problems.
<hkBst>
Yoric[DT]: ah, ports :)
<Yoric[DT]>
Sounds like some bit of Haskell I never frequented.
<jonafan>
if you walk down a lazy list with tail recursion, you lose references to the things you've already read, thus those nodes will disappear after being read
<Yoric[DT]>
Indeed.
<hkBst>
right, because no other references could possibly exist
<Yoric[DT]>
With Stream.t, the first element always disappears when you move to the next element.
<Yoric[DT]>
The main use is for recursive descent parsers.
<Yoric[DT]>
Whenever I finish the first version of my parser, I might decide to make it use lazy lists instead.
<jonafan>
\m/
<Yoric[DT]>
Well, gottago.
<Yoric[DT]>
Talk to you later.
<jonafan>
bye
ygrek_ has joined #ocaml
buluca has quit ["Leaving."]
zmdkrbou_ has joined #ocaml
filp has quit ["Bye"]
Demitar has quit [Read error: 110 (Connection timed out)]
zmdkrbou has quit [Read error: 113 (No route to host)]
rwmjones has quit ["Closed connection"]
olleolleolle has joined #ocaml
bongy has quit ["Leaving"]
zmdkrbou_ is now known as zmdkrbou
ttamttam has joined #ocaml
olleolleolle has left #ocaml []
suppaman has quit [Read error: 104 (Connection reset by peer)]
suppaman has joined #ocaml
suppaman has quit [Read error: 104 (Connection reset by peer)]
suppaman has joined #ocaml
suppaman has quit [Read error: 104 (Connection reset by peer)]
suppaman has joined #ocaml
Snark has joined #ocaml
asmanur has quit [Remote closed the connection]
asmanur has joined #ocaml
madroach has joined #ocaml
nuncanada has joined #ocaml
asmanur has quit [Read error: 110 (Connection timed out)]
ertai has joined #ocaml
<Jeff_123>
is there an ocaml zipper library for n-ary trees? So far all I can find is code for binary trees
buluca has joined #ocaml
suppaman has quit [Read error: 104 (Connection reset by peer)]
suppaman has joined #ocaml
suppaman has quit [Read error: 104 (Connection reset by peer)]
suppaman has joined #ocaml
ecc has joined #ocaml
asmanur has joined #ocaml
buluca has quit [Read error: 113 (No route to host)]
<Jeff_123>
nm I found one
bongy has joined #ocaml
asmanur has quit [Remote closed the connection]
<Yoric[DT]>
Yes, I can now build streams from lists -- with comprehension.
<Jeff_123>
is that the camlp4 stuff you've been working on?
<Yoric[DT]>
Yep.
<Jeff_123>
how many bytes of camlp4 language does it take to implement it?
<Yoric[DT]>
About 30k.
<Yoric[DT]>
But they add several features.
<Yoric[DT]>
* a new "for" loop
<Yoric[DT]>
(well, not very new, it's an extension of that of the OCaml Tutorial)
<Yoric[DT]>
* array ranges
<Yoric[DT]>
* list ranges and comprehension
<Yoric[DT]>
* stream ranges and comprehension
<Yoric[DT]>
* "cross-comprehension" from lists to streams
<Yoric[DT]>
(or from arrays to streams)
<Jeff_123>
sounds pretty wild
<Yoric[DT]>
I'm having fun :)
Snark has quit ["Quitte"]
ttamttam has left #ocaml []
Jeff_123 has quit ["Leaving."]
nuncanada has quit ["Leaving"]
<mbishop>
list ranges eh? neat :)
<mbishop>
I hate having to write my own
olleolleolle has joined #ocaml
marmottine has quit ["Quitte"]
context has quit [Remote closed the connection]
bongy has quit ["Leaving"]
context has joined #ocaml
olleolleolle has left #ocaml []
Jeff_123 has joined #ocaml
kelaouch1 has joined #ocaml
Tetsuo has quit ["Leaving"]
Jeff_123 has quit [Read error: 104 (Connection reset by peer)]
Jeff_123 has joined #ocaml
pippijn_ has joined #ocaml
pippijn has quit [Read error: 104 (Connection reset by peer)]
mbishop has quit ["Konversation terminated!"]
mbishop has joined #ocaml
suppaman has quit ["all your bye are belong to us"]
<hcarty>
Do ranges and comprehensions work together?
<Yoric[DT]>
Yes.
<hcarty>
Then doubly nice :-)
<Yoric[DT]>
:)
<Yoric[DT]>
I'll try and clean-up the code this week.
<Jeff_123>
I definetly like the looks of it
<Yoric[DT]>
I've optimized arrays to try and make sure that ranges don't make too much of a mess.
<Yoric[DT]>
i.e. [|1..5|] is computed during compilation
<Yoric[DT]>
but [|0+1 .. 5|] has to be deferred to execution
<Jeff_123>
too bad it probably conflicts with the already existing list comprehension syntax extentsion, but fram what I've seen it's not terribly powerful anyway.
<Jeff_123>
I mean the already existing one isn't...
<Yoric[DT]>
Actually, I use the same syntax (and I replace their rules, so it shouldn't be a problem).
<Yoric[DT]>
Anyway, gottago.
<Jeff_123>
oh that's cool, so I could mix your expentension with their [ x | blah ] syntax? That's cool.
<Jeff_123>
ok see you!
<Yoric[DT]>
Good night everyone.
ertai has quit [Read error: 110 (Connection timed out)]
Yoric[DT] has quit ["Ex-Chat"]
buluca has joined #ocaml
gim has quit [Read error: 110 (Connection timed out)]