Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

INTERLISP question

65 views
Skip to first unread message

Nils Goesche

unread,
Aug 23, 2002, 3:22:35 PM8/23/02
to
Hi!

I am about to read an old paper: ``On compiling embedded languages in
LISP'' by Emanuelson and Haraldsson. Skimming it, the code looks
quite readable except for some strange brackets ([ and ]) here and
there. Looks like those are only a hack to avoid counting closing
parentheses, is that right?

Regards,
--
Nils Goesche
"Don't ask for whom the <CTRL-G> tolls."

PGP key ID 0x0655CFA0

Karsten Poeck

unread,
Aug 23, 2002, 3:52:59 PM8/23/02
to
As far as I remember ] close all open parens

Karsten
"Nils Goesche" <car...@cartan.de> wrote in message
news:lkelcpj...@pc022.bln.elmeg.de...

Simon Katz

unread,
Aug 23, 2002, 4:12:55 PM8/23/02
to

"Nils Goesche" <car...@cartan.de> wrote in message
news:lkelcpj...@pc022.bln.elmeg.de...
> Hi!
>
> I am about to read an old paper: ``On compiling embedded
> languages in
> LISP'' by Emanuelson and Haraldsson. Skimming it, the code
> looks
> quite readable except for some strange brackets ([ and ]) here
> and
> there. Looks like those are only a hack to avoid counting
> closing
> parentheses, is that right?

Yes.

IIRC, ] matches the previous [ and closes any intervening
('s. If there are no previous ['s, then ] closes all ('s.

Blake McBride

unread,
Aug 3, 2015, 7:30:42 AM8/3/15
to
Actually, it ("]") closes all open parenthesis up till the nearest "[". If no "[" was found, all of the open parens would be closed.

"[" acted like a single "(" but also acted like a marker for a subsequent "]".

IMO, just like ' and `, is was just syntactic sugar that made code easier to read and write. It was nice but is worse than useless if the editor (emacs) doesn't support it, because the editor gets totally confused. (Yes, I know emacs could easily be enhanced to support this.)

Just thought I would get this on the record.

Blake McBride

smh

unread,
Aug 11, 2015, 8:03:19 PM8/11/15
to
The answer have answered the original question well.

There remains the question why current implementations don't provide this functionality.

The first reason is that the ANS (2.1.4 Character Syntax Types) reserves the two square braces for use by user code. But of course user code or a user-enabled extension could define these reader macros, so that's not the important reason.

The real reason is that the mostly-MACLISP character assignments of CL date from a time before the era of powerful WYSIWYG editors, that can automatically handle indenting and bracket pairing. While usable Emacs interfaces certainly existed during the time of the X3J13 process, they hadn't yet overcome historical thinking.

So "smart" bracket closers are no longer very necessary or helpful.

Bill

unread,
Aug 11, 2015, 8:30:23 PM8/11/15
to
The editor at SAIL (E) had paren matching and lisp indentation by the
late 70's I think (for MACLSP users). I think there's a description
under "essential e" or maybe e.als[ip,doc] in the saildart archive?
0 new messages