From: Bruce Stephens
Subject: running the clx example hello.lisp in cmucl
Date: 
Message-ID: <87llse8esw.fsf@cenderis.demon.co.uk>
<rant>
Wow!  Doesn't the lisp community want new members?  This seems insanely
difficult---surely vastly more difficult than it needs to be.
</rant> (only a partial end rant)

I'm using debian unstable, and I was curious to see what CLIO (and the
related) graphics packages feel like to use in this day and age.  I
find Squeak intriquing (as an alternative to the almost universal tree
of widgets GUI design), but I want something that works in the normal
world of Unix filesystems and things, so Squeak itself isn't what I
want.  (I also don't much want to learn smalltalk, but that's not so
much an issue.)

So obvious choices seem to be Lisp-based.  This is the kind of thing
that lisp people would have done, and anyway, I like lisp (mostly I
hack around with emacs-lisp).  (Other choices seem to be OpenAmulet,
which appears to have been untouched for a couple of years which is
bad news for C++, and it doesn't build, and InterViews.)

So, "apt-get install cmucl-clx cmucl-source cl-clue".  And then I have
the problem of getting anything to run.

There's a file /usr/share/common-lisp/source/cmucl-clx/demo/hello.lisp
which looks like a perfect start.  It shows that clx is low-level, but
that's OK, I can work up to clue and clio.  But how do I get it to do
anything?

If I were packaging this kind of thing, I'd arrange at least one
script that (perhaps after editing pathnames, but a debian package
could give the right pathnames) would just work---it would require all
the necessary packages, import and export whatever's necessary, and
would evaluate the appropriate function.  Perhaps there is such a
thing, but I haven't found it.  hello.lisp is the closest I've found.

So,

    CMU Common Lisp CVS release-18e-branch + minimal debian patches, running on tinyWith core: /usr/lib/cmucl/lisp.core
    Dumped on: Wed, 2003-09-24 10:55:31+01:00 on tiny
    For support see http://www.cons.org/cmucl/support.html Send bug reports to the debian BTS.
    or to ········@debian.org
    type (help) for help, (quit) to exit, and (demo) to see the demos
     
    Loaded subsystems:
        Python 1.1, target Intel x86
        CLOS 18e (based on PCL September 16 92 PCL (f))
    * (load "hello")
     
    ; Loading #p"/usr/share/common-lisp/source/cmucl-clx/demo/hello.lisp".
    T
    * (hello-world "localhost")
    ;
     
    ; Warning: This function is undefined:
    ;   HELLO-WORLD
     
    Error in KERNEL:%COERCE-TO-FUNCTION:  the function HELLO-WORLD is undefined.
     
    Restarts:
      0: [ABORT] Return to Top-Level.
     
    Debug  (type H for help)
     
    (KERNEL:%COERCE-TO-FUNCTION HELLO-WORLD)
    Source:
    ; File: target:code/fdefinition.lisp
    (ERROR 'UNDEFINED-FUNCTION :NAME NAME)

That's bizarre.  Why put the hello-world function inside xlib?  Trying
to evaluate (xlib:hello-world "localhost") doesn't work, since
hello-world isn't exported.  Doing (use-package :xlib) doesn't seem to
help, although if I'm understanding things correctly, it ought to.

Anyway, all of this is doubtless due to my lack of understanding of
common lisp, or perhaps of the details of cmucl.  But really, I don't
think I should need that much knowledge to get a simple demo program
to run.  

From: Raymond Wiker
Subject: Re: running the clx example hello.lisp in cmucl
Date: 
Message-ID: <86vfrimfgy.fsf@raw.grenland.fast.no>
        Try 

(xlib::hello-world "localhost") 

or

(in-package :xlib)
(hello-world "localhost")

        These are just workarounds for the fact that hello-world is an
unexported symbol in the XLIB package. A proper fix would entail
moving the code to a different package (USER or COMMON-LISP-USER or
XLIB-DEMO or whatever) and exporting it.

-- 
Raymond Wiker                        Mail:  ·············@fast.no
Senior Software Engineer             Web:   http://www.fast.no/
Fast Search & Transfer ASA           Phone: +47 23 01 11 60
P.O. Box 1677 Vika                   Fax:   +47 35 54 87 99
NO-0120 Oslo, NORWAY                 Mob:   +47 48 01 11 60

Try FAST Search: http://alltheweb.com/
From: Bruce Stephens
Subject: Re: running the clx example hello.lisp in cmucl
Date: 
Message-ID: <87he328d0l.fsf@cenderis.demon.co.uk>
Raymond Wiker <·············@fast.no> writes:

>         Try 
>
> (xlib::hello-world "localhost") 
>
> or
>
> (in-package :xlib)
> (hello-world "localhost")
>
>         These are just workarounds for the fact that hello-world is an
> unexported symbol in the XLIB package. A proper fix would entail
> moving the code to a different package (USER or COMMON-LISP-USER or
> XLIB-DEMO or whatever) and exporting it.

Ha!  Success.  Thank you.

Here's what I needed to do:

(require :cmucl-clx)
(load "hello")
(xlib::hello-world "unix")

For some reason "localhost" didn't work.  That's not important,
however.  Similarly (require :xlib) didn't work, and nor did (require
:clx).

I'm not sure where I got xlib:hello-world from (with one colon rather
than two).  Possibly some emacs-lisp package.

Ah, and now that I read further, I see that Peter Van Eynde (the
packager) *has* set things up sanely.  Typing (demo) to lisp *does*
show working instructions for seeing the demos.  I don't know how I
missed that.
From: Alan S. Crowe
Subject: Re: running the clx example hello.lisp in cmucl
Date: 
Message-ID: <8665jfg4ph.fsf@cawtech.freeserve.co.uk>
Bruce Stephens found it hard to get started with CLX.

I've encountered similar problems. I'm learning CLX from the
CLX Programmer's Reference. The example, just-say-lisp, of a
simple menu which bedevils the user until he picks a nice
programming language, is daunting.

The Xlib programming manual, Volume One, also has an
example, basicwin.  It is daunting too.

As a reaction against these big examples programs I've
started writing a webpage of simple examples. I'm several
weeks away from starting a thread on comp.lang.lisp saying
please review my first draft. Since you are struggling with
hello.lisp today, I thought I should place the pre-drafts on
my website and you can see for yourself whether they are
useful yet.

The discussion of the examples is in:

http://www.cawtech.demon.co.uk/examples.txt

I've not webbed it yet. I was planning to write a simple
tool to web it for me.

There is also a tar file containing 9 little example
programs

http://www.cawtech.demon.co.uk/source.tar

It is only 21 kB so I didn't bother to compress it.

The idea is that you read examples.txt in one window, and look
at the source in a second window. A third window is a
running lisp, so you load and run the sources. Then you
maybe tinker with the source a little yourself. Load and
run. Move on to next example.

I'm using CMUCL. I haven't got round to building a core with
clx ready loaded, so I'm typing (require :clx) every time I
restart lisp. The 9 little examples shouldn't tread on each
others toes, so you should be able to load them and run them
one after another with out restarting Lisp.

Alan Crowe
(substitute (code-char 64) #\q (reverse "gro.eeeiqeworC.nalA"))
From: Daniel Barlow
Subject: Re: running the clx example hello.lisp in cmucl
Date: 
Message-ID: <874qyzvkbc.fsf@noetbook.telent.net>
····@cawtech.freeserve.co.uk (Alan S. Crowe) writes:

> As a reaction against these big examples programs I've
> started writing a webpage of simple examples. I'm several

This is cool stuff and should really help new users get started with
CLX.  You may want to add links to it on CLiki as well (e.g. on the
CLX and Tutorial page)


-dan

-- 

   http://www.cliki.net/ - Link farm for free CL-on-Unix resources 
From: Kenny Tilton
Subject: Re: running the clx example hello.lisp in cmucl
Date: 
Message-ID: <Q9Ycb.45867$u67.23181@twister.nyc.rr.com>
Alan S. Crowe wrote:

> Bruce Stephens found it hard to get started with CLX.
> 
> I've encountered similar problems. I'm learning CLX from the
> CLX Programmer's Reference. The example, just-say-lisp, of a
> simple menu which bedevils the user until he picks a nice
> programming language, is daunting.
> 
> The Xlib programming manual, Volume One, also has an
> example, basicwin.  It is daunting too.
> 
> As a reaction against these big examples programs I've
> started writing a webpage of simple examples. I'm several
> weeks away from starting a thread on comp.lang.lisp saying
> please review my first draft. Since you are struggling with
> hello.lisp today, I thought I should place the pre-drafts on
> my website and you can see for yourself whether they are
> useful yet.
> 
> The discussion of the examples is in:
> 
> http://www.cawtech.demon.co.uk/examples.txt

This is great. Thx. More! <g>

kenny
From: Burton Samograd
Subject: Re: running the clx example hello.lisp in cmucl
Date: 
Message-ID: <87brt7v3if.fsf@kruhft.vc.shawcable.net>
····@cawtech.freeserve.co.uk (Alan S. Crowe) writes:
> I'm using CMUCL. I haven't got round to building a core with
> clx ready loaded, so I'm typing (require :clx) every time I
> restart lisp. The 9 little examples shouldn't tread on each
> others toes, so you should be able to load them and run them
> one after another with out restarting Lisp.

Here's an example of generating and using your own custom cores (in
case you just haven't gotten to that section of the manual).

To save the new core:

* (require 'clx)
* (save-lisp "/home/yourname/lisp.core")

To load it:

lisp -core /home/yourname/lisp.core

Voila.

-- 
burton samograd
······@hotmail.com
http://kruhftwerk.dyndns.org