(patch for Bash) try-block and exception

William Park opengeometry at yahoo.ca
Mon Aug 2 03:29:12 EDT 2004


In <comp.unix.shell> Greg Ewing <greg at cosc.canterbury.ac.nz> wrote:
> William Park wrote:
> >     try 
> >       echo a
> >       raise 2
> >       echo b
> >     done in
> >       0) echo okey ;;
> >       1) echo raised 1 ;;
> >       2) echo raised 2 ;;
> >       *) echo really bad ;;
> >     esac
> 
> try...done...esac? What a delightfully eclectic combination
> of syntax. :-)
> 
> Why doesn't it end with 'yrt'?

'try-done' was chosen because it resembles while-loop where you would
break out of; and, '-in-esac' was chosen because it resembles case
statement.  Also, I didn't want to introduce too many new keywords.

-- 
William Park, Open Geometry Consulting, <opengeometry at yahoo.ca>
Toronto, Ontario, Canada



More information about the Python-list mailing list