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

GNU CLISP & SBCL not indenting

113 views
Skip to first unread message

Frederick Williams

unread,
Jul 3, 2012, 11:36:05 AM7/3/12
to
The in-built editors of GNU CLISP 2.49 and SBCL 1.0.55 for MS Windows do
not indent. I've not set something that needs setting, I suppose, but
what and how?
--
The animated figures stand
Adorning every public street
And seem to breathe in stone, or
Move their marble feet.

Zach Beane

unread,
Jul 3, 2012, 11:50:20 AM7/3/12
to
Frederick Williams <freddyw...@btinternet.com> writes:

> The in-built editors of GNU CLISP 2.49 and SBCL 1.0.55 for MS Windows do
> not indent. I've not set something that needs setting, I suppose, but
> what and how?

Neither SBCL nor CLISP includes an editor. If you are writing multiline
expressions in their REPLs, you should instead use an external
editor. Emacs is the most popular, and it's fairly straightfoward to
configure for Common Lisp editing.

Zach

Frederick Williams

unread,
Jul 3, 2012, 11:57:26 AM7/3/12
to
Thank you.

Antti J Ylikoski

unread,
Jul 3, 2012, 2:25:40 PM7/3/12
to
3.7.2012 18:57, Frederick Williams kirjoitti:
> Zach Beane wrote:
>>
>> Frederick Williams <freddyw...@btinternet.com> writes:
>>
>>> The in-built editors of GNU CLISP 2.49 and SBCL 1.0.55 for MS Windows do
>>> not indent. I've not set something that needs setting, I suppose, but
>>> what and how?
>>
>> Neither SBCL nor CLISP includes an editor. If you are writing multiline
>> expressions in their REPLs, you should instead use an external
>> editor. Emacs is the most popular, and it's fairly straightfoward to
>> configure for Common Lisp editing.
>
> Thank you.
>

Use the Emacs plus the SLIME. Find them in the Wikipedia or the Google,
the Bing, the Yahoo, et cetera ad nauseam.

Antti "Andy" Ylikoski
Helsinki, Finland, the E.U.


Pascal J. Bourguignon

unread,
Jul 3, 2012, 5:48:27 PM7/3/12
to
Frederick Williams <freddyw...@btinternet.com> writes:

> The in-built editors of GNU CLISP 2.49 and SBCL 1.0.55 for MS Windows do
> not indent. I've not set something that needs setting, I suppose, but
> what and how?

For clisp:

0- have emacs installed on MS-Windows.

ftp://ftp.gnu.org/pub/gnu/emacs/windows/

1- put:

(setf custom:*editor* "C:\\GNU\\emacs\\bin\\emacsclient")

in ~/.clisprc.lisp (adjust the pathname to where you installed emacs).

2- Launch emacs.

3- Launch clisp.

4- Type:


(defun f (x) (if (zerop x) 0 (* x (f (1- x))))) ; * a bug.
(f 42)
(ed 'f)

It should display:

Waiting for Emacs...

Edit the function in emacs (replace 0 by 1). Then type:

C-x #

And in clisp:

(f 42)


--
__Pascal Bourguignon__ http://www.informatimago.com/
A bad day in () is better than a good day in {}.

Frederick Williams

unread,
Jul 4, 2012, 7:32:13 AM7/4/12
to
I now have Emacs indenting nicely. I don't know what SLIME (in this
sense) is. Here's an indication of my ignorance: I'm not sure what
REPLs are is. Shocking, isn't it?

Frederick Williams

unread,
Jul 4, 2012, 11:49:46 AM7/4/12
to
"Pascal J. Bourguignon" wrote:
>
> Frederick Williams <freddyw...@btinternet.com> writes:
>
> > The in-built editors of GNU CLISP 2.49 and SBCL 1.0.55 for MS Windows do
> > not indent. I've not set something that needs setting, I suppose, but
> > what and how?
>
> For clisp:
>
> 0- have emacs installed on MS-Windows.
>
> ftp://ftp.gnu.org/pub/gnu/emacs/windows/
>
> 1- put:
>
> (setf custom:*editor* "C:\\GNU\\emacs\\bin\\emacsclient")
>
> in ~/.clisprc.lisp (adjust the pathname to where you installed emacs).

Windows XP won't let me create a file called .clisprc.lisp. It's the .
that it objects to, which is odd because I can see files with . at the
start of their names.

> 2- Launch emacs.
>
> 3- Launch clisp.
>
> 4- Type:
>
> (defun f (x) (if (zerop x) 0 (* x (f (1- x))))) ; * a bug.
> (f 42)
> (ed 'f)
>
> It should display:
>
> Waiting for Emacs...
>
> Edit the function in emacs (replace 0 by 1). Then type:
>
> C-x #
>
> And in clisp:
>
> (f 42)
>
> --
> __Pascal Bourguignon__ http://www.informatimago.com/
> A bad day in () is better than a good day in {}.


Pascal J. Bourguignon

unread,
Jul 4, 2012, 2:37:55 PM7/4/12
to
Frederick Williams <freddyw...@btinternet.com> writes:

> "Pascal J. Bourguignon" wrote:
>>
>> 1- put:
>>
>> (setf custom:*editor* "C:\\GNU\\emacs\\bin\\emacsclient")
>>
>> in ~/.clisprc.lisp (adjust the pathname to where you installed emacs).
>
> Windows XP won't let me create a file called .clisprc.lisp. It's the .
> that it objects to, which is odd because I can see files with . at the
> start of their names.

Yes. Microsoft software is weak. Use GNU software.

In clisp:

(with-open-file (rc #P"~/.clisprc.lisp"
:direction :output
:if-does-not-exist :create
:if-exists :append)
(print '(setf custom:*editor* "C:\\GNU\\emacs\\bin\\emacsclient") rc)
(terpri rc)
(truename rc))

Alberto Riva

unread,
Jul 4, 2012, 3:58:11 PM7/4/12
to
On 07/04/2012 07:32 AM, Frederick Williams wrote:
> Antti J Ylikoski wrote:
>>
>> 3.7.2012 18:57, Frederick Williams kirjoitti:
>>> Zach Beane wrote:
>>>>
>>>> Frederick Williams <freddyw...@btinternet.com> writes:
>>>>
>>>>> The in-built editors of GNU CLISP 2.49 and SBCL 1.0.55 for MS Windows do
>>>>> not indent. I've not set something that needs setting, I suppose, but
>>>>> what and how?
>>>>
>>>> Neither SBCL nor CLISP includes an editor. If you are writing multiline
>>>> expressions in their REPLs, you should instead use an external
>>>> editor. Emacs is the most popular, and it's fairly straightfoward to
>>>> configure for Common Lisp editing.
>>>
>>> Thank you.
>>>
>>
>> Use the Emacs plus the SLIME. Find them in the Wikipedia or the Google,
>> the Bing, the Yahoo, et cetera ad nauseam.
>
> I now have Emacs indenting nicely. I don't know what SLIME (in this
> sense) is.

SLIME is an emacs-lisp package that integrates a running Lisp session
within Emacs, giving you a very nice development environment. See

http://common-lisp.net/project/slime/

> Here's an indication of my ignorance: I'm not sure what REPLs are is.

REPL = Read-Eval-Print Loop. Also called the Lisp Listener. It's the
process that READs what you type in at the prompt, EVALuates it, PRINTs
out the result, and repeats forever.

> Shocking, isn't it?

Ignorance is not shocking, failure to learn is. We have more than a few
examples in this newsgroup... you don't seem to be one of them :) To
know for sure, try reading the first few chapters of PCL:

http://gigamonkeys.com/book/

and see if it lifts you out of your current state of ignorance :)

Alberto
0 new messages