Thom Goodsell | 8 Dec 2008 17:13
Picon
Gravatar

How do I replace my broken ':perform' forms?

Sorry if this has been covered, or if it's just really obvious, but I  
couldn't find anything helpful in the archives.

I recently (i.e., about 15 minutes ago) got a new version of asdf.lisp  
when I updated my copy of ccl, and it broke a behavior I've been  
using. I *believe* that I was using the behavior incorrectly, and that  
the change was a bugfix, though I could be misunderstanding the svn  
logs.

In my defsystem, I have the following bit of code:

   :perform (load-op :before (op c)
		    ;; the before method runs after dependencies are loaded,
		    ;; but before the components are loaded, so clsql-mysql is  
available
		    (pushnew #p"/usr/local/mysql/lib/"      ; local development
			     (symbol-value (find-symbol "*FOREIGN-LIBRARY-SEARCH-PATHS*"
							:clsql-sys)))
		    (asdf:oos 'asdf:load-op 'clsql-mysql))

It appears, now, that my comment is not correct. The idea is that I  
want to load all the systems from :depends-on, which includes clsql.  
Then I want to set up clsql-sys:*foreign-library-search-paths* to  
include the correct version of the MySQL libraries. Finally, I want to  
load the mysql components of clsql.

Does anyone have advice on the Right Way (or even just a good way) to  
do this?

Thanks,
(Continue reading)

Robert Goldman | 8 Dec 2008 17:47

Re: How do I replace my broken ':perform' forms?

Thom Goodsell wrote:
> Sorry if this has been covered, or if it's just really obvious, but I  
> couldn't find anything helpful in the archives.
> 
> I recently (i.e., about 15 minutes ago) got a new version of asdf.lisp  
> when I updated my copy of ccl, and it broke a behavior I've been  
> using. I *believe* that I was using the behavior incorrectly, and that  
> the change was a bugfix, though I could be misunderstanding the svn  
> logs.
> 
> In my defsystem, I have the following bit of code:
> 
>    :perform (load-op :before (op c)
> 		    ;; the before method runs after dependencies are loaded,
> 		    ;; but before the components are loaded, so clsql-mysql is  
> available
> 		    (pushnew #p"/usr/local/mysql/lib/"      ; local development
> 			     (symbol-value (find-symbol "*FOREIGN-LIBRARY-SEARCH-PATHS*"
> 							:clsql-sys)))
> 		    (asdf:oos 'asdf:load-op 'clsql-mysql))
> 
> It appears, now, that my comment is not correct. The idea is that I  
> want to load all the systems from :depends-on, which includes clsql.  
> Then I want to set up clsql-sys:*foreign-library-search-paths* to  
> include the correct version of the MySQL libraries. Finally, I want to  
> load the mysql components of clsql.
> 
> Does anyone have advice on the Right Way (or even just a good way) to  
> do this?
> 
(Continue reading)

Nikodemus Siivola | 8 Dec 2008 19:23
Gravatar

Re: How do I replace my broken ':perform' forms?

On Mon, Dec 8, 2008 at 6:13 PM, Thom Goodsell <thom.goodsell <at> mac.com> wrote:

>   :perform (load-op :before (op c)
>                    ;; the before method runs after dependencies are loaded,
>                    ;; but before the components are loaded, so clsql-mysql is
> available
>                    (pushnew #p"/usr/local/mysql/lib/"      ; local development
>                             (symbol-value (find-symbol "*FOREIGN-LIBRARY-SEARCH-PATHS*"
>                                                        :clsql-sys)))
>                    (asdf:oos 'asdf:load-op 'clsql-mysql))

I would probably just use

  (defsystem ...
    :depends-on (:clsql-mysql)
    ...)

and leave search path configuration outside the system definition
file. (It's not going to be portable between different installations
anyways.)

Just document the fact that mysql libraries need to be set up right
(in LD_LIBRARY_PATH), or by user requiring :clsql-sys and pushing the
path onto *F-L-S-P* prior to trying to use your system.

(How do CLSQL users generally configure it? Is there maybe a
.clsql.lisp you can stick in $HOME, or something like that?)

Cheers,

(Continue reading)

Thom Goodsell | 10 Dec 2008 15:35
Picon
Gravatar

Re: How do I replace my broken ':perform' forms?


On Dec 8, 2008, at 11:47 AM, Robert Goldman wrote:

> Thom Goodsell wrote:
>> Sorry if this has been covered, or if it's just really obvious, but I
>> couldn't find anything helpful in the archives.
>>
>> I recently (i.e., about 15 minutes ago) got a new version of  
>> asdf.lisp
>> when I updated my copy of ccl, and it broke a behavior I've been
>> using. I *believe* that I was using the behavior incorrectly, and  
>> that
>> the change was a bugfix, though I could be misunderstanding the svn
>> logs.
>>
>> In my defsystem, I have the following bit of code:
>>
>>   :perform (load-op :before (op c)
>> 		    ;; the before method runs after dependencies are loaded,
>> 		    ;; but before the components are loaded, so clsql-mysql is
>> available
>> 		    (pushnew #p"/usr/local/mysql/lib/"      ; local development
>> 			     (symbol-value (find-symbol "*FOREIGN-LIBRARY-SEARCH-PATHS*"
>> 							:clsql-sys)))
>> 		    (asdf:oos 'asdf:load-op 'clsql-mysql))
>>
>> It appears, now, that my comment is not correct. The idea is that I
>> want to load all the systems from :depends-on, which includes clsql.
>> Then I want to set up clsql-sys:*foreign-library-search-paths* to
>> include the correct version of the MySQL libraries. Finally, I want  
(Continue reading)

Sam Steingold | 29 Dec 2008 17:13
Picon

asdf patch: clisp has mop

clisp has full MOP (since 2005), including change-class (since 2003) & method 
combinations (since 2004).

--- asdf.lisp.~1.130.~	2008-10-15 14:56:08.000000000 -0400
+++ asdf.lisp	2008-12-29 11:10:45.000033000 -0500
 <at>  <at>  -705,8 +705,7  <at>  <at>  the head of the tree"))
  ;;; So you look at this code and think "why isn't it a bunch of
  ;;; methods".  And the answer is, because standard method combination
  ;;; runs :before methods most->least-specific, which is back to front
-;;; for our purposes.  And CLISP doesn't have non-standard method
-;;; combinations, so let's keep it simple and aspire to portability
+;;; for our purposes.

  (defgeneric traverse (operation component))
  (defmethod traverse ((operation operation) (c component))
 <at>  <at>  -1056,9 +1055,6  <at>  <at>  method.")
             (cond ((and s (eq (type-of (cdr s)) ',class))
                    (setf (car s) (get-universal-time)))
                   (s
-                  #+clisp
-                  (sysdef-error "Cannot redefine the existing system ~A with a 
different class" s)
-                  #-clisp
                    (change-class (cdr s) ',class))
                   (t
                    (register-system (quote ,name)

------------------------------------------------------------------------------
Robert Goldman | 29 Dec 2008 23:39

Add CLEAN-OP to ASDF?

E.M. Baringer's Arnesi library has an ASDF clean-op in its src/asdf.lisp
file (thanks to fe[nl]ix on #lisp for the pointer).  Is there any reason
this operation could not be imported into the core ASDF distribution?
Cleaning out old FASLs seems like a very nice thing to have.

I don't *believe* that the license terms would cause any problems; we
would just have to give credit to Marco.  But IANAL.

Best,
Robert

------------------------------------------------------------------------------
Christophe Rhodes | 30 Dec 2008 09:36
Favicon

Re: Add CLEAN-OP to ASDF?

Robert Goldman <rpgoldman <at> sift.info> writes:

> E.M. Baringer's Arnesi library has an ASDF clean-op in its src/asdf.lisp
> file (thanks to fe[nl]ix on #lisp for the pointer).  Is there any reason
> this operation could not be imported into the core ASDF distribution?
> Cleaning out old FASLs seems like a very nice thing to have.

The usual argument against is that clean-op is philosophically wrong:
the output-files of which operation should it clean?

I'm no longer sure that that argument holds water: the operation
itself can know, by virtue of referring to the operation it's cleaning
up for.  Something like

(defclass clean-op (operation)
  ((clean-for :initarg :clean-for))
  (:default-initargs :clean-for (make-instance 'load-op)))

Now (asdf:oos 'asdf:clean-op ...) will do the right thing, and those
with special requirements can additionally do things like
  (asdf:oos 'asdf:clean-op ... :clean-for (make-instance 'test-op))
or similar.

This probably isn't going to be a straightforward import of Marco's
code (though maybe it is, I don't know); on the other hand, if this
functionality were available in this form I would be happy.

Best,

Christophe
(Continue reading)

Robert Goldman | 30 Dec 2008 16:50

Re: Add CLEAN-OP to ASDF?

Christophe Rhodes wrote:
> Robert Goldman <rpgoldman <at> sift.info> writes:
> 
>> E.M. Baringer's Arnesi library has an ASDF clean-op in its src/asdf.lisp
>> file (thanks to fe[nl]ix on #lisp for the pointer).  Is there any reason
>> this operation could not be imported into the core ASDF distribution?
>> Cleaning out old FASLs seems like a very nice thing to have.
> 
> The usual argument against is that clean-op is philosophically wrong:
> the output-files of which operation should it clean?
> 
> I'm no longer sure that that argument holds water: the operation
> itself can know, by virtue of referring to the operation it's cleaning
> up for.  Something like
> 
> (defclass clean-op (operation)
>   ((clean-for :initarg :clean-for))
>   (:default-initargs :clean-for (make-instance 'load-op)))
> 
> Now (asdf:oos 'asdf:clean-op ...) will do the right thing, and those
> with special requirements can additionally do things like
>   (asdf:oos 'asdf:clean-op ... :clean-for (make-instance 'test-op))
> or similar.
> 
> This probably isn't going to be a straightforward import of Marco's
> code (though maybe it is, I don't know); on the other hand, if this
> functionality were available in this form I would be happy.
> 
> Best,
> 
(Continue reading)

Robert Goldman | 30 Dec 2008 16:55

Re: Add CLEAN-OP to ASDF?

Christophe Rhodes wrote:
> Robert Goldman <rpgoldman <at> sift.info> writes:
> 
>> E.M. Baringer's Arnesi library has an ASDF clean-op in its src/asdf.lisp
>> file (thanks to fe[nl]ix on #lisp for the pointer).  Is there any reason
>> this operation could not be imported into the core ASDF distribution?
>> Cleaning out old FASLs seems like a very nice thing to have.
> 
> The usual argument against is that clean-op is philosophically wrong:
> the output-files of which operation should it clean?
> 
> I'm no longer sure that that argument holds water: the operation
> itself can know, by virtue of referring to the operation it's cleaning
> up for.  Something like
> 
> (defclass clean-op (operation)
>   ((clean-for :initarg :clean-for))
>   (:default-initargs :clean-for (make-instance 'load-op)))
> 
> Now (asdf:oos 'asdf:clean-op ...) will do the right thing, and those
> with special requirements can additionally do things like
>   (asdf:oos 'asdf:clean-op ... :clean-for (make-instance 'test-op))
> or similar.
> 
> This probably isn't going to be a straightforward import of Marco's
> code (though maybe it is, I don't know); on the other hand, if this
> functionality were available in this form I would be happy.
> 
> Best,
> 
(Continue reading)

Gary King | 30 Dec 2008 18:04
Favicon
Gravatar

Re: Add CLEAN-OP to ASDF?

Hi Robert,

My two cents is that adding this would be a Good Thing.

Thanks for doing the work

On Dec 30, 2008, at 10:55 AM, Robert Goldman wrote:

> Christophe Rhodes wrote:
>> Robert Goldman <rpgoldman <at> sift.info> writes:
>>
>>> E.M. Baringer's Arnesi library has an ASDF clean-op in its src/ 
>>> asdf.lisp
>>> file (thanks to fe[nl]ix on #lisp for the pointer).  Is there any  
>>> reason
>>> this operation could not be imported into the core ASDF  
>>> distribution?
>>> Cleaning out old FASLs seems like a very nice thing to have.
>>
>> The usual argument against is that clean-op is philosophically wrong:
>> the output-files of which operation should it clean?
>>
>> I'm no longer sure that that argument holds water: the operation
>> itself can know, by virtue of referring to the operation it's  
>> cleaning
>> up for.  Something like
>>
>> (defclass clean-op (operation)
>>  ((clean-for :initarg :clean-for))
>>  (:default-initargs :clean-for (make-instance 'load-op)))
(Continue reading)


Gmane