Menu

#3472 Documentation of [expr]: fix all braceless examples

obsolete: 8.5a4
closed-fixed
5
2006-08-09
2006-07-21
No

Fix all examples for expr that idly do not use
braces, by enclosing the arguments in a pair of
braces.

For those examples that only work unbraced
(e.g. subexpression or operator in variable)
combine braced parts with unbraced parts, and
mention their exceptional nature.

Make it absolutely clear that one should
always think "braces" first. Make it clear
that passing unknown arguments to expr outside
of braces is just as dangerous as passing them
to eval.

Discussion

  • Andreas Leitgeb

    Andreas Leitgeb - 2006-07-21
    • assigned_to: nobody --> tallniel
     
  • Andreas Leitgeb

    Andreas Leitgeb - 2006-07-21

    Logged In: YES
    user_id=830354

    PS:

    "documentation" primarily means
    man-pages, help-pages, what is shipped
    with tcl-core. Of course it can be widened
    to any bit of documentation that is within
    any maintainer's reach, but that's probably
    too much for one bug-report :-)

     
  • Neil Madden

    Neil Madden - 2006-07-22

    Logged In: YES
    user_id=102050

    I've fixed the tutorial so that all uses of expr/if/etc are
    properly braced, and added a warning box to the expr page
    explaining why you should always brace expressions. There
    are a couple of places in the tutorial that specifically
    show what happens when you don't brace expressions, so I
    have left those as they are.

    I only have responsibility for the tutorial, so I am
    reassigning this bug to dkf in case he wishes to check the
    man-pages too. :)

     
  • Neil Madden

    Neil Madden - 2006-07-22
    • labels: --> 75. Tutorial
    • assigned_to: tallniel --> dkf
     
  • Donal K. Fellows

    • milestone: 577912 --> obsolete: 8.5a4
     
  • Donal K. Fellows

    Logged In: YES
    user_id=79902

    Fixed in core for 8.5; not high-enough prio to be worth
    backporting.

     
  • Donal K. Fellows

    • status: open --> closed-fixed
     
  • Andreas Leitgeb

    Andreas Leitgeb - 2006-08-09

    Logged In: YES
    user_id=830354

    Fetched new version on Aug 9th: doc/expr.n still
    contained some braceless examples (while some
    others have indeed been bracified).

    e.g:
    line 33: \fBexpr 8.2 + 6\fR
    line 111-114: formatting changed but no braces added.

    in line 321 (an example explicitly without braces)
    there should be a warning nearby, explaining
    that this would be dangerous if "b" comes from
    untrusted sources.

    And this is just about expr.n, yet.

     
  • Andreas Leitgeb

    Andreas Leitgeb - 2006-08-09
    • status: closed-fixed --> open-remind
     
  • Donal K. Fellows

    Logged In: YES
    user_id=79902

    That particular instance was deliberately left alone. The
    [expr] manual page contains numerous mentions of the fact
    that expressions should be in braces, but it is also
    necessary to mention the fact *there* that
    braces-round-everything isn't the only way.

    I will not change things further. Do not reopen this bug.

     
  • Donal K. Fellows

    • status: open-remind --> closed-fixed