>>>>> "BCW" == Bryan C Warnock <[EMAIL PROTECTED]> writes:

  BCW> Keywords
  BCW>     continue, do, else, elsif, for, foreach, given, goto, grep, if, last,
  BCW>     map, next, redo, sort, sub, unless, until, when, while 

  BCW> Basic Constructs

  BCW>  1. [ LABEL: ] expr;
  BCW>  2. [ LABEL: ] { block } [ continue { block } ]
  BCW>  3. << grep | map >> { block } list                    # Note 1
  BCW>  4. sort [ { block } ] list                            # Note 1
  BCW>  5. do { block }                                       # Note 1

i don't consider sort/map/grep blocks to be basic like the others. also
sort/map can take espressions which is a different syntax.

what about eval BLOCK? i think that is being renamed to throw/catch but
it takes a code block too.

  BCW> Conditional Statement Modifiers

  BCW>  6. [ LABEL: ] expr if expr;
  BCW>  7. [ LABEL: ] expr until expr;
                           ^^^^^
unless

  BCW> Looping Statement Modifiers

  BCW>  8. [ LABEL: ] expr while expr;
  BCW>  9. [ LABEL: ] do { block } while expr;                # Note 2

i see the note, but that is not special. just a simple expression with a
modifier. now, if the do BLOCK while() were to support loop semantics,
it would be special here.

  BCW> 10. [ LABEL: ] expr until expr;
  BCW> 11. [ LABEL: ] do { block } until expr;                # Note 3


  BCW> Iterative Statement Modifiers

  BCW> 12. [ LABEL: ] expr for[each] list;                    # Note 4


  BCW> Conditional Block Constructs

  BCW> 13. [ LABEL: ] if ( expr ) { block } 
  BCW>                [ [ elsif  ( expr ) { block } ] ... ]
  BCW>                [ else  { block } ]
  BCW> 14. [ LABEL: ] until ( expr ) { block }
                      ^^^^^

unless (again :-)



  BCW> A statement consists of zero or more expressions, followed by an
  BCW> optional modifier and its expression, and either a statement
  BCW> terminator (';') or a block closure ('}' or EOF).

how do you have multiple expressions in a statement? when you combine
expressions you just get one larger expression. 

also perl has statement separators, not terminators. with that
definition you don't need to mention block close or EOF.

  BCW> A block consists of zero or more blocks and statements. A file is
  BCW> considered a block, delimited by the file boundaries.
  BCW> Semantically, I will define a block only in terms of its affect
  BCW> on scoping.  (Blocks are sometimes referenced by their
  BCW> interaction with flow control.  However, this definition isn't
  BCW> consistent, and I will avoid it.)

a good definition of a BLOCK and its scoping and loop semantics is
needed. the do BLOCK while() controversy is one are that needs clearing
up. 

  BCW> Flow Control Expressions

  BCW> A. goto 
  BCW> B. 

B. was intentionally left blank.

  BCW> last
  BCW> next
  BCW> redo


overall a good idea and thankfully written in english and not
ANSI-speak. a more proper (but not official sanctioned by some
organization) perl specification will be useful. i doubt there will be
multiple implementations like you get with many other languages that
have specs, but it will make it easier to create tests suites, fix bugs,
etc. when we get to exposing various API's it will be very useful to
have clean spec and a document style/format for them (like the PDD).

uri

-- 
Uri Guttman  ---------  [EMAIL PROTECTED]  ----------  http://www.sysarch.com
SYStems ARCHitecture and Stem Development ------ http://www.stemsystems.com
Search or Offer Perl Jobs  --------------------------  http://jobs.perl.org

Reply via email to