Re: [unrev-II] Evaluation of Python

From: Eric Armstrong (
Date: Sat Mar 25 2000 - 17:18:40 PST

  • Next message: Eric Armstrong: "[unrev-II] Evaluation of Ruby"

    From: Eric Armstrong <>

    Markus Fleck wrote:

    > From: Markus Fleck <>
    > Eric Armstrong:
    > > --Any non-zero integer == true, like C
    > > (-) Ugh. Too many hours wasted on debugging to
    > > find that you coded a=b instead of a==b, like
    > > you intended. This one is a time-sink.
    > Hmmm... but Python expressions can't have such side effects (like C's
    > "if (a=b)"). I really wouldn't consider the zero==false paradigm a
    > misfeature...

    So you're saying that if a==2 and b==3, then the statement
        if (a=b)
    *won't* assign 3 to a and return true, but will instead return false?

    If so, I withdraw my objection and praise the developers.

    > > --No labeled break/continue
    > > (-) When you have nested loops, you need the
    > > ability to determine which one you are breaking
    > > or continuing.
    > I would argue that there might be better ways to structure control
    > flow than multi-level loop breaks.

    It comes up any time you are processing a multi-dimensional structure.
    It might be a table, for example, or a set of customer records
    a set of orders which contain a set of ordered items.
    For example:
        for row in table_rows
              for cell in row_cells
                     if (test1) go_to_next_row (continue inner loop)
                     if (test2) stop (break outer loop)

    For a two-dimensional structure, I can put the outer loop in an
    independent function, and finese the problem that way. But that
    requires an extra function that may not be needed for any other
    reason. More importantly, the solution doesn't scale to 3
    dimensions. You wind up having to pass back flags that tell the
    calling routine whether to continue or terminate.

    Is there some other solution I haven't seen?

    Get a NextCard Visa, in 30 seconds! Get rates as low as
    0.0% Intro or 9.9% Fixed APR and no hidden fees.
    Apply NOW!

    Community email addresses:
      Post message:
      List owner:

    Shortcut URL to this page:

    This archive was generated by hypermail 2b29 : Sat Mar 25 2000 - 17:25:48 PST