From: zoav1602
Subject: function :use undefined when MCCLIMming
Date: 
Message-ID: <05a0cf48-fa09-4e78-9ab5-cf1044a71223@u18g2000pro.googlegroups.com>
Hello, group!
I try to write a small application using mcclim under sbcl. I use emacs
+slime to write lisp code.I define a custom package which contains my
mcclim code:
(depackage :my-package
 (:use :clim-user))
(in-package :my-package)

(define-application-frame my-frame () ....)

But when I compile it in emacs buffer (C-c C-k) I get error
"function :use undefined". If I change the beginning to
(cl:depackage :my-package
 (:use :clim-user))
(cl:in-package :my-package)
I get warnings "Undefined function run-frame-top-level, make-
application-frame"

The only way to make things work seems not to defina a new package and
do (in-package :clim-user) right at the beginning of the file...

From: Kenny
Subject: Re: function :use undefined when MCCLIMming
Date: 
Message-ID: <494ed816$0$4879$607ed4bc@cv.net>
zoav1602 wrote:
> Hello, group!
> I try to write a small application using mcclim under sbcl. I use emacs
> +slime to write lisp code.

When I go for short walks I first stand in two buckets and fill them 
with cement. As the cement hardens I lash my knees together with 5000-lb 
test climbing rope and finish it off with a self-tightening knot. I then 
knock off a pint of Jack Daniels to destroy my equilibrium and take some 
more rope and tighten it around my neck as best I can before heading out.

hth, kenny
From: John Thingstad
Subject: Re: function :use undefined when MCCLIMming
Date: 
Message-ID: <op.umi3ktq6ut4oq5@pandora.alfanett.no>
P� Sun, 21 Dec 2008 20:55:46 +0100, skrev zoav1602 <········@gmail.com>:

> Hello, group!
> I try to write a small application using mcclim under sbcl. I use emacs
> +slime to write lisp code.I define a custom package which contains my
> mcclim code:
> (depackage :my-package
>  (:use :clim-user))
> (in-package :my-package)
>
> (define-application-frame my-frame () ....)
>
> But when I compile it in emacs buffer (C-c C-k) I get error
> "function :use undefined". If I change the beginning to
> (cl:depackage :my-package
>  (:use :clim-user))
> (cl:in-package :my-package)
> I get warnings "Undefined function run-frame-top-level, make-
> application-frame"
>
> The only way to make things work seems not to defina a new package and
> do (in-package :clim-user) right at the beginning of the file...


there is no depackage. Try defpackage.. :)


--------------
John Thingstad
From: zoav1602
Subject: Re: function :use undefined when MCCLIMming
Date: 
Message-ID: <d6122996-3b29-4a26-8e46-17a57b695a62@w1g2000prk.googlegroups.com>
On 21 дек, 23:08, "John Thingstad" <·······@online.no> wrote:
> På Sun, 21 Dec 2008 20:55:46 +0100, skrev zoav1602 <········@gmail.com>:
>
>
>
> > Hello, group!
> > I try to write a small application using mcclim under sbcl. I use emacs
> > +slime to write lisp code.I define a custom package which contains my
> > mcclim code:
> > (depackage :my-package
> >  (:use :clim-user))
> > (in-package :my-package)
>
> > (define-application-frame my-frame () ....)
>
> > But when I compile it in emacs buffer (C-c C-k) I get error
> > "function :use undefined". If I change the beginning to
> > (cl:depackage :my-package
> >  (:use :clim-user))
> > (cl:in-package :my-package)
> > I get warnings "Undefined function run-frame-top-level, make-
> > application-frame"
>
> > The only way to make things work seems not to defina a new package and
> > do (in-package :clim-user) right at the beginning of the file...
>
> there is no depackage. Try defpackage.. :)
>
> --------------
> John Thingstad

Very funny!
Of course it was 'defpackage', otherwise the error would be 'undefined
function defpackage'! Just a typo in the post, not lisp source!
From: Rainer Joswig
Subject: Re: function :use undefined when MCCLIMming
Date: 
Message-ID: <joswig-3E3BF2.01152722122008@news-europe.giganews.com>
In article 
<····································@w1g2000prk.googlegroups.com>,
 zoav1602 <········@gmail.com> wrote:

> On 21 дек, 23:08, "John Thingstad" <·······@online.no> wrote:
> > P� Sun, 21 Dec 2008 20:55:46 +0100, skrev zoav1602 <········@gmail.com>:
> >
> >
> >
> > > Hello, group!
> > > I try to write a small application using mcclim under sbcl. I use emacs
> > > +slime to write lisp code.I define a custom package which contains my
> > > mcclim code:
> > > (depackage :my-package
> > >  (:use :clim-user))
> > > (in-package :my-package)
> >
> > > (define-application-frame my-frame () ....)
> >
> > > But when I compile it in emacs buffer (C-c C-k) I get error
> > > "function :use undefined". If I change the beginning to
> > > (cl:depackage :my-package
> > >  (:use :clim-user))
> > > (cl:in-package :my-package)
> > > I get warnings "Undefined function run-frame-top-level, make-
> > > application-frame"
> >
> > > The only way to make things work seems not to defina a new package and
> > > do (in-package :clim-user) right at the beginning of the file...
> >
> > there is no depackage. Try defpackage.. :)
> >
> > --------------
> > John Thingstad
> 
> Very funny!
> Of course it was 'defpackage', otherwise the error would be 'undefined
> function defpackage'! Just a typo in the post, not lisp source!


The problem is your DEFPACKAGE definition.

You are using CLIM-USER, but that is wrong. Can you see why?

Packages you can use are CLIM-LISP, CLIM and CLIM-SYS.

Typically a package uses CLIM-LISP and CLIM.

CLIM-LISP provides the base Lisp package
(similar to COMMON-LISP) and CLIM provides
the typical CLIM symbols.

-- 
http://lispm.dyndns.org/
From: zoav1602
Subject: Re: function :use undefined when MCCLIMming
Date: 
Message-ID: <826e707b-f440-4601-a7c8-9648b5c7635c@s9g2000prm.googlegroups.com>
On 22 äåê, 03:15, Rainer Joswig <······@lisp.de> wrote:
> In article
> <····································@w1g2000prk.googlegroups.com>,
>
>
>
>  zoav1602 <········@gmail.com> wrote:
> > On 21 äåê, 23:08, "John Thingstad" <·······@online.no> wrote:
> > > P Sun, 21 Dec 2008 20:55:46 +0100, skrev zoav1602 <········@gmail.com>:
>
> > > > Hello, group!
> > > > I try to write a small application using mcclim under sbcl. I use emacs
> > > > +slime to write lisp code.I define a custom package which contains my
> > > > mcclim code:
> > > > (depackage :my-package
> > > >  (:use :clim-user))
> > > > (in-package :my-package)
>
> > > > (define-application-frame my-frame () ....)
>
> > > > But when I compile it in emacs buffer (C-c C-k) I get error
> > > > "function :use undefined". If I change the beginning to
> > > > (cl:depackage :my-package
> > > >  (:use :clim-user))
> > > > (cl:in-package :my-package)
> > > > I get warnings "Undefined function run-frame-top-level, make-
> > > > application-frame"
>
> > > > The only way to make things work seems not to defina a new package and
> > > > do (in-package :clim-user) right at the beginning of the file...
>
> > > there is no depackage. Try defpackage.. :)
>
> > > --------------
> > > John Thingstad
>
> > Very funny!
> > Of course it was 'defpackage', otherwise the error would be 'undefined
> > function defpackage'! Just a typo in the post, not lisp source!
>
> The problem is your DEFPACKAGE definition.
>
> You are using CLIM-USER, but that is wrong. Can you see why?
I can say why I'm using it: I read to use it at http://kantz.com/jason/clim-primer/
Moreover, there are lines at packages.lisp (from mcclim-0.9.6 source)
(defpackage :clim-user
  (:use :clim :clim-lisp))

Do you want to say that :clim-user doesn't export something useful?
>
> Packages you can use are CLIM-LISP, CLIM and CLIM-SYS.
>
> Typically a package uses CLIM-LISP and CLIM.

Yes, this is what :clim-user says it uses.

>
> CLIM-LISP provides the base Lisp package
> (similar to COMMON-LISP) and CLIM provides
> the typical CLIM symbols.
>
> --http://lispm.dyndns.org/
From: Rainer Joswig
Subject: Re: function :use undefined when MCCLIMming
Date: 
Message-ID: <joswig-E9768A.10480022122008@news-europe.giganews.com>
In article 
<····································@s9g2000prm.googlegroups.com>,
 zoav1602 <········@gmail.com> wrote:

> On 22 ���, 03:15, Rainer Joswig <······@lisp.de> wrote:
> > In article
> > <····································@w1g2000prk.googlegroups.com>,
> >
> >
> >
> >  zoav1602 <········@gmail.com> wrote:
> > > On 21 ���, 23:08, "John Thingstad" <·······@online.no> wrote:
> > > > P Sun, 21 Dec 2008 20:55:46 +0100, skrev zoav1602 <········@gmail.com>:
> >
> > > > > Hello, group!
> > > > > I try to write a small application using mcclim under sbcl. I use emacs
> > > > > +slime to write lisp code.I define a custom package which contains my
> > > > > mcclim code:
> > > > > (depackage :my-package
> > > > >  (:use :clim-user))
> > > > > (in-package :my-package)
> >
> > > > > (define-application-frame my-frame () ....)
> >
> > > > > But when I compile it in emacs buffer (C-c C-k) I get error
> > > > > "function :use undefined". If I change the beginning to
> > > > > (cl:depackage :my-package
> > > > >  (:use :clim-user))
> > > > > (cl:in-package :my-package)
> > > > > I get warnings "Undefined function run-frame-top-level, make-
> > > > > application-frame"
> >
> > > > > The only way to make things work seems not to defina a new package and
> > > > > do (in-package :clim-user) right at the beginning of the file...
> >
> > > > there is no depackage. Try defpackage.. :)
> >
> > > > --------------
> > > > John Thingstad
> >
> > > Very funny!
> > > Of course it was 'defpackage', otherwise the error would be 'undefined
> > > function defpackage'! Just a typo in the post, not lisp source!
> >
> > The problem is your DEFPACKAGE definition.
> >
> > You are using CLIM-USER, but that is wrong. Can you see why?
> I can say why I'm using it: I read to use it at http://kantz.com/jason/clim-primer/
> Moreover, there are lines at packages.lisp (from mcclim-0.9.6 source)
> (defpackage :clim-user
>   (:use :clim :clim-lisp))
> 
> Do you want to say that :clim-user doesn't export something useful?

If a package uses symbols from other packages, that does not
mean that these are now external symbols in that package.

You can check what a package provides as external symbols.
DESCRIBE and/or INSPECT should give a clue.

You can also use:

(loop for symbol being each external-symbol of (find-package "CLIM-USER")
       collect symbol)

or something like that:

(do-external-symbols (symbol (find-package "CLIM-USER"))
  (print symbol))

This should give you a clue what the external symbols of that package are.


So, if you want your own package for CLIM programming use:


(defpackage :my-package
  (:use :clim :clim-lisp))






> >
> > Packages you can use are CLIM-LISP, CLIM and CLIM-SYS.
> >
> > Typically a package uses CLIM-LISP and CLIM.
> 
> Yes, this is what :clim-user says it uses.
> 
> >
> > CLIM-LISP provides the base Lisp package
> > (similar to COMMON-LISP) and CLIM provides
> > the typical CLIM symbols.
> >
> > --http://lispm.dyndns.org/

-- 
http://lispm.dyndns.org/
From: Thomas A. Russ
Subject: Re: function :use undefined when MCCLIMming
Date: 
Message-ID: <ymi8wq72669.fsf@blackcat.isi.edu>
zoav1602 <········@gmail.com> writes:

> On 22 ����, 03:15, Rainer Joswig <······@lisp.de> wrote:
> >
> > You are using CLIM-USER, but that is wrong. Can you see why?
> I can say why I'm using it: I read to use it at 
> http://kantz.com/jason/clim-primer/
> Moreover, there are lines at packages.lisp (from mcclim-0.9.6 source)
> (defpackage :clim-user
>   (:use :clim :clim-lisp))
> 
> Do you want to say that :clim-user doesn't export something useful?

Exactly.

I believe that you have the misconception that :USE with packages is
transitive.  It is NOT.

Careful reading of the Common Lisp specification will tell you that when
a package :USEs another package, then the EXTERNAL symbols of the
package being used become accessible as INTERNAL symbols of the using
package.

Since those symbols are internal symbols, if you build a chain and :USE
that new package, it won't pass on any of the symbols from packages it
uses itself.

The point of that is to allow a package to control what it exports.  It
can use another package internally to allow for easier implementation,
but not want to make those inherited symbols be part of the external
interface of its own.  So there is no further export.

Any such exporting would need to be done explicitly.

-- 
Thomas A. Russ,  USC/Information Sciences Institute