Re: Alternate indent proposal for python 3000

2008-04-22 Thread Lie
On Apr 21, 7:04 am, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > Off the top of my head: copy C and use {} to demarcate blocks and ';' to > end statements, so that '\n' is not needed and is just whitespace when > present. So, repeatedly scan for the next one of '{};'. try this: from __future__ impo

Re: Alternate indent proposal for python 3000

2008-04-21 Thread Dan Bishop
On Apr 21, 4:01 am, Paul Boddie <[EMAIL PROTECTED]> wrote: > On 21 Apr, 00:54, Dan Bishop <[EMAIL PROTECTED]> wrote: > > > > > We wouldn't even need that. Just a new source encoding. Then we > > could write: > > > # -*- coding: end-block -*- > > [...] > > Someone at EuroPython 2007 did a lightnin

Re: Alternate indent proposal for python 3000

2008-04-21 Thread Matthew Woodcraft
Terry Reedy <[EMAIL PROTECTED]> wrote: > Off the top of my head: copy C and use {} to demarcate blocks and ';' to > end statements, so that '\n' is not needed and is just whitespace when > present. So, repeatedly scan for the next one of '{};'. That would break if those characters appear in str

Re: Alternate indent proposal for python 3000

2008-04-21 Thread Paul Boddie
On 21 Apr, 00:54, Dan Bishop <[EMAIL PROTECTED]> wrote: > > We wouldn't even need that. Just a new source encoding. Then we > could write: > > # -*- coding: end-block -*- [...] Someone at EuroPython 2007 did a lightning talk showing working code which provided C-style block structuring using th

Re: Alternate indent proposal for python 3000

2008-04-20 Thread Terry Reedy
"Dan Bishop" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | We wouldn't even need that. Just a new source encoding. Then we | could write: | | # -*- coding: end-block -*- Ummm.. source encoding refers to how unicode chars/codepoints are represented as bytes. This syntax is cop

Re: Alternate indent proposal for python 3000

2008-04-20 Thread Terry Reedy
"Matthew Woodcraft" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Terry Reedy <[EMAIL PROTECTED]> wrote: | | > But you do not really need a variant. Just define a preprocessor | > function 'blockify' which converts code in an alternate syntax to | > regular indented block syntax.

Re: Alternate indent proposal for python 3000

2008-04-20 Thread George Sakkis
On Apr 20, 6:54 pm, Dan Bishop <[EMAIL PROTECTED]> wrote: > On Apr 20, 11:42 am, Matthew Woodcraft > > > > <[EMAIL PROTECTED]> wrote: > > Christian Heimes  <[EMAIL PROTECTED]> wrote: > > > >> I feel that including some optional means to block code would be a big > > >> step in getting wider adoptio

Re: Alternate indent proposal for python 3000

2008-04-20 Thread Dan Bishop
On Apr 20, 11:42 am, Matthew Woodcraft <[EMAIL PROTECTED]> wrote: > Christian Heimes <[EMAIL PROTECTED]> wrote: > > >> I feel that including some optional means to block code would be a big > >> step in getting wider adoption of the language in web development and > >> in general. I do understand

Re: Alternate indent proposal for python 3000

2008-04-20 Thread George Sakkis
On Apr 20, 12:34 pm, Eric Wertman <[EMAIL PROTECTED]> wrote: > > Look into any of the dozen Python-based template engines that are > > typically used for such tasks; they offer many more features than a > > way to indent blocks. > > > George > > I definitely will.. could you throw out some examples

Re: Alternate indent proposal for python 3000

2008-04-20 Thread [EMAIL PROTECTED]
On 20 avr, 17:35, Eric Wertman <[EMAIL PROTECTED]> wrote: > I was considering putting together a proposal for an alternate block > syntax for python, and I figured I'd post it here and see what the > general reactions are. I did some searching, and while I found a lot > of tab vs space debates, I

Re: Alternate indent proposal for python 3000

2008-04-20 Thread Eric Wertman
On Apr 20, 1:29 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Sun, 20 Apr 2008 13:42:05 -0300, Matthew Woodcraft <[EMAIL PROTECTED]> > escribió: > > > An alternative scheme for describing the block structure could be > > useful in other cases, though. For example, if you wanted to suppor

Re: Alternate indent proposal for python 3000

2008-04-20 Thread Matthew Woodcraft
Terry Reedy <[EMAIL PROTECTED]> wrote: > But you do not really need a variant. Just define a preprocessor > function 'blockify' which converts code in an alternate syntax to > regular indented block syntax. Then > > exec(blockify(alt_code_string)) You can do it like that, but if it were to beco

Re: Alternate indent proposal for python 3000

2008-04-20 Thread Gabriel Genellina
En Sun, 20 Apr 2008 13:42:05 -0300, Matthew Woodcraft <[EMAIL PROTECTED]> escribió: > An alternative scheme for describing the block structure could be > useful in other cases, though. For example, if you wanted to support > putting snippets of Python in configuration files, or spreadsheet > cell

Re: Alternate indent proposal for python 3000

2008-04-20 Thread Terry Reedy
"Matthew Woodcraft" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | There's no need to support the new scheme in .py files, so it seems to | me that this doesn't have to be done in the core language. All that's | needed is a variant of 'eval' which expects the alternate scheme, and

Re: Alternate indent proposal for python 3000

2008-04-20 Thread Matthew Woodcraft
Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > By 'eval', I guess you mean 'exec' :) Yes. Shows how often I use either. -M- -- http://mail.python.org/mailman/listinfo/python-list

Re: Alternate indent proposal for python 3000

2008-04-20 Thread Arnaud Delobelle
On Apr 20, 5:42 pm, Matthew Woodcraft <[EMAIL PROTECTED]> wrote: > Christian Heimes  <[EMAIL PROTECTED]> wrote: > > >> I feel that including some optional means to block code would be a big > >> step in getting wider adoption of the language in web development and > >> in general.  I do understand

Re: Alternate indent proposal for python 3000

2008-04-20 Thread Matthew Woodcraft
Christian Heimes <[EMAIL PROTECTED]> wrote: >> I feel that including some optional means to block code would be a big >> step in getting wider adoption of the language in web development and >> in general. I do understand though, that the current strict indenting >> is part of the core of the lan

Re: Alternate indent proposal for python 3000

2008-04-20 Thread Eric Wertman
> Look into any of the dozen Python-based template engines that are > typically used for such tasks; they offer many more features than a > way to indent blocks. > > George I definitely will.. could you throw out some examples though? Thanks! Eric -- http://mail.python.org/mailman/listinfo/pyth

Re: Alternate indent proposal for python 3000

2008-04-20 Thread George Sakkis
On Apr 20, 11:35 am, Eric Wertman <[EMAIL PROTECTED]> wrote: > I was considering putting together a proposal for an alternate block > syntax for python, and I figured I'd post it here and see what the > general reactions are.  I did some searching, and while I found a lot > of tab vs space debates

Re: Alternate indent proposal for python 3000

2008-04-20 Thread Christian Heimes
Eric Wertman schrieb: > I was considering putting together a proposal for an alternate block > syntax for python, and I figured I'd post it here and see what the > general reactions are. I did some searching, and while I found a lot > of tab vs space debates, I didn't see anything like what I'm th