Re: Optional code segment delimiter?

2007-12-29 Thread Dan Bishop
On Dec 29, 12:41 pm, Matt Nordhoff <[EMAIL PROTECTED]> wrote:
> xkenneth wrote:
> > Is it possible to use optional delimiters other than tab and colons?
>
> > For example:
>
> >  if this==1 {
> >   print this
> >  }
>
> 
>
> Heheheh..

Wow!  I never thought of (ab)using encodings like that.  And sure
enough, it's perfectly legal to write:


# -*- encoding: rot-13 -*-

cevag h"Uryyb, jbeyq!"
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Optional code segment delimiter?

2007-12-29 Thread Matt Nordhoff
xkenneth wrote:
> Is it possible to use optional delimiters other than tab and colons?
> 
> For example:
> 
>  if this==1 {
>   print this
>  }



Heheheh..


-- 
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Optional code segment delimiter?

2007-12-29 Thread Jason
On Dec 29, 10:20 am, xkenneth <[EMAIL PROTECTED]> wrote:
> Is it possible to use optional delimiters other than tab and colons?
>
> For example:
>
>      if this==1 {
>           print this
>      }

Certainly, it's very possible.  Here's how to do it:
  1. Download the python source code (easy)
  2. Modify the parser as needed (hard)
  3. Re-apply your patches to each additional version of Python that
gets released (hard)

Alternatively:
  1. Write a script in regular Python/Perl/Ruby/Bash-script to convert
your code into real Python.  (Bonus: This may give you the write-
compile-run cycle that some C/C++ programmers desperately crave!)

Or, another alternative:
  1. Get used to using indention.
  2. Use a Python-aware editor to automatically add the proper number
of indenting spaces for you.
  3. If you feel the urge to use braces, write in Java until
thoroughly sick of them.  If you don't feel the bile rising in your
throat, it's too soon to come back to Python.

>
> And is there an alternate delimiter for statements other than the
> newline?
>
> print this;print that; #for example

>>> print "This" ; print "That"
This
That
>>>

That wasn't so hard, now was it?  Just remember that clarity beats
compactness any day.  The semicolon doesn't even save you any
keystrokes if you're using a Python-aware editor.  People who feel the
need to write a program on a single line will be rightfully mocked by
other Pythonistas.  How is:

print "This"; print "That"

better than:

print "This"
print "That"

I know which one is easier for me to read.

>
> I know I'll probably get yelled at for this question, but I would just
> like to know.
>
> Regards,
> Ken

No yelling, but a little snickering from some of us.

  --Jason
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Optional code segment delimiter?

2007-12-29 Thread Marc 'BlackJack' Rintsch
On Sat, 29 Dec 2007 09:20:00 -0800, xkenneth wrote:

> Is it possible to use optional delimiters other than tab and colons?

No.

> And is there an alternate delimiter for statements other than the
> newline?
> 
> print this;print that; #for example

Yes.

But both are reasons to yell at you.  ;-)

Ciao,
Marc 'BlackJack' Rintsch
-- 
http://mail.python.org/mailman/listinfo/python-list


Optional code segment delimiter?

2007-12-29 Thread xkenneth
Is it possible to use optional delimiters other than tab and colons?

For example:

 if this==1 {
  print this
 }

And is there an alternate delimiter for statements other than the
newline?

print this;print that; #for example


I know I'll probably get yelled at for this question, but I would just
like to know.

Regards,
Ken
-- 
http://mail.python.org/mailman/listinfo/python-list