Optional code segment delimiter?

X

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
 
M

Marc 'BlackJack' Rintsch

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
 
J

Jason

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 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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top