From: Nickolay Kolev
Subject: Starting with LISP on Mac OSX
Date: 
Message-ID: <20040404175829107+0200@news.rhrz.uni-bonn.de>
Hi all,

I am studying computational linguistics and have done my fair share of 
Prolog and Python programming. The sheer amount of learn-LISP-and-you-
will-get-it advice found at most artificial intelligence and logic sites 
has got me curious enough to try it.

I am working on a Mac running OSX and have found OpenMCL to be 
recommended at quite a few places as a good and FREE (important) LISP 
environment.

I have found some nice books describing LISP programming but not 
touching LISP *development* (writing a file with code in it, loading it 
in an interpreter and so on).

Could anyone perhaps point me to any resource describing how to get 
started on writing LISP? Most of the FAQs answered require writing in 
emacs (I write in vim and am most happy with it).

Many thanks in advance,
Nicky

From: Christophe Rhodes
Subject: Re: Starting with LISP on Mac OSX
Date: 
Message-ID: <sqd66naey1.fsf@lambda.dyndns.org>
Nickolay Kolev <·······@uni-bonn.de> writes:

> Could anyone perhaps point me to any resource describing how to get 
> started on writing LISP? Most of the FAQs answered require writing in 
> emacs (I write in vim and am most happy with it).

Sorry, you have already read about how to get started on writing Lisp
(note punctuation), but you have discounted it because it's advice you
don't like?  And yet you come to USENET for more advice?  Brilliant!

(Try to conquer your aversion of emacs; download the SLIME interactive
environment and OpenMCL, if FREE (important) is important to you;
maybe read
  http://www.cliki.net/SLIME-HOWTO
  http://ww.telent.net/lisp/according_to/slime.html
and links therefrom.)

Christophe
-- 
http://www-jcsu.jesus.cam.ac.uk/~csr21/       +44 1223 510 299/+44 7729 383 757
(set-pprint-dispatch 'number (lambda (s o) (declare (special b)) (format s b)))
(defvar b "~&Just another Lisp hacker~%")    (pprint #36rJesusCollegeCambridge)
From: Kenny Tilton
Subject: Re: Starting with LISP on Mac OSX
Date: 
Message-ID: <U%Wbc.2316$mX.1526723@twister.nyc.rr.com>
Christophe Rhodes wrote:
> Nickolay Kolev <·······@uni-bonn.de> writes:
> 
> 
>>Could anyone perhaps point me to any resource describing how to get 
>>started on writing LISP? Most of the FAQs answered require writing in 
>>emacs (I write in vim and am most happy with it).
> 
> 
> Sorry, you have already read about how to get started on writing Lisp
> (note punctuation),

correcting grammar (not punctuation) on usenet? tsk, tsk.

  but you have discounted it because it's advice you
> don't like?  And yet you come to USENET for more advice?  Brilliant!

yes, because someone (not you, it seems) will let him know how to use 
vim with Lisp.

To the OP, I have seen talk hear of a way to do vim+lisp, but, oh, OK, 
since you have received such rough treatment at the hands of Rhodes, a 
"vim lisp" google yields:

    http://www.lisp-p.org/htdocs/15-vim/

I cannot vouch for that or anything else actually, I use a not-FREE 
(unimportant) Lisp.

kt

-- 
Home? http://tilton-technology.com
Cells? http://www.common-lisp.net/project/cells/
Cello? http://www.common-lisp.net/project/cello/
Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film
Your Project Here! http://alu.cliki.net/Industry%20Application
From: Nickolay Kolev
Subject: Re: Starting with LISP on Mac OSX
Date: 
Message-ID: <20040404191452258+0200@news.rhrz.uni-bonn.de>
> Sorry, you have already read about how to get started on writing Lisp
> (note punctuation)

LISP -> Lisp

My mistake, and I would think a *spelling* one.

> but you have discounted it because it's advice you
> don't like?  And yet you come to USENET for more advice?  Brilliant!

I walk into a bookstore looking for a book on gardening. They do not 
have anything on gardening but lots of books on European flora. I go to 
another bookstore rather than buying the flora books that would not help 
me with my gardening at all. How dumb of me!

Nice start writing Lisp, I must admit!

Nicky
From: Kenny Tilton
Subject: Re: Starting with LISP on Mac OSX
Date: 
Message-ID: <QNXbc.2394$mX.1547314@twister.nyc.rr.com>
Nickolay Kolev wrote:

>>Sorry, you have already read about how to get started on writing Lisp
>>(note punctuation)
> 
> 
> LISP -> Lisp
> 
> My mistake, and I would think a *spelling* one.

Oh, /that/ is what Rhodes was correcting. I thought it was something 
else. Actually, this bit would be OK, but given the rest of what he 
wrote it does seem rather pissy.

> 
> 
>>but you have discounted it because it's advice you
>>don't like?  And yet you come to USENET for more advice?  Brilliant!
> 
> 
> I walk into a bookstore looking for a book on gardening. They do not 
> have anything on gardening but lots of books on European flora. I go to 
> another bookstore rather than buying the flora books that would not help 
> me with my gardening at all. How dumb of me!
> 
> Nice start writing Lisp, I must admit!

It gets better. [Note to NG, "keep Rhodes off welcoming committee".] 
Getting back to the /important/ stuff:

> I have found some nice books describing LISP programming but not 
> touching LISP *development* (writing a file with code in it, loading it 
> in an interpreter and so on).
> 

You've gotten a couple of links that might help. The big picture is that 
  historically Lisp has not had project-oriented IDEs like those of C++ 
and Java. Every developer just rolls their own, so it is not something 
one would tend to put in a book. And, yes, this is a barrier to entry 
for Lisp. Mind you, I had the same experience in a brief foray into Python.

The small picture is: defsystem, either mk::defsystem or asdf. These let 
  you edit all over the place and then recompile/reload everything with 
one command.

So every work session begins with an initial defsystem call to load 
everything (and compile if you quit last time without recompiling) and 
then you just edit-build-test. Of course you also get to skip the build 
step if you just change/compile one function.

Finally, you get to automate things even further to your own taste by 
writing functions that invoke defsystem, by putting stuff in an init 
file loaded by Lisp, by binding keys to functions that build the way you 
like, etc etc.



kt

-- 
Home? http://tilton-technology.com
Cells? http://www.common-lisp.net/project/cells/
Cello? http://www.common-lisp.net/project/cello/
Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film
Your Project Here! http://alu.cliki.net/Industry%20Application
From: Kenny Tilton
Subject: Re: Starting with LISP on Mac OSX
Date: 
Message-ID: <40705B60.3070904@nyc.rr.com>
OpenMCLers and Vimmers, please correct/enhance as needed all ensuing 
misinformation:

 >All I want to do is write a function that computes the factorial of a
 >given integer. And then actually see this function at work, try it with
 >a few different inputs and so on.
 >
 >Seems hard just getting off of the starting block.
 >

The latter was my experience, too, even with a commercial lisp (MCL on 
OS9). vendors such as Franz and Xanalys have recognized the problem
(Franz more so) and produced environments which are more welcoming, but
out there in the Land of Free Software you have some work to do.

For totally simple stuff like your current situation, well, this is
tough because I do not use OpenMCL. Do you at least get a Listener
prompt where you can type "(+ 2 2)"? If so:

1. use standlone vim to edit the factorial code in a file called
factorial.lisp. Save.
2. Go back to the omcl window. (load "factorial.lisp") (if you can
figure out where omcl looks for files by default, edit the file there.
or enter (load "machd::mystuff/lisp/factorial.lisp") after fixing the
pathname to a syntax omcl likes.
3 still at the mcl listener: (factorial 10) or whatever makes sense (I
am assuming here you accept the factorial to be calculated as a parameter).
4. go back to step 1.

If you get bored doing steps 2+3:

(defun test (n)
    (load "factorial.lisp")
    (factorial n))

Put that in factorial.lisp and then after the next time you do step 2
the test function will be there and you can collapse steps 2+3 into:

   (test 10)

At some point you will want to check out the vim+lisp link I posted and
learned how to just sit in vim working without jumping to the omcl window.

Finally, you said Free was important. Is that a financial or religious
thing? If financial, you might want to grab the $$free Lispworks trial
version to learn Lisp on OS X. That is a very nice environment, but the
editor is a weird one derived from CMUCL's Hemlock, so it may give you fits.

welcome to lisp. :)

kt

ps. later on you can learn what I meant by mk::defsystem and ASDF (two 
lisp packages meant to help with multi-file projects).



-- 
Home? http://tilton-technology.com
Cells? http://www.common-lisp.net/project/cells/
Cello? http://www.common-lisp.net/project/cello/
Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film
Your Project Here! http://alu.cliki.net/Industry%20Application
From: Nickolay Kolev
Subject: Re: Starting with LISP on Mac OSX
Date: 
Message-ID: <20040404211241495+0200@news.rhrz.uni-bonn.de>
Thanks a lot Kenny,

I was looking for a down to earth explanation exactly like this one.

Let's see how it goes.

Nicky
From: David Steuber
Subject: Re: Starting with LISP on Mac OSX
Date: 
Message-ID: <4ddd570c.0404041836.5acddde@posting.google.com>
Kenny Tilton <·······@nyc.rr.com> wrote in message news:<················@nyc.rr.com>...

> For totally simple stuff like your current situation, well, this is
> tough because I do not use OpenMCL. Do you at least get a Listener
> prompt where you can type "(+ 2 2)"? If so:

Does there exist a Lisp without a REPL?

$ openmcl 
Welcome to OpenMCL Version (Beta: Darwin) 0.14.1-p1!
? (+ 2 2)
4
? (defun factorial (n)
(if (= n 0)
1
(* n (factorial (1- n)))))
FACTORIAL
? (factorial 10)
3628800
? (factorial 100)
93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000
? (quit)

It is a bit of a nuisance to use the raw REPL in OpenMCL though.  At
least CLisp has readline.

Emacs + SLIME gives a better picture:

; SLIME 2004-04-02
CL-USER> (+ 2 2)
4
CL-USER> (defun factorial (n)
           (if (= n 0)
               1
               (* n (factorial (1- n)))))
FACTORIAL
CL-USER> (factorial 10)
3628800
CL-USER> (factorial 100)
93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000
CL-USER> 

That's using the REPL in slime.  I've found myself doing C-c C-e, C-c
C-k, etc from my
lisp code buffer rather than using the REPL.  It saves typing and I
still get the benefit of
quick tests.  SLIME also provides completions and shows me arguments
that functions
take.

I'm far from being productive yet.  However, I also faced a learning
curve for every other
new language and/or programming environment that I've tried.

So far as using Vim goes, someone did post a page with Vim macros and
some Perl code
to tie Vim to a Lisp listener to give many of the benefits of using
Emacs.  Some people
*really* like Vim.  I gotta admit that I do like the fact that it
requires fewer key chords.  I
think key chords are the one part about Emacs that I really hate.  I
suspect the solution
there is to figure out how to map the ctrl key to the caps lock key.
From: Kenny Tilton
Subject: Re: Starting with LISP on Mac OSX
Date: 
Message-ID: <Dx5cc.2718$mX.1794712@twister.nyc.rr.com>
David Steuber wrote:

> Kenny Tilton <·······@nyc.rr.com> wrote in message news:<················@nyc.rr.com>...
> 
> 
>>For totally simple stuff like your current situation, well, this is
>>tough because I do not use OpenMCL. Do you at least get a Listener
>>prompt where you can type "(+ 2 2)"? If so:
> 
> 
> Does there exist a Lisp without a REPL?

:) Point taken. But with this free (as in my time has no value) crap, I 
would not be at all surprised to read, "No command line yet, but you can 
download db-sockets and....").

kenny

-- 
Home? http://tilton-technology.com
Cells? http://www.common-lisp.net/project/cells/
Cello? http://www.common-lisp.net/project/cello/
Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film
Your Project Here! http://alu.cliki.net/Industry%20Application
From: Marc Spitzer
Subject: Re: Starting with LISP on Mac OSX
Date: 
Message-ID: <86vfke1m4s.fsf@bogomips.optonline.net>
Kenny Tilton <·······@nyc.rr.com> writes:

> David Steuber wrote:
>
>> Kenny Tilton <·······@nyc.rr.com> wrote in message news:<················@nyc.rr.com>...
>>
>>>For totally simple stuff like your current situation, well, this is
>>>tough because I do not use OpenMCL. Do you at least get a Listener
>>>prompt where you can type "(+ 2 2)"? If so:
>> Does there exist a Lisp without a REPL?
>
> :) Point taken. But with this free (as in my time has no value) crap,
> I would not be at all surprised to read, "No command line yet, but you
> can download db-sockets and....").

There may also be licensing issues, readline is gpled and I am not
sure what open mcl's license is.

The real choice is do you, end user, want to pay for some convenience
(commercial product) or spend time on a less polished product?  And
for each of us the answer is what it is.

marc
From: Luke Gorrie
Subject: Re: Starting with LISP on Mac OSX
Date: 
Message-ID: <lhy8pb0z5u.fsf@dodo.bluetail.com>
·····@david-steuber.com (David Steuber) writes:

> I think key chords are the one part about Emacs that I really hate.
> I suspect the solution there is to figure out how to map the ctrl
> key to the caps lock key.

Yes, that is a must. If you're running X you can use the program
'xkeycaps' to layout your keyboard how you want it via a GUI (it
generates a ".Xmodmap" file for you).

P.S. right-shift makes a great Hyper key. :-)

Cheers,
Luke
From: John Gallagher
Subject: Re: Starting with LISP on Mac OSX
Date: 
Message-ID: <989c2295.0404051340.4aa2618d@posting.google.com>
·····@david-steuber.com (David Steuber) wrote in message news:
>  I
> think key chords are the one part about Emacs that I really hate.  I
> suspect the solution
> there is to figure out how to map the ctrl key to the caps lock key.

If you're *not* using the X version of emacs, or if you want caps <->
ctrl in other OS X programs, check out uControl at
http://gnufoo.org/ucontrol/ucontrol.html. It lets you do that and
other fun stuff with the system keys.
From: =?utf-8?b?QmrDtnJuIExpbmRiZXJn?=
Subject: Re: Starting with LISP on Mac OSX
Date: 
Message-ID: <hcsy8paa8t2.fsf@fnatte.nada.kth.se>
·····@david-steuber.com (David Steuber) writes:

> I suspect the solution there is to figure out how to map the ctrl
> key to the caps lock key.

Yes. If you are running X, put the following in your ~/.Xmodmap:

  ! Make Caps Lock be Ctrl instead
  remove Lock      = Caps_Lock
  keysym Caps_Lock = Control_L
  add    Control   = Control_L

  ! This will make Ctrl-Alt-Backspace not kill the X server, so you can
  ! use backward-kill-sexp in Emacs.
  keycode 22       = BackSpace


Björn
From: David Steuber
Subject: Re: Starting with LISP on Mac OSX
Date: 
Message-ID: <4ddd570c.0404051556.200a1bda@posting.google.com>
·······@nada.kth.se (Björn Lindberg) wrote in message news:<···············@fnatte.nada.kth.se>...
> ·····@david-steuber.com (David Steuber) writes:
> 
> > I suspect the solution there is to figure out how to map the ctrl
> > key to the caps lock key.
> 
> Yes. If you are running X, put the following in your ~/.Xmodmap:
> 
>   ! Make Caps Lock be Ctrl instead
>   remove Lock      = Caps_Lock
>   keysym Caps_Lock = Control_L
>   add    Control   = Control_L
> 
>   ! This will make Ctrl-Alt-Backspace not kill the X server, so you can
>   ! use backward-kill-sexp in Emacs.
>   keycode 22       = BackSpace

My primary terminal is a PowerBook G4 running Carbon Emacs (built from
CVS).  However I will keep this in mind for my Debian boxes which I ssh into.
Would the ~/.Xmodmap file go in my home directory on the box I ssh
into or would it go on my Mac?  I do have the Apple X11 server installed.

Another solution I've considered is hunting for a different keyboard, either
USB or Bluetooth that has the CTRL key next to the A and other keys
appropriately located like on an old Data General Dasher D2000 terminal
I once used.

BTW, I am not a power Emacs user.  I know just enough to scrape by.
My Lisp development environment is the result of following cookbook
style recipees.
From: Jacek Generowicz
Subject: Re: Starting with LISP on Mac OSX
Date: 
Message-ID: <tyfu0zxy0oj.fsf@pcepsft001.cern.ch>
·····@david-steuber.com (David Steuber) writes:

> My primary terminal is a PowerBook G4 running Carbon Emacs

> Another solution I've considered is hunting for a different
> keyboard, either USB or Bluetooth that has the CTRL key next to the
> A

Are you aware of uControl ?
From: David Steuber
Subject: Re: Starting with LISP on Mac OSX
Date: 
Message-ID: <87wu4siaqb.fsf@david-steuber.com>
Jacek Generowicz <················@cern.ch> writes:

> ·····@david-steuber.com (David Steuber) writes:
> 
> > My primary terminal is a PowerBook G4 running Carbon Emacs
> 
> > Another solution I've considered is hunting for a different
> > keyboard, either USB or Bluetooth that has the CTRL key next to the
> > A
> 
> Are you aware of uControl ?

No.  Is that hardware or software?

-- 
It would not be too unfair to any language to refer to Java as a
stripped down Lisp or Smalltalk with a C syntax.
--- Ken Anderson
    http://openmap.bbn.com/~kanderso/performance/java/index.html
From: Jacek Generowicz
Subject: Re: Starting with LISP on Mac OSX
Date: 
Message-ID: <tyf7jwsxjwn.fsf@pcepsft001.cern.ch>
David Steuber <·····@david-steuber.com> writes:

> Jacek Generowicz <················@cern.ch> writes:
> 
> > ·····@david-steuber.com (David Steuber) writes:
> > 
> > > My primary terminal is a PowerBook G4 running Carbon Emacs
> > 
> > > Another solution I've considered is hunting for a different
> > > keyboard, either USB or Bluetooth that has the CTRL key next to the
> > > A
> > 
> > Are you aware of uControl ?
> 
> No.  Is that hardware or software?

Soft.

(Have you typed "uControl" into Google yet ? :-)
From: David Steuber
Subject: Re: Starting with LISP on Mac OSX
Date: 
Message-ID: <871xmz1hlr.fsf@david-steuber.com>
Jacek Generowicz <················@cern.ch> writes:

> (Have you typed "uControl" into Google yet ? :-)

I didn't have to.  Another poster replied with the URL to the thing.
That's what I get for not reading ALL followups before responding.

-- 
It would not be too unfair to any language to refer to Java as a
stripped down Lisp or Smalltalk with a C syntax.
--- Ken Anderson
    http://openmap.bbn.com/~kanderso/performance/java/index.html
From: David Steuber
Subject: Re: Starting with LISP on Mac OSX
Date: 
Message-ID: <4ddd570c.0404041740.7467a3e8@posting.google.com>
Christophe Rhodes <·····@cam.ac.uk> wrote in message news:<··············@lambda.dyndns.org>...

> (Try to conquer your aversion of emacs; download the SLIME interactive
> environment and OpenMCL, if FREE (important) is important to you;
> maybe read
>   http://www.cliki.net/SLIME-HOWTO
>   http://ww.telent.net/lisp/according_to/slime.html
> and links therefrom.)

This is really good advice.  I'm a Lisp noob myself and have been using
Emacs + SLIME + OpenMCL.  I find it to be a very good environment to
learn Lisp.  I also use Vim a lot and don't have too much trouble bouncing
between that and Emacs.

Setup of OpenMCL, Emacs, and SLIME is very easy.  I even setup my own
modest page on this very topic:

  http://www.david-steuber.com/~david/Lisp/OSX/

So far I have been quite happy with the results.
From: Edi Weitz
Subject: Re: Starting with LISP on Mac OSX
Date: 
Message-ID: <m31xn3zog1.fsf@bird.agharta.de>
On 4 Apr 2004 15:58:21 GMT, Nickolay Kolev <·······@uni-bonn.de> wrote:

> I am studying computational linguistics and have done my fair share
> of Prolog and Python programming. The sheer amount of
> learn-LISP-and-you- will-get-it advice found at most artificial
> intelligence and logic sites has got me curious enough to try it.
>
> I am working on a Mac running OSX and have found OpenMCL to be
> recommended at quite a few places as a good and FREE (important)
> LISP environment.
>
> I have found some nice books describing LISP programming but not
> touching LISP *development* (writing a file with code in it, loading
> it in an interpreter and so on).

Cough. Common Lisp programs are usually compiled into machine
code. It's a common misconception that Lisp is an interpreted language
like Perl or Python. As OpenMCL is derived from MCL I think it doesn't
even have an interpreter. (Someone correct me if I'm wrong.)

> Could anyone perhaps point me to any resource describing how to get
> started on writing LISP? Most of the FAQs answered require writing
> in emacs (I write in vim and am most happy with it).

Have you looked at <http://www.gigamonkeys.com/book/>?

Also, as you seem to be in Bonn, you might want to get in contact with
the Cologne Lispers - see <http://alu.cliki.net/Cologne>. It's very
helpful if you can ask experienced developers how they do things.

HTH,
Edi.