The style guide has this to say about blank lines:

"5.8 Spaces

Don’t pollute your code with spaces at the end of lines and extraneous blank 
lines."

This comes out pretty strongly against "extraneous" blank lines. In writing the 
code below, though, it seems to me that the blank lines aid readability, and 
that the version without them (below) just looks scary. Opinions?

(To be fair, you really have to view the following in DrR, not in your e-mail 
program.)

First, with extraneous blank lines:

;; flag-teachpack-requires : syntax nat -> syntax
;; apply the 'stepper-skip-completely hint to all
;; teachpack requires.
;; -- it would be great to do this directly when the 
;; requires are added, but they're not yet syntax there,
;; and this seems like the easiest way to fix it.
(define (flag-teachpack-requires stx num-teachpacks)
  (syntax-case stx ()
    [(mod name lang bodies-stx ...)
     (begin
       
       (define bodies (syntax->list #'(bodies-stx ...)))
       
       (when (< (length bodies) num-teachpacks)
         (error 'flag-teachpack-requires
                "internal error: expected bodies to include teachpack requires, 
got: ~e"
                bodies))
       
       ;; these should be the teachpack requires:
       (define-values (teachpack-requires remaining-bodies)
         (split-at bodies num-requires))
       
       (unless (andmap require-form? teachpack-requires)
         (error 'flag-teachpack-requires
                "internal error: expected these to be teachpack requires: ~e"
                teachpack-requires))
       
       (define flagged-teachpack-requires
         (for/list ([tp-rq (in-list teachpack-requires)])
           (stepper-syntax-property stx 'stepper-ignore-completely #t)))
       
       #'(mod name lang
              #,@flagged-teachpack-requires
              #,@remaining-bodies))]))


Then, without them:

;; flag-teachpack-requires : syntax nat -> syntax
;; apply the 'stepper-skip-completely hint to all
;; teachpack requires.
;; -- it would be great to do this directly when the 
;; requires are added, but they're not yet syntax there,
;; and this seems like the easiest way to fix it.
(define (flag-teachpack-requires stx num-teachpacks)
  (syntax-case stx ()
    [(mod name lang bodies-stx ...)
     (begin       
       (define bodies (syntax->list #'(bodies-stx ...)))
       (when (< (length bodies) num-teachpacks)
         (error 'flag-teachpack-requires
                "internal error: expected bodies to include teachpack requires, 
got: ~e"
                bodies))
       ;; these should be the teachpack requires:
       (define-values (teachpack-requires remaining-bodies)
         (split-at bodies num-requires))
       (unless (andmap require-form? teachpack-requires)
         (error 'flag-teachpack-requires
                "internal error: expected these to be teachpack requires: ~e"
                teachpack-requires))
       (define flagged-teachpack-requires
         (for/list ([tp-rq (in-list teachpack-requires)])
           (stepper-syntax-property stx 'stepper-ignore-completely #t)))
       #'(mod name lang
              #,@flagged-teachpack-requires
              #,@remaining-bodies))]))

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_________________________
  Racket Developers list:
  http://lists.racket-lang.org/dev

Reply via email to