while (a=b()) ...

Jim Meier fatjim at home.com
Sat May 15 23:24:53 EDT 1999


William Tanksley wrote:

> On Sat, 15 May 1999 18:41:26 GMT, Jim Meier wrote:
>
> >The subset of infinity that does not start with an underscore is exactly 50%.
> >(every item that does has a corresponding item that doesn't.)
> >1/2 of infinity is not a very good approximation, I'd say!
>
> I don't think so -- what the symbol which pairs with "_" or "__"?

??? I don't understand what you are saying here, but I'll explain what I mean more
clearly.

First of all, I was making a joke. Really. :)
If you have one thing, you can prepend a "_" to it. So for every element that
doesn't begin with "_" there is another that does.

> >> > Can we make "for" into "for each"?
>
> >> why not? (as long as you don't name the result
> >> Python, I don't mind ;-).  change "and" to "and
> >> then" and "or" to "or else" at the same time!
>
> >I vote for the Intercal convention of prefixing lines with "please", "do", or
> >"please do" for legibility.
>
> This is a good idea.  INTERCAL (please spell it right!) pioneered many
> facinating and usel^Hful concepts, such as "please", "COME FROM", and the
> swizzle and mingle operators.
>
> Python should certainly learn from INTERCAL.

Oh, I agree there are many lessons for Python to learn from INTERCAL. One of them
is that if Guido gets to speaking like it's 2 am and he's been to the pub, we
humour him but take away his CVS access for a couple hours. <Grin!>

INTERCAL's COME FROM statement always seemedl like it might have been a good idea.
How do you think it works without language labels? I'd call it exceptions..

BASIC + COME FROM (much simpler to do than INTERCAL!!!)
5 GOTO 100
10 PRINT "exceptions in basic!"
20 ERR=READ(FILE, RECORD(I)
30 IF ERR:
40 A=A: REM THIS IS THE EXCEPTION RAISING LINE
50 PRINT "continuing with real work.."

100 GOTO (file setup stuff)
110 GOTO 10
120 COME FROM 30
125 PRINT "File operation failed!!": GOTO 130
130 COME FROM 50
135 PRINT "File operation successful!"
130 ?"executed whether the file op succeeded or failed"

is similar to

f=get_the_file()
try:
    a(i)=f.read(1)
    print "File operation successful!"
except:
    print "File operation failed!!"
print "executed whether the file op succeeded or failed"



-Jim, who still expects his programming languages to turn "?" into "print"...





More information about the Python-list mailing list