From: Darmac
Subject: Question about packages (and more)
Date: 
Message-ID: <1112294815.395355.149760@z14g2000cwz.googlegroups.com>
I'm trying to do a library of functions like clocc, where I will put
all my stuff organized in packages.

The problem is that I want to use some stuff from clocc and from other
lisp files.

I don't know if it's better to copy-paste that functions to my packages
or if it's better make a wrapper that call that functions.

With the last aproach I have the problem that, to use a single function
(e.x. I want to use some string function that is implemented in clocc)
I have to load a lot of stuff that I don't want to use.
With the first aproach I have the problem that some application would
use purely clocc and I would have duplicated code (I don't like this).

I need some advice about the better way of organize my functions in
order to make a personalized "API" where I can make my applications.

From: Barry Margolin
Subject: Re: Question about packages (and more)
Date: 
Message-ID: <barmar-9FCE77.18481031032005@comcast.dca.giganews.com>
In article <························@z14g2000cwz.googlegroups.com>,
 "Darmac" <········@gmail.com> wrote:

> I'm trying to do a library of functions like clocc, where I will put
> all my stuff organized in packages.
> 
> The problem is that I want to use some stuff from clocc and from other
> lisp files.
> 
> I don't know if it's better to copy-paste that functions to my packages
> or if it's better make a wrapper that call that functions.

Why don't you just call the functions directly?

If you intend to expose these as part of your library's API, you can 
IMPORT and EXPORT them.

-- 
Barry Margolin, ······@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
From: Darmac
Subject: Re: Question about packages (and more)
Date: 
Message-ID: <1112365027.964756.118330@o13g2000cwo.googlegroups.com>
I understand what you say, but in this way I have to load all the
package that have the function that I want to use.

How can I do to unload a package/function in lisp? This maybe answer my
question because I can Load all the package (e.x clocc), use the
function that I need and then unload clocc.

Could anybody tell me where I can read about memory handle under lisp.
Because I'm loading function everytime but I don't know if this
degradate lisp performance...

Thanks in advance.


Barry Margolin wrote:
> In article <························@z14g2000cwz.googlegroups.com>,
>  "Darmac" <········@gmail.com> wrote:
>
> > I'm trying to do a library of functions like clocc, where I will
put
> > all my stuff organized in packages.
> >
> > The problem is that I want to use some stuff from clocc and from
other
> > lisp files.
> >
> > I don't know if it's better to copy-paste that functions to my
packages
> > or if it's better make a wrapper that call that functions.
>
> Why don't you just call the functions directly?
>
> If you intend to expose these as part of your library's API, you can
> IMPORT and EXPORT them.
>
> --
> Barry Margolin, ······@alum.mit.edu
> Arlington, MA
> *** PLEASE post questions in newsgroups, not directly to me ***
From: Marco Antoniotti
Subject: Re: Question about packages (and more)
Date: 
Message-ID: <fQh3e.1$dj4.1938@typhoon.nyu.edu>
Darmac wrote:
> I understand what you say, but in this way I have to load all the
> package that have the function that I want to use.
> 
> How can I do to unload a package/function in lisp? This maybe answer my
> question because I can Load all the package (e.x clocc), use the
> function that I need and then unload clocc.
> 
> Could anybody tell me where I can read about memory handle under lisp.
> Because I'm loading function everytime but I don't know if this
> degradate lisp performance...

You worry too much.  First get it right and then get it fast.
Memory handling in Common Lisp is the least of your concerns, unless 
your profiler tells you so.   Just load whatever you need in and don't 
worry.

Cheers
--
Marco












> 
> Thanks in advance.
> 
> 
> Barry Margolin wrote:
> 
>>In article <························@z14g2000cwz.googlegroups.com>,
>> "Darmac" <········@gmail.com> wrote:
>>
>>
>>>I'm trying to do a library of functions like clocc, where I will
> 
> put
> 
>>>all my stuff organized in packages.
>>>
>>>The problem is that I want to use some stuff from clocc and from
> 
> other
> 
>>>lisp files.
>>>
>>>I don't know if it's better to copy-paste that functions to my
> 
> packages
> 
>>>or if it's better make a wrapper that call that functions.
>>
>>Why don't you just call the functions directly?
>>
>>If you intend to expose these as part of your library's API, you can
>>IMPORT and EXPORT them.
>>
>>--
>>Barry Margolin, ······@alum.mit.edu
>>Arlington, MA
>>*** PLEASE post questions in newsgroups, not directly to me ***
> 
> 
From: Barry Margolin
Subject: Re: Question about packages (and more)
Date: 
Message-ID: <barmar-1D1C14.22305401042005@comcast.dca.giganews.com>
In article <························@o13g2000cwo.googlegroups.com>,
 "Darmac" <········@gmail.com> wrote:

> I understand what you say, but in this way I have to load all the
> package that have the function that I want to use.

Of course you do.  The one function you want to use probably calls other 
functions in the package.  You need to load the whole package to make 
sure that all the dependencies are there.

If it's reasonable to split the package into independent subsets, the 
author of the package should have done that himself, by creating 
multiple packages.

But as a user, you should normally treat a package as a single entity.

-- 
Barry Margolin, ······@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***