irc.freenode.net changed the topic of #ocaml to: OCaml 3.08 "Bastille Day" Release available ! -- Archive of Caml Weekly News: http://pauillac.inria.fr/~aschmitt/cwn , A tutorial: http://merjis.com/richj/computers/ocaml/tutorial/ , A free book: http://cristal.inria.fr/~remy/cours/appsem, Mailing List (best ml ever for any computer language): http://caml.inria.fr/bin/wilma/caml-list
Iter has quit [Read error: 110 (Connection timed out)]
gim has quit ["n8"]
HOm4r has joined #ocaml
HOm4r has quit [Client Quit]
Robert_ has joined #ocaml
Robert has quit [Read error: 104 (Connection reset by peer)]
cjohnson has quit ["Leaving"]
Lemmih has quit [orwell.freenode.net irc.freenode.net]
j_n has quit [orwell.freenode.net irc.freenode.net]
pattern has quit [orwell.freenode.net irc.freenode.net]
jlouis has quit [orwell.freenode.net irc.freenode.net]
durnew has quit [orwell.freenode.net irc.freenode.net]
cmeme has quit [orwell.freenode.net irc.freenode.net]
Lemmih has joined #ocaml
durnew has joined #ocaml
pattern has joined #ocaml
j_n has joined #ocaml
cmeme has joined #ocaml
jlouis has joined #ocaml
Lemmih__ has joined #ocaml
tomp has quit ["Client Exiting"]
Lemmih has quit [Read error: 110 (Connection timed out)]
pattern has quit [Read error: 110 (Connection timed out)]
pattern has joined #ocaml
mflux_ has joined #ocaml
mflux has quit [Read error: 104 (Connection reset by peer)]
Lemmih__ has quit ["Haskell - www.haskell.org"]
monochrom has quit ["Don't talk to those who talk to themselves."]
Robert_ is now known as Robert
vezenchio has quit ["Hydrocon technology produces two waste products: steam and green goo. We dispose of the steam through various vents, strategi]
shawn_ has joined #ocaml
shawn has quit [Read error: 54 (Connection reset by peer)]
shawn_ has quit [Read error: 104 (Connection reset by peer)]
shawn has joined #ocaml
mlh has quit [Client Quit]
withersoever has joined #ocaml
grirgz has joined #ocaml
<grirgz> hi
smimou has joined #ocaml
_fab has joined #ocaml
<grirgz> how can i redirect the input and output of a process (Unix.open_process) to stdin and stdout ?
smimou has quit [Read error: 104 (Connection reset by peer)]
_fab has quit [orwell.freenode.net irc.freenode.net]
Robert has quit [orwell.freenode.net irc.freenode.net]
grirgz has quit [orwell.freenode.net irc.freenode.net]
ndara_ has quit [orwell.freenode.net irc.freenode.net]
mellum has quit [orwell.freenode.net irc.freenode.net]
ronwalf has quit [orwell.freenode.net irc.freenode.net]
grirgz has joined #ocaml
_fab has joined #ocaml
Robert has joined #ocaml
ndara_ has joined #ocaml
ronwalf has joined #ocaml
mellum has joined #ocaml
HOm4r has joined #ocaml
HOm4r has quit [Client Quit]
<sic-> grirgz: use Unix.open_process
<grirgz> sic-: yes, but how can i know when to read and when to write ? in fact, i want to redirect i/o throught a socket
<sic-> open Unix;;
<sic-> let (inc, outc) = Unix.open_process "ls";;
<sic-> close_out outc;;
<sic-> input_line inc;;
<sic-> (* for example *)
<sic-> if you wanted to write something to the process before reading the output, you could write before closing outc
<sic-> oh, I guess that's not what you want
<sic-> you can use create_process to pass in file_descrs for your sockets
<grirgz> thanks :)
<mflux_> btw, is there a way to convert between unix file handles (integers) and type file_descr?
Iter has joined #ocaml
mlh has joined #ocaml
kinners has joined #ocaml
_fab has quit [orwell.freenode.net irc.freenode.net]
mellum has quit [orwell.freenode.net irc.freenode.net]
ronwalf has quit [orwell.freenode.net irc.freenode.net]
grirgz has quit [orwell.freenode.net irc.freenode.net]
ndara_ has quit [orwell.freenode.net irc.freenode.net]
Robert has quit [orwell.freenode.net irc.freenode.net]
grirgz has joined #ocaml
_fab has joined #ocaml
Robert has joined #ocaml
ndara_ has joined #ocaml
ronwalf has joined #ocaml
mellum has joined #ocaml
_fab has quit [orwell.freenode.net irc.freenode.net]
mellum has quit [orwell.freenode.net irc.freenode.net]
ronwalf has quit [orwell.freenode.net irc.freenode.net]
grirgz has quit [orwell.freenode.net irc.freenode.net]
ndara_ has quit [orwell.freenode.net irc.freenode.net]
Robert has quit [orwell.freenode.net irc.freenode.net]
grirgz has joined #ocaml
_fab has joined #ocaml
Robert has joined #ocaml
ndara_ has joined #ocaml
ronwalf has joined #ocaml
mellum has joined #ocaml
bk_ has joined #ocaml
systems has joined #ocaml
<systems> hi
<systems> which scoping mechanism ocaml uses, lexical or dynamic?
<Iter> lexical.
<Iter> not that it should be any surprise.
<systems> okay, i don't think i understand the difference, because ... well, i am currently reading the elisp introduction
<Iter> btw. nice to see some discussion. You're the first person to talk in this channel in at least 4 hours :)
<Iter> elisp uses dynamic scope.
<Iter> or at least, it did last time I looked.
<systems> and it suggest that let x=y in whatever means its dynamically scoped
<Iter> which introduction? url?
<systems> one second please
<Iter> let is a common form in lexically scoped languages.
<Iter> scheme, common-lisp, haskell, and ml all have let forms, and are all lexically scoped.
<Iter> mmm I think erlang might also have a let form, I forget.
<systems> i see
<Iter> do you know what it means to be lexically scoped?
<systems> i think, it means it look for the names last in
<systems> not first in
<Iter> mmm not sure what you mean by that, but I suspect that might suggest some confusion.
<systems> well, you program is like a nested list of expression, dynamic look for var values, outside in, lexical looks for values, inside out
<systems> thats what i think it is
<Iter> nope, that's not quite right :(
<systems> :)
<systems> a let expression like sets a new root for a certain name
<systems> dynamic scoping looks for the first set value for a name, lexical scoping for the last set value, of course within an expression space
<systems> or scope
<Iter> given a function f = \x.\y.x+y, does the expression (let g = f 4 in (let x = 5 in (g 2))) return 6 or 7? In lexical scope it returns 6, dynamic scope returns 7.
<Iter> The question is what does the value of x bind to? In lexical scope it binds to the value of x in the closest *defining* environment. In dynamic scope it binds to the value of x in the closest *calling* environment.
<Iter> (I'm expecting questions, I doubt that explaination was sufficient ;)
<systems> let x = 5 in (g 2) ?? this is missing something, right
<systems> x is not called in g 2
<Iter> g = f 4 which of course returns \y.x+y.
<Iter> so there is a reference to x in g.
<Iter> the question at issue is, which x does the x in g refer to?
<Iter> does it refer to the x in the environment in which g was defined (the call to f, ie. 4)
<Iter> or does it refer to the x in the environment in which g is called (the call to g 2, which is enclosed in a let x = 5, so x would be bound to 5)
<Iter> help?
kinners has quit [Read error: 110 (Connection timed out)]
<Iter> mmm that elisp manual is poorly worded.
<systems> hehe
<Iter> the binding of a symbol is visible only in functions ***called*** in the let form; in Emacs Lisp, scoping is dynamic, not lexical. <= emph added.
<systems> well, it's an intro for non programmers as well
<systems> so i believe its kinda dumbed down
<Iter> in lexical scoping, the symbol would be visible to functions ***defined*** in the let form.
<Iter> (and in fact would _not_ be visible to functions merely called)
<systems> yes excatly, so let in elisp, prevent a variable from being global by default
<Iter> nope. dosn't have anything to do with global or local.
<Iter> both are local. Just a question of what get's to see it.
<Iter> in fact in a very real sense, dynamic scope is more 'global' in its visibility.
<systems> what the let body gets to see
<Iter> There's a problem called variable capture, which is particularly nasty, and is avoided in lexical scope.
<Iter> dynamic scope is a rather unfortunate design flaw in elisp.
<systems> i dont know for sure, but in ocaml, you don't explicitly define parameters
<systems> right
<Iter> Again, I'm not sure I understand your question, and suspect you're mistaken :)
<systems> example, let x = 1 ;; let f = x + y ;;
<systems> f now is like a function who needs one param
<systems> but if we didnt define x ;;
<systems> f would be more like a functions hungry for 2 params
<Iter> that's going to run into trouble as y is free. y needs to be bound.
<systems> in elisp or c or c++, you never have this situation right
<systems> where a function definition depends on what was previouly defined
<Iter> let x = 1 ;; let f y = x + y ;; is fine, that is equiv to f y = 1 + y.
<systems> aaaa, right, i forgot that
<Iter> systems: except f isn't just a function. It's a closure over it's lexical environment.
Lemmih_ is now known as Lemmih
<systems> in ocaml, f is always a closure right..
<Iter> This is a very very powerful feature that gives you a huge boost in expressivity and power over languages like C or C++.
<Iter> yes.
cjohnson has joined #ocaml
<systems> yea, i like ocaml
<Iter> then again it is in common-lisp, scheme, erlang, haskell, clean, python, ruby, or sml as well :)
<systems> i dont think elisp got closures
<Iter> I don't know.
<Iter> That would be a very major lack.
<Iter> systems: How do you define a function that takes one number and returns a function that increments it's argument by that number?
<Iter> (map (adder 3) '(1 2 3)) -> (4 5 6), (map (adder 1) '(1 2 3)) -> (2 3 4)
<Iter> (sorry for the scheme, I'm reading EOPL, and my head is in scheme space atm ;)
<Iter> so happy with the difference between lexical and dynamic scopes?
<systems> brb sorry
<Iter> systems, are you a programmer, it-student, or non-programmer just wanting a better editor?
bk_ is now known as bk_bbl
bk_bbl is now known as bk_
gim has joined #ocaml
lam has quit ["leaving"]
lam has joined #ocaml
withersoever has quit ["Leaving"]
CosmicRay has joined #ocaml
fantod5 has joined #ocaml
mlh has quit [Client Quit]
Iter has quit [Read error: 110 (Connection timed out)]
fantod5 has quit ["Chatzilla 0.9.64b [Mozilla rv:1.7/20040707]"]
systems has quit [Remote closed the connection]
haelix has joined #ocaml
haelix has quit ["Changing server"]
alx_ has joined #ocaml
alx_ is now known as haelix
slashvar[ens] has quit [Read error: 54 (Connection reset by peer)]
grirgz has quit [Ping timeout: 14400 seconds]
monochrom has joined #ocaml
zigong_ has joined #ocaml
zigong_ has left #ocaml []
grirgz has joined #ocaml
cjohnson has quit [Read error: 104 (Connection reset by peer)]
cjohnson has joined #ocaml
gim has quit [Read error: 110 (Connection timed out)]
gim has joined #ocaml
vezenchio has joined #ocaml
grirgz_ has joined #ocaml
grirgz has quit [Read error: 104 (Connection reset by peer)]
* CosmicRay wonders where mr. van every will strike next :-)
<grirgz_> plop
grirgz_ is now known as grirgz
<CosmicRay> was that directed at me or van every? :-)
<Smerdyakov> CosmicRay, he is the Human Spam Machine.
<CosmicRay> heh
<CosmicRay> we can just call him HSM from now on
<Smerdyakov> Yeah, but that would clash with His Stupidness Mike.
<CosmicRay> as far as I can tell, the guy has never written a line of code
<CosmicRay> but he runs like 100 dead yahoo groups
<Smerdyakov> And at least one alcoholism club disguised as an ML user group
<CosmicRay> heh
<CosmicRay> that meets in some abandoned factory-turned-pub in seattle that still has its old factory sign on it?
<CosmicRay> yeah that sounds like a great place to talk about ocaml.
<CosmicRay> though I am pissed at whomever told him to go back to freeciv-dev
<CosmicRay> I host that list :-)
CosmicRay has quit ["Client exiting"]
Iter has joined #ocaml
m3ga has joined #ocaml
m3ga has quit ["Leaving"]
Iter has quit [Read error: 110 (Connection timed out)]
mlh has joined #ocaml