[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Your comment problem
- To: WHITE
- Subject: Your comment problem
- From: Achenbach
- Date: Mon, 06 Oct 1980 11:19:59 -7000
- Date: 6 Oct 1980 1119-PDT
Bill --
Here's Masinter's answer to the comment question. See if this
does any good.
******
Mail from PARC-MAXC rcvd at 6-Oct-80 1109-PDT
Date: 6 Oct 1980 10:55 PDT
From: Masinter at PARC-MAXC
Subject: Re: Is this how comments should work?
In-reply-to: Achenbach's message of 1 Oct 1980 1346-PDT
To: Achenbach at SUMEX-AIM, White at SUMEX-AIM
cc: masinter at MAXC2
Apparently, READCOMMENT checks explicitly for CLisp characters and the
paren characters, in order to avoid some situations where the form beginning
with the comment character is not really a comment. The simplest thing for you
to do, if you want to override this, is to redefine READCOMMENT.
_PF READCOMMENT
{from <LISP>ASSIST.;69}
(READCOMMENT
[LAMBDA (FL RDTBL LST) (* --)
(PROG (X START END NCHARS POS TEM FLG FL1 N)
[COND
((OR (NULL LST)
(CAR LST)
(EQ FL T)
(EQ NORMALCOMMENTSFLG T)
(NOT (RANDACCESSP FL))) (* --)
(RETURN (TCONC LST COMMENTFLG]
(SETQ FLG (ILESSP (SETQ N (POSITION FL))
26)) (* --)
(SETQ POS (GETFILEPTR FL))
(COND
([SELECTQ (SETQ TEM (RATOM FL RDTBL))
((%( %) %[ %] %" ' %. DECLARATIONS: E)
T)
(COND
((NUMBERP TEM)
T)
((EQ TEM COMMENTFLG)
NIL)
((AND CLISPFLG CLISPCHARRAY (STRPOSL CLISPCHARRAY TEM))
T)
(T (SELECTQ (PEEKC FL)
((%) %] _)
T)
NIL] (* --)
(GO NO)))
(SETFILEPTR FL (SETQ START (IPLUS POS -2)))
[COND
((EQ N 2) (* --)
(SETFILEPTR FL (SETQ START (IPLUS START -2] (* --)
[COND
((EQ (SKREAD FL)
(QUOTE %])) (* --)
(SETFILEPTR FL POS)
(RETURN (TCONC LST COMMENTFLG]
(SETQ NCHARS (IDIFFERENCE (SETQ END (GETFILEPTR FL))
START))
(SETFILEPTR FL (SUB1 END)) (* --)
(COND
([AND NORMALCOMMENTSFLG (OR (AND (BOUNDP
NORMALCOMMENTSFLG)
(OPENP (SETQ FL1 (EVALV NORMALCOMMENTSFLG))
(QUOTE OUTPUT)))
(OPENP (SETQ FL1 NORMALCOMMENTSFLG)
(QUOTE OUTPUT] (* --)
(SETQ TEM (GETFILEPTR FL1))
(COPYBYTES FL FL1 START END) (* --)
(SETFILEPTR FL (SUB1 END))
(SETQ START TEM)
(SETQ FL NORMALCOMMENTSFLG)))
[RETURN (LCONC LST (create COMMENTBOX
START _(CONS (IQUOTIENT START 1000)
(IREMAINDER START 1000))
NCHARS _ NCHARS
FLG _ FLG
FILE _(OR FL (INPUT]
NO (SETFILEPTR FL POS)
(RETURN (TCONC LST COMMENTFLG])
NIL
*****
/Mike
-------