Menu

#2996 foreach.n: bad distance "32"

obsolete: 8.5a2
closed-fixed
5
2004-12-07
2004-12-04
WildCard
No

Attached patch removes the .ta macro (uses em spaces
for tab, only inches and centimetres are supported by
man2html2 and man2help2).

Moved the comments in the code example to whole lines
as per style guide (.ta macro now no longer needed).

Discussion

  • WildCard

    WildCard - 2004-12-04

    moves comments in code example

     
  • Donal K. Fellows

    • status: open --> closed-rejected
     
  • Donal K. Fellows

    Logged In: YES
    user_id=79902

    This makes the example less clear. If it bugs you, submit a
    patch to fix man2* (perhaps by ignoring it?) instead.

     
  • WildCard

    WildCard - 2004-12-06

    Logged In: YES
    user_id=596509

    Another couple of possibilities that don't cause errors
    with the existing doc converters.

    change ".ta 32" to ".ta 3i" or ".ta 4i"

    or
    add blank lines before comments in patch to get (code is a
    lot clearer than in patch)

    .CS
    # Odd numbers first, for fun!
    set values {1 3 5 7 2 4 6 8}

    # Neat-looking header
    puts "Value\\tSquare\\tCube"

    # Now loop and print...
    \fBforeach\fR x $values {
    puts " $x\\t [expr {$x**2}]\\t [expr {$x**3}]"
    }
    .CE

    or
    use the style guide recommendation of blank lines before
    and after comments [6.2](missed that in the guide the
    first time as the first example with comments doesn't have
    blank lines [5.2])

    .CS
    # Odd numbers first, for fun!

    set values {1 3 5 7 2 4 6 8}

    # Neat-looking header

    puts "Value\\tSquare\\tCube"

    # Now loop and print...

    \fBforeach\fR x $values {
    puts " $x\\t [expr {$x**2}]\\t [expr {$x**3}]"
    }
    .CE

    or
    if none of these are acceptable I'll submit a patch for
    man2* to calculate em spaces for tabs :)

     
  • WildCard

    WildCard - 2004-12-06
    • status: closed-rejected --> open
     
  • Donal K. Fellows

    Logged In: YES
    user_id=79902

    Hmm, 3i gives about the right effect. Changed to that.

    (FWIW, the style guide is good for production code, but
    would not produce good code for a short example on a manual
    page because the comments would end up dominating everything
    else.)

     
  • Donal K. Fellows

    • status: open --> closed-fixed
     
MongoDB Logo MongoDB