Environment: clisp 2.30 on RH 8.0
(1) Is there no equivalent to the "meta-bracket" (']')
in clisp?
(2) In clisp 2.30 running on RH 7.1 terminal mode input
show where the corresponding left parenthesis is
every time you enter a right parenthesis. Can this
be turned on and off?
(3) What is the cl equivalent to prettyprint ?
Thanks in advance
john slimick
·······@pitt.edu
·······@jcs.upb.pitt.edu (John Slimick) writes:
> Environment: clisp 2.30 on RH 8.0
>
> (1) Is there no equivalent to the "meta-bracket" (']')
> in clisp?
No. However, if you use Emacs for editing, you can use the balanced
editing commands insert-parentheses and move-past-close-and-reindent
so your parens are always balanced. Normally these are bound to M-(
and M-), but I bind them to [ and ], which is far more convenient (and
inspired by my having read about meta-brackets once).
--
/|_ .-----------------------.
,' .\ / | No to Imperialist war |
,--' _,' | Wage class war! |
/ / `-----------------------'
( -. |
| ) |
(`-. '--.)
`. )----'
·······@jcs.upb.pitt.edu (John Slimick) writes:
> (2) In clisp 2.30 running on RH 7.1 terminal mode input
> show where the corresponding left parenthesis is
> every time you enter a right parenthesis. Can this
> be turned on and off?
Adding the following line to your ~/.inputrc should do the trick:
set blink-matching-paren off
> (3) What is the cl equivalent to prettyprint ?
The PPRINT function should do what you want.
http://www.lispworks.com/reference/HyperSpec/Body/f_wr_pr.htm#pprint
[1]> *print-pretty*
T
[2]> (setq *print-pretty* nil)
NIL
[3]> (macroexpand '(with-input-from-string (stream "nil") (read stream)))
(LET ((STREAM (MAKE-STRING-INPUT-STREAM "nil"))) (DECLARE (SYSTEM::READ-ONLY STREAM)) (UNWIND-PROTECT (PROGN (READ STREAM)) (CLOSE STREAM))) ;
T
[4]> (pprint (macroexpand '(with-input-from-string (stream "nil") (read stream))))
(LET ((STREAM (MAKE-STRING-INPUT-STREAM "nil")))
(DECLARE (SYSTEM::READ-ONLY STREAM))
(UNWIND-PROTECT (PROGN (READ STREAM)) (CLOSE STREAM)))
I hope this helps!