Python complaints

Jan Vroonhof vroonhof at frege.math.ethz.ch
Sun Nov 28 09:37:04 EST 1999


Michael Hudson <mwh21 at cam.ac.uk> writes:

> This leads to a thought: would it be possible using lisp's silly
> amount of flexibility to get the reader to auto-paranthesize (word?
> doubt it):

It must be in the air or something ;-) I had the same though a while a
ago. I even have got a name LISI (Lot's of Significant Indentation)

The rules could be extremely simple.
1. each new indentation level
introduces another pair of parenthesis
2. Each new line is wrapped in parenthesis

Then you get things like

defun count-words-region (start end &optional buffer)
  interactive "_r"
  save-excursion
    set-buffer (or buffer (current-buffer))
    let
        words 0
      goto-char start
      while (< (point) end)
        when (forward-word 1)
          incf words
      when  (interactive-p) 
        message "Region has %d words" words
      identity words

That last line is ugly because in this way it is very difficult to
distinguish between a no-argument function call and a variable
reference.

Sometimes however I think it would be more fashionable to replace all
parenthesis by angle brackets and re-brand Lisp as LIML.

Jan







More information about the Python-list mailing list