graydon has quit [brunner.freenode.net irc.freenode.net]
Zadeh_ has quit [brunner.freenode.net irc.freenode.net]
skylan has quit [brunner.freenode.net irc.freenode.net]
emu has quit [brunner.freenode.net irc.freenode.net]
Torquema1a has quit [brunner.freenode.net irc.freenode.net]
Segora has quit [brunner.freenode.net irc.freenode.net]
xkb has quit [brunner.freenode.net irc.freenode.net]
nkoza has quit [brunner.freenode.net irc.freenode.net]
lindril has quit [brunner.freenode.net irc.freenode.net]
lam has quit [brunner.freenode.net irc.freenode.net]
merriam has quit [brunner.freenode.net irc.freenode.net]
lam has joined #ocaml
lindril has joined #ocaml
Segora has joined #ocaml
nkoza has joined #ocaml
xkb has joined #ocaml
Torquema1a has joined #ocaml
emu has joined #ocaml
skylan has joined #ocaml
Zadeh_ has joined #ocaml
graydon has joined #ocaml
merriam has joined #ocaml
lindril has quit [brunner.freenode.net irc.freenode.net]
lam has quit [brunner.freenode.net irc.freenode.net]
lindril has joined #ocaml
lam has joined #ocaml
lindril has quit [brunner.freenode.net irc.freenode.net]
lam has quit [brunner.freenode.net irc.freenode.net]
Zadeh_ has quit [brunner.freenode.net irc.freenode.net]
Torquema1a has quit [brunner.freenode.net irc.freenode.net]
Segora has quit [brunner.freenode.net irc.freenode.net]
graydon has quit [brunner.freenode.net irc.freenode.net]
xkb has quit [brunner.freenode.net irc.freenode.net]
nkoza has quit [brunner.freenode.net irc.freenode.net]
skylan has quit [brunner.freenode.net irc.freenode.net]
emu has quit [brunner.freenode.net irc.freenode.net]
graydon has joined #ocaml
Zadeh_ has joined #ocaml
skylan has joined #ocaml
emu has joined #ocaml
Torquema1a has joined #ocaml
xkb has joined #ocaml
nkoza has joined #ocaml
Segora has joined #ocaml
merriam has quit [brunner.freenode.net irc.freenode.net]
Segora has quit [brunner.freenode.net irc.freenode.net]
xkb has quit [brunner.freenode.net irc.freenode.net]
Torquema1a has quit [brunner.freenode.net irc.freenode.net]
Zadeh_ has quit [brunner.freenode.net irc.freenode.net]
graydon has quit [brunner.freenode.net irc.freenode.net]
emu has quit [brunner.freenode.net irc.freenode.net]
nkoza has quit [brunner.freenode.net irc.freenode.net]
skylan has quit [brunner.freenode.net irc.freenode.net]
graydon has joined #ocaml
Zadeh_ has joined #ocaml
skylan has joined #ocaml
emu has joined #ocaml
Torquema1a has joined #ocaml
xkb has joined #ocaml
nkoza has joined #ocaml
Segora has joined #ocaml
lindril has joined #ocaml
lam has joined #ocaml
merriam has joined #ocaml
stepcut has joined #ocaml
<stepcut>
I have a program that reads "/etc/passwd", then calls useradd, and then re-reads "/etc/passwd" -- only it does not seem to be re-reading "/etc/passwd" ... is there some sort of caching going on or something I need to know about?
<stepcut>
after I call useradd and re-read the file I still get the original contents
<whee>
closing the file and reopening and all?
<stepcut>
let ichan = open_in "/etc/passwd" in
<stepcut>
let result = (Passwdparser.passwd Passwdlexer.item) (Lexing.from_channel ichan) in
<stepcut>
close_in ichan;
<stepcut>
result
<stepcut>
result is a list of Unix.passwd_entry
<stepcut>
oh wait
<stepcut>
I friggin figured it out
<stepcut>
i have "let parse_passwd = " instead of "let parse_passwd () ="
<whee>
depends on how much you need to integrate the two, but it's not that hard
<intero>
would it be possible to port some C libs into ocaml?
<dash>
yes.
<intero>
whee: forgive the question but.. was it you who did the physics programs?
<dash>
i'm looking at extending pycaml to allow defining new python types :)
<intero>
dash: and is it doable?
<dash>
not sure yet
<dash>
but it can already call python/c api functions
<intero>
cool
<whee>
intero: what physics programs? heh
<intero>
whee: dont remember, probably for school/uni
<whee>
probably not :)
<whee>
dash: it might be worthwhile to look into using camlp4 for that
<whee>
specifically for generating things at compile time instead of explicitly doing every one by hand
<dash>
whee: Hmm. How so?
* dash
hasn't messed with camlp4 yet.
<whee>
I don't know how well it'd work with this particular interface, but (for example) there's a haskell interface using template haskell (which is basically haskell's camlp4 at this point) that would generate the actual bindings at compile time
<whee>
so you just declare what you want to use and the preprocessor expands that into all you need to use it
<whee>
haskell interface for cocoa, is what I wanted to say
<dash>
hmm
<whee>
I thought it was a great idea; the complete cocoa bindings fit in a 16kb tar.bz
<dash>
i'll have to study a bit more :)
<whee>
and then there's _nothing_ to do if one of the api changes or a new class is added
<dash>
interesting
<whee>
I compared it to the ruby bindings which were packaged in a relatively huge 300kb tar that'll be a pain to maintain as well
<whee>
since each class is explicitly handled
<dash>
wwell, i'm currently looking at rewriting a python DOM implementation in ocaml
<dash>
mostly to see how feasible using ocaml as an optimization for our python system is
<dash>
whee: do you know where i can find that cocoa binding?
<dash>
i'd like to see how they used camlp4
<whee>
there are no cocoa bindings for ocaml :\
<whee>
I was referring to the haskell bindings
<dash>
oh, haskell, heh
<dash>
okay
<whee>
the haskell bindings use a preprocessor much like camlp4 in its abilities
* dash
nods.
<whee>
camlp4 is easy to learn, go for it if it helps :P
<dash>
heh
<whee>
I don't know how well it would help
<whee>
but if you find yourself writing a lot of repetitive code with just a few things different each time, it might be worth looking into
* dash
nods.
<dash>
hmm.
<dash>
whee: i dont see stuff here on defining C structs. am i missing something obvious?
<whee>
what are you looking to do?
<dash>
well, to create a new python type from C, you create a PyTypeObject struct
<dash>
can i do that from ocaml, or does that need to be part of my C glue?
<dash>
(pycaml already has some :)
<whee>
yeah, you'll need to do that from C
<dash>
oh well :)
<whee>
mmm I hope gtk2 bindings are being worked on
<whee>
I'm also tempted to see if I can do cocoa bindings for ocaml now :\
<whee>
oh, great
<whee>
since I installed apple's X11 a week or so ago, ocamlbrowser gets compiled :))
docelic|away has quit [Read error: 110 (Connection timed out)]
<intero>
anyone
<intero>
?
<intero>
i have a little let.. in prob
docelic|away has joined #ocaml
<whee>
intero: hi~
<intero>
hi whee :P
<whee>
what's the problem? heh
<intero>
heh
<intero>
okay i have a graph
<intero>
and i can calculate the in_grade of each node
<intero>
(how many arcs enter a node)
<intero>
i have to calculate tha max in_grade in the graph
<intero>
having problems though, even if i know it's simple
<intero>
so i have 3 functions
<whee>
have some structure that contains all the nodes?
<intero>
yes
<intero>
type 'a graph = Gr of ('a * 'a) list;;
<intero>
pretty huh
<whee>
heh
<whee>
how about a fold_left on that list of nodes
<intero>
hell whee sorry i have to leave now
<whee>
List.fold_left max 0 [1; 2; 3; 4; 5];
<whee>
hokay~
<intero>
but those are couples
<whee>
yeah, replace max with a function to compare your nodes and replace 0 with a node with 0 connections
<whee>
and of course the list with the list of nodes
<intero>
i'll think of it
<intero>
thanks alot
<intero>
letting you know if i was able to do that
<intero>
:)
<intero>
later
<intero>
and thanks
* intero
is away: I'll answer as I come back, I am away now, sorry =(
<whee>
bye
asqui has quit [Read error: 104 (Connection reset by peer)]
asqui has joined #ocaml
polin8_ has joined #ocaml
polin8 has quit [Read error: 113 (No route to host)]