Re: [IronPython] Using blocks separators instead of indentation

2007-08-13 Thread Joe Mason
On 8/13/07, Ori <[EMAIL PROTECTED]> wrote: > > > OK I got the point. I have to use several statements in a single line. > > For exmpale, something like: > i = 1; if (i >=1): i = 0 > > is there a way to do it? Is there a replacement to the newline char? Why does it have to be in a single line? Ju

Re: [IronPython] Dear Lazy Web - IronPython 2 Parser

2007-08-13 Thread Dino Viehland
PythonWalker and MS.Ast.Walker are actually different - PythonWalker walks the IronPython AST before its transformed to a DLR AST, and MS.Ast.Walker walks the DLR AST. You can certainly party on the Expression object all you want. But it'd be much easier (and less prone to break as we make cha

Re: [IronPython] Dear Lazy Web - IronPython 2 Parser

2007-08-13 Thread Michael Foord
Thanks for the reply Dino. Leaving some kind of API exposed to the Python parser would be appreciated, rather than making it private. What I would like to do in this case, is discover what variable names a Python expression uses. I know how to do this for a Python AST (name nodes that are the fi

Re: [IronPython] Using blocks separators instead of indentation

2007-08-13 Thread Thane Plummer
Ori, In my previous post I forgot to join the line with a semi-colon. The following is a legal -- albeit "unpythonic" -- single line that meets your requirement: >>> mycommand = "i = 1\nif i >= 1:\n\tprint 'Test passed'\nelse:\n\tprint 'test failed'"; exec(mycommand) Test passed >>> May the Pyth

Re: [IronPython] Using blocks separators instead of indentation

2007-08-13 Thread Thane Plummer
>>> mycommand = "i = 1\nif i >= 1:\n\tprint 'Test passed'\nelse:\n\tprint 'test failed'" >>> exec(mycommand) Test passed -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ori Sent: Monday, August 13, 2007 5:23 PM To: users@lists.ironpython.com Subject: Re: [

Re: [IronPython] Using blocks separators instead of indentation

2007-08-13 Thread Curt Hagenlocher
On 8/13/07, Ori <[EMAIL PROTECTED]> wrote: > > > Thanks but I did not ask if it is ugly or not. I just need it. > Is there a way to do it? In my email, I also gave two examples of legal Python code with more than one statement per line. In general, you can put any number of commands on the same

Re: [IronPython] Using blocks separators instead of indentation

2007-08-13 Thread Ori
Thanks but I did not ask if it is ugly or not. I just need it. Is there a way to do it? Curt Hagenlocher wrote: > > On 8/13/07, Ori <[EMAIL PROTECTED]> wrote: >> >> >> OK I got the point. I have to use several statements in a single line. >> >> For exmpale, something like: >> i = 1; if (i >=1):

Re: [IronPython] Using blocks separators instead of indentation

2007-08-13 Thread Curt Hagenlocher
On 8/13/07, Ori <[EMAIL PROTECTED]> wrote: > > > OK I got the point. I have to use several statements in a single line. > > For exmpale, something like: > i = 1; if (i >=1): i = 0 > > is there a way to do it? Is there a replacement to the newline char? This is legal Python: a = 1; b = 2 if a !=

Re: [IronPython] Using blocks separators instead of indentation

2007-08-13 Thread Ori
OK I got the point. I have to use several statements in a single line. For exmpale, something like: i = 1; if (i >=1): i = 0 is there a way to do it? Is there a replacement to the newline char? Thanks. Ori wrote: > > Hello, > > Is there a way to use code blocks (like { and } in other lang

Re: [IronPython] TypeError: integer expected occurs when __getitem__ is called

2007-08-13 Thread Dino Viehland
We actually have the right infrastructure in place to fix this fairly easily in v2.0. In v1.x our old-style instances were rather strange in that they were subclasses of our DynamicType class. Now they're (mostly - other than special cases here and there) just plain old new-style classes in v2

Re: [IronPython] array missing in IPY 2.0A3

2007-08-13 Thread Dino Viehland
Yes, I've just been slacking on porting it forward. Sorry about that. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Thane Plummer Sent: Saturday, August 11, 2007 3:04 PM To: 'Discussion of IronPython' Subject: [IronPython] array missing in IPY 2.0A3 Any plans on re-implementing

Re: [IronPython] Dear Lazy Web - IronPython 2 Parser

2007-08-13 Thread Dino Viehland
I don't know if you figured this out yet but here goes... Our Parser class is still public (I'm not sure if this will change or not) but you can do (IronPython.Compiler.)Parser.CreateParser. That takes a CompilerContext class which is going to point the parser at a SourceUnit that we are curre

Re: [IronPython] IronPython on Unix issues.

2007-08-13 Thread Dino Viehland
Thanks for the report Miguel, we'll get InitializeBuiltins fixed for the next release. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Miguel de Icaza Sent: Friday, August 10, 2007 3:56 PM To: Discussion of IronPython Subject: [IronPython] IronPython on U

Re: [IronPython] Using blocks separators instead of indentation

2007-08-13 Thread Dino Viehland
This is the extend part of embrace and extend everyone's expecting? :) I wouldn't be hold my breath waiting for this feature. (BTW, I use Shift-Tab/Tab to dedent/indent in VS). -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Matt Clinton Sent: Monday, A

Re: [IronPython] Using blocks separators instead of indentation

2007-08-13 Thread Mohammad Tayseer
You can use VB, or IronRuby or Managed JScript. But Python, no way!! Matt Clinton <[EMAIL PROTECTED]> wrote: Ori, I'm pretty sure there isn't - that's a basic 'feature' of Python itself: code blocks are defined by whitespace. (one of many bug-reduction syntax features) If you're working in

Re: [IronPython] Using blocks separators instead of indentation

2007-08-13 Thread Matt Clinton
Ori, I'm pretty sure there isn't - that's a basic 'feature' of Python itself: code blocks are defined by whitespace. (one of many bug-reduction syntax features) If you're working in VS, you'll often spend a little time highlighting a block of rows then pulling down Edit - Advanced - Increase/De