<div>Despite "locals" being involved, 16884 is not a related issue. The problem in 16884 is with the delegate that's created for function a and the way that it's bound to the context in which the function was declared. And alas, 16884 is not fixed in beta 3.</div>
<div><br> </div>
<div class="gmail_quote">On Tue, Jun 24, 2008 at 12:41 AM, Jonathan Slenders <<a href="mailto:jonathan@slenders.be">jonathan@slenders.be</a>> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Does this mean that issue 16884 will be fixed as well in beta 3?
<div><br><br>
<div class="gmail_quote">2008/6/24 Dino Viehland <<a href="mailto:dinov@exchange.microsoft.com" target="_blank">dinov@exchange.microsoft.com</a>>:
<div>
<div></div>
<div class="Wj3C7c"><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">It seems to be fixed in beta 3. It's probably a bug in the interpreter as writing the snippet out and executing w/ execfile, which doesn't run under the interpreter, works in beta 2 as well.<br>
<br>The reason it got silently fixed was because between the two versions the interpreter was moved from M.S.Core.dll up to M.S.dll and a bunch of bugs were fixed along the way. In beta 3 the interpreter is also now always used for exec or eval - previously it avoided certain constructs it couldn't support.<br>
<div>
<div></div>
<div><br>-----Original Message-----<br>From: <a href="mailto:users-bounces@lists.ironpython.com" target="_blank">users-bounces@lists.ironpython.com</a> [mailto:<a href="mailto:users-bounces@lists.ironpython.com" target="_blank">users-bounces@lists.ironpython.com</a>] On Behalf Of Dan Eloff<br>
Sent: Monday, June 23, 2008 7:02 PM<br>To: Discussion of IronPython<br>Subject: [IronPython] NameError: locals() is not defined?<br><br>In IronPython b2 I get:<br><br>>>> s = '''<br>... def body(context):<br>
... def ccall():<br>... body = lambda: None<br>... context.update(locals())<br>... ccall()<br>...<br>... '''<br>>>> d = {}<br>>>> exec s in d<br>>>> c = {}<br>
>>> d['body'](c)<br>Traceback (most recent call last):<br> File "<stdin>", line 1, in <module><br> File "", line unknown, in Interpreted_body_1<br>NameError: name 'locals' is not defined<br>
<br>This works fine in CPython:<br><br>>>> s = '''<br>... def body(context):<br>... def ccall():<br>... body = lambda: None<br>... context.update(locals())<br>... ccall()<br>
...<br>... '''<br>>>> exec s in d<br>>>> c = {}<br>>>> d['body'](c)<br>>>> c<br>{'body': <function <lambda> at 0x0359CCB0>, 'context': {...}}<br>
<br>Any idea why?<br><br>Thanks,<br>-Dan<br>_______________________________________________<br>Users mailing list<br><a href="mailto:Users@lists.ironpython.com" target="_blank">Users@lists.ironpython.com</a><br><a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
_______________________________________________<br>Users mailing list<br><a href="mailto:Users@lists.ironpython.com" target="_blank">Users@lists.ironpython.com</a><br><a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
</div></div></blockquote></div></div></div><br></div><br>_______________________________________________<br>Users mailing list<br><a href="mailto:Users@lists.ironpython.com">Users@lists.ironpython.com</a><br><a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
<br></blockquote></div><br>