On Sun, 1 Apr 2001, James Morris wrote: > Looks like the Perl vs. Python issue that has plagued mankind for > centuries will soon be resolved :-) [snip] > Perl and Python to begin joint development There is an interview at http://www.perl.com/pub/2001/04/01/parrot.htm which I am sure lots have already peeked at. The best bit was the example code! Show us some Parrot code. GvR: Obviously there aren't any full-size Parrot programs available at the moment, just pieces of example code. This is an example written by Tim Peters: # copy stdin to stdout, except for lines starting with # while left_angle_right_angle: if dollar_underscore[0] =eq= "#": continue_next; } print dollar_underscore; } LW: I think this shows exactly what we were trying to achieve: it's immediately obvious to both Perl and Python programmers what that does. We've got a great compromise between Perl's brace-structured blocks and Python's white-space blocks; we've merged the names of language keywords in an elegant way; we've kept the idea of Perl's shortcut variables, but we've combined that with Python's readability. GvR: Of course, this is just one way you could write that program. There's more than one way to do it, right, Larry? LW: Sure. I'd probably write the program something like this: while(@line = Sys::Stdin->readline()): continue_next if $line[0] =eq= "#": print @line; } -- SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/ More Info: http://slug.org.au/lists/listinfo/slug
