Arc Forumnew | comments | leaders | submitlogin
1 point by almkglor 5892 days ago | link | parent

  (let expander 
       (fn (f var name body)
         `(let ,var (,f ,name)
            (after (do ,@body) (close ,var))))
Unindented here. Is the above given its own division? But it wouldn't make much sense to group this by itself, since it's used privately by other functions.

    (mac w/infile (var name . body)
      " Opens the given file `name' for input, assigning the stream to `var'.
        The stream is automatically closed on exit from the `body'.
        See also [[w/outfile]] [[w/instring]] [[w/stdin]] [[w/socket]] "
      (expander 'infile var name body))
Again, unindented at this point. However, it shares some code with other functions after it.

    (mac w/outfile (var name . body)
      " Opens the given file `name' for output, assigning the stream to `var'.
        The stream is automatically closed on exit from the `body'.
        See also [[w/infile]] [[w/appendfile]] [[w/outstring]] [[w/stdout]] "
      (expander 'outfile var name body))
... etc.

Of course, we could just define a definition as being divided by unindented non-empty lines ^^.



1 point by akkartik 5891 days ago | link

Jeez, but of course :)

While we're nitpicking, a set of unindented lines should get grouped together as well. No point having a bunch of single-line separators.

And if using indentation seems too hackish, just balance parens, curlies, etc. And separate by lines containing level-1 brackets. Almost as easy to do, and just as language-agnostic.

-----