Re: [BangPypers] Does Python have lexical scoping?

2014-11-09 Thread Abhishek L
I'll try to explain a bit, have to admit though, even my understanding is not all that clear, and all is open for further discussion. Noufal Ibrahim KV writes: Okay, I've been struggling through the proglang course on coursera and this thing came up val x = 2; fun f y = x + y; The

Re: [BangPypers] Does Python have lexical scoping?

2014-11-09 Thread kracekumar ramaraju
On Sun, Nov 9, 2014 at 1:50 PM, Abhishek L abhishek.lekshma...@gmail.com wrote: I'll try to explain a bit, have to admit though, even my understanding is not all that clear, and all is open for further discussion. Noufal Ibrahim KV writes: Okay, I've been struggling through the proglang

Re: [BangPypers] Does Python have lexical scoping?

2014-11-09 Thread Noufal Ibrahim KV
On Sun, Nov 09 2014, Abhishek L wrote: [...] Here x was a mutable variable, doing a similiar ML construct, ie val x = ref 2 fun f y = !x + 2 f 10 ; evals to 12 x := 10 f 10 ; evals to 20 So this becomes a problem of closures over mutable variables? ie every

Re: [BangPypers] Does Python have lexical scoping? (Noufal Ibrahim KV)

2014-11-09 Thread Aditya Athalye
Ref: This mail thread: https://mail.python.org/pipermail/bangpypers/2014-November/010549.html Date: Sun, 09 Nov 2014 14:44:26 +0530 From: Noufal Ibrahim KV nou...@nibrahim.net.in Subject: Re: [BangPypers] Does Python have lexical scoping? Message-ID: 87y4rkpwgd@nibrahim.net.in

Re: [BangPypers] Does Python have lexical scoping?

2014-11-09 Thread Senthil Kumaran
On Sun, Nov 9, 2014 at 1:14 AM, Noufal Ibrahim KV nou...@nibrahim.net.in wrote: How is lexical scoping with a mutable environment different from dynamic scoping? I think you should post this in python-dev and you might get answers with rigorous definitions. Here is my short snippet which

Re: [BangPypers] Does Python have lexical scoping?

2014-11-09 Thread Abhishek L
Senthil Kumaran writes: On Sun, Nov 9, 2014 at 1:14 AM, Noufal Ibrahim KV nou...@nibrahim.net.in wrote: How is lexical scoping with a mutable environment different from dynamic scoping? I think you should post this in python-dev and you might get answers with rigorous definitions.

Re: [BangPypers] Does Python have lexical scoping?

2014-11-09 Thread Anand Chitipothu
On Sun, Nov 9, 2014 at 10:38 AM, Noufal Ibrahim KV nou...@nibrahim.net.in wrote: Okay, I've been struggling through the proglang course on coursera and this thing came up val x = 2; fun f y = x + y; The second line creates a function that adds `x` to it's argument. Since ML is

Re: [BangPypers] Does Python have lexical scoping?

2014-11-09 Thread Anand Chitipothu
On Mon, Nov 10, 2014 at 12:17 PM, Anand Chitipothu anandol...@gmail.com wrote: On Sun, Nov 9, 2014 at 10:38 AM, Noufal Ibrahim KV nou...@nibrahim.net.in wrote: Okay, I've been struggling through the proglang course on coursera and this thing came up val x = 2; fun f y = x + y;

[BangPypers] Does Python have lexical scoping?

2014-11-08 Thread Noufal Ibrahim KV
Okay, I've been struggling through the proglang course on coursera and this thing came up val x = 2; fun f y = x + y; The second line creates a function that adds `x` to it's argument. Since ML is statically scoped, this is really a function that adds 2 to its argument. Even if I later