IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 2478


Ignore:
Timestamp:
Nov 24, 2004, 4:40:37 PM (22 years ago)
Author:
jhoblitt
Message:

?: example correction
change statement breaking rules

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/misc/perlCodeConventions.tex

    r2474 r2478  
    1 %%% $Id: perlCodeConventions.tex,v 1.36 2004-11-25 02:23:35 jhoblitt Exp $
     1%%% $Id: perlCodeConventions.tex,v 1.37 2004-11-25 02:40:37 jhoblitt Exp $
    22\documentclass[panstarrs]{panstarrs}
    33
     
    292292\item Prefer higher-level breaks to lower-level breaks.
    293293
    294 \item Align the new line with the beginning of the expression at the
    295 same level on the previous line\footnote{For emacs users, this means
    296 the indentation that \code{<tab>} generally produces}.
    297 
    298 \item If the above rules lead to confusing code or to code that's
    299 squished up against the right margin, just indent 8 spaces
    300 instead.\footnote{This should be \emph{very} rare! Consider whether
    301 you should be e.g. factoring code into a subroutine.}
     294\item Indent new lines 4 spaces deeper than the nesting depth of the line on
     295which the expression began.
     296
     297\item If it is convenient to list one statement per line (similar to a hash
     298declaration) place the closing parenthesis or brace on a new line.
    302299
    303300\end{itemize}
     
    307304\begin{verbatim}
    308305    someSub(longExpression1, longExpression2, longExpression3,
    309              longExpression4, longExpression5);
     306        longExpression4, longExpression5);
    310307     
    311     $var = someSub(longExpression1,
    312                      someSub(longExpression2,
    313                   longExpression3));
     308    $var = someSub(
     309        longExpression1,
     310        someSub(longExpression2, longExpression3)
     311    );
    314312\end{verbatim}
    315313
     
    333331
    334332    $alpha = (aLongBooleanExpression) ? $beta
    335                                      : $gamma; 
     333                                      : $gamma; 
    336334
    337335    $alpha = (aLongBooleanExpression)
    338             ? $beta
    339             : $gamma; 
     336           ? $beta
     337           : $gamma; 
    340338\end{verbatim}
    341339
Note: See TracChangeset for help on using the changeset viewer.