[Tutor] Problems with genetically engineering the Print Ogre

Scot Stevenson scot@possum.in-berlin.de
Wed, 27 Feb 2002 23:25:32 +0100


Hello Remco, 

> Personally I think list comprehensions are beautiful. It helps if you
> are used to similar notation in math.

I sure it does - but that does somewhat confirm my suspicion that this is 
a construct added for a very specialized group of users =8). 

> So after the "print", the parser sees "to" as the next word. It has to
> decide whether that is a variable (actually, the start of an expression)
> or part of the print statement, and it can't.

Ah, that explains it - thank you!

Since I came into the discussion late - did anybody ever suggest using a 
format like 

    to <file> print <stuff>

or, as not to use up "to" as a word, 

    into <file> print <stuff>

instead? Shouldn't this let the parser elves figure things out quite 
nicely, since "into" would have to be followed by a file-like thingy every 
time, and the print part would stay the same as it was before people 
started trying to put things in files? 

I know that this is not quite as intuitive as the other way around - 
nobody says "into that bucket, put the apples", but on the other hand, 
nobody goes around saying "for every apple in the bucket, peel it" either, 
and we've gotten use to it...

Thanks again, 
Y, Scot