9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Paul Donnelly <paul-donnelly@sbcglobal.net>
To: 9fans@9fans.net
Subject: Re: [9fans] Acme without Flamage
Date: Fri, 22 Aug 2008 08:38:32 +0000	[thread overview]
Message-ID: <87tzddebf2.fsf@plap.localdomain> (raw)
In-Reply-To: <140e7ec30808212157pb7ecfaeyfebe8d754fa0c9b5@mail.gmail.com>

sqweek@gmail.com (sqweek) writes:

> On Thu, Aug 21, 2008 at 5:06 PM, Paul Donnelly
> <paul-donnelly@sbcglobal.net> wrote:
>> The bear is indentation, since to make it work out it's
>> necessary to use a fixed-width font (something I'd rather not do) and
>> adjust it by hand, which needs to happen more often and by greater
>> degrees than in a language like C. The chief issues being:
>>
>> (list (list 'a 'b 'c)
>>       (list 1 2 3))
>> ;     ^
>> ;     These need to line up.
>>
>> ;     These need to line up.
>> ;     V
>> (let ((a 3)
>>       (b 4))
>>   (+ a b))
>> ; ^
>> ; Should be two spaces or so.
>
>  Huh. I always thought lisp had a couple of simple indentation rules,
> but after spending a little time on fmtsexp.c it has become apparent
> that the "two spaces or so" is a special case for let! Not sure I care
> to try and deal with such cases, but maybe it is still somewhat
> useful: http://sqweek.dnsdojo.org/plan9/fmtsexp.c
> -sqweek

A fairly complete description of the rules is that forms line up with
other forms at the same level of nesting (the binding forms in the LET
or the arguments to LIST), but anything using &BODY FOO in its lambda
list (&BODY collects trailing arguments into FOO) gets two-space
indentation for the body. Indeed, this is the reason &BODY
exists. DEFMETHOD, though, needs to be specially recognized.  LOOP has
special needs. It's easier to indent with a program running in or
communing with your Lisp, since there's no other way to know, short of
reading every file in a project, whether a given macro uses &BODY or
not.



      reply	other threads:[~2008-08-22  8:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-20 15:12 Wendell xe
2008-08-20 15:38 ` Tom Lieber
2008-08-20 15:47 ` Robert Raschke
2008-08-20 17:14 ` sqweek
2008-08-20 17:42   ` David Leimbach
2008-08-20 19:23     ` Gorka Guardiola
2008-08-21  9:06       ` Paul Donnelly
2008-08-21 13:35         ` David Leimbach
2008-08-22  4:57         ` sqweek
2008-08-22  8:38           ` Paul Donnelly [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tzddebf2.fsf@plap.localdomain \
    --to=paul-donnelly@sbcglobal.net \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).