From: Vladimir V. Zolotych
Subject: .CL and .LISP in DEFSYSTEM
Date: 
Message-ID: <3AD85456.503522A0@eurocom.od.ua>
Hello

Question about DEFSYSTEM. Some time ago I've asked
that but still have no answer. 

Is it possible to have more that one source file name
extensions simultaneously in DEFSYSTEM ? Some sources have
.CL extension (MaiSQL for example) some -- .LISP. To work
with it correctly I should have two versions of DEFSYSTEM.
If I set *filename-extensions* to ("cl" . "x86f") I can
work with appropriate files but not with .LISP extensions
and vice versa. If the DEFSYSTEM doesn't support this may
be some technique exists to work with several file extensions
simultaneously ?

Using DEFSYSTEM.LISP (ver 1.26) from
cvs.clocc.sourceforge.net:/cvsroot/clocc

When I write just

(defclass foo ())
(defmethod bar ((obj foo))) 

I got warning from COMPILE-FILE

Warning: Undefined type: FOO

So I wrap DEFCLASS in EVAL-WHEN. Do you do the same ?
Would you mind to say few words about that ?

Using CMUCL 18c

-- 
Vladimir Zolotych                         ······@eurocom.od.ua

From: Pierre R. Mai
Subject: Re: .CL and .LISP in DEFSYSTEM
Date: 
Message-ID: <871yqvgx54.fsf@orion.bln.pmsf.de>
"Vladimir V. Zolotych" <······@eurocom.od.ua> writes:

> Question about DEFSYSTEM. Some time ago I've asked
> that but still have no answer. 

Sorry, I must have missed/overread this...

> Is it possible to have more that one source file name
> extensions simultaneously in DEFSYSTEM ? Some sources have
> .CL extension (MaiSQL for example) some -- .LISP. To work
> with it correctly I should have two versions of DEFSYSTEM.
> If I set *filename-extensions* to ("cl" . "x86f") I can
> work with appropriate files but not with .LISP extensions
> and vice versa. If the DEFSYSTEM doesn't support this may
> be some technique exists to work with several file extensions
> simultaneously ?

You shouldn't need to modify defsystem.lisp at all, i.e. the default
entry for CMUCL should work OK:

         #+CMU           ("lisp" . ,(or (c:backend-fasl-file-type c:*backend*)
                                        "fasl"))

(At least that's the line I have in defsystem.lisp, maybe this has
changed).

You can specify source- (and if need be binary-) extensions at a
component level via the :source-extension (and :binary-extension)
options of defsystem, which is what I do in the MaiSQL system
definition files.  So MaiSQL should work out of the box with a
defsystem.lisp that defaults to .lisp, and so (obviously) should
systems that use .lisp extensions.

> When I write just
> 
> (defclass foo ())
> (defmethod bar ((obj foo))) 
> 
> I got warning from COMPILE-FILE
> 
> Warning: Undefined type: FOO

That is still a problem in CMU CL, because the defclass form doesn't
correctly inform the compiler of the new class.  There are hackish
work-arounds (see below), but the correct solution would be to fix CMU
CL.  Sadly we haven't yet found an easy fix, but I'll see if I can
look into it further in the coming weeks.

> So I wrap DEFCLASS in EVAL-WHEN. Do you do the same ?

Instead of wrapping the defclass forms inside an eval-when form, you
could add compile to the variable pcl::*defclass-times*, i.e.

  (pushnew 'compile pcl::*defclass-times*)

BUT, and that's a big BUT:  Both solutions will cause the defclass
form to be executed at compilation-time, which is dangerous in itself
(and contrary to the intentions of the standard).  

Personally, I don't add compile to pcl::*defclass-times*, but rather
live with the misleading warnings, which will only occur when you
compile the files in a fresh core.  But the real solution is to fix
CMU CL...

Regs, Pierre.

-- 
Pierre R. Mai <····@acm.org>                    http://www.pmsf.de/pmai/
 The most likely way for the world to be destroyed, most experts agree,
 is by accident. That's where we come in; we're computer professionals.
 We cause accidents.                           -- Nathaniel Borenstein
From: Marco Antoniotti
Subject: Re: .CL and .LISP in DEFSYSTEM
Date: 
Message-ID: <y6cvgo7xjsy.fsf@octagon.mrl.nyu.edu>
"Pierre R. Mai" <····@acm.org> writes:

> "Vladimir V. Zolotych" <······@eurocom.od.ua> writes:
> 
> > Question about DEFSYSTEM. Some time ago I've asked
> > that but still have no answer. 
> 
> Sorry, I must have missed/overread this...
> 
> > Is it possible to have more that one source file name
> > extensions simultaneously in DEFSYSTEM ? Some sources have
> > .CL extension (MaiSQL for example) some -- .LISP. To work
> > with it correctly I should have two versions of DEFSYSTEM.
> > If I set *filename-extensions* to ("cl" . "x86f") I can
> > work with appropriate files but not with .LISP extensions
> > and vice versa. If the DEFSYSTEM doesn't support this may
> > be some technique exists to work with several file extensions
> > simultaneously ?
> 
> You shouldn't need to modify defsystem.lisp at all, i.e. the default
> entry for CMUCL should work OK:
> 
>          #+CMU           ("lisp" . ,(or (c:backend-fasl-file-type c:*backend*)
>                                         "fasl"))
> 
> (At least that's the line I have in defsystem.lisp, maybe this has
> changed).

Yes. This is what it is, although it should only be based of

	(pathaname-type (compiled-file-pathname ....))

Cheers

-- 
Marco Antoniotti ========================================================
NYU Courant Bioinformatics Group	tel. +1 - 212 - 998 3488
719 Broadway 12th Floor                 fax  +1 - 212 - 995 4122
New York, NY 10003, USA			http://bioinformatics.cat.nyu.edu
	       "Hello New York! We'll do what we can!"
			Bill Murray in `Ghostbusters'.
From: Pierre R. Mai
Subject: Re: .CL and .LISP in DEFSYSTEM
Date: 
Message-ID: <87lmp2pb4p.fsf@orion.bln.pmsf.de>
Marco Antoniotti <·······@cs.nyu.edu> writes:

> > You shouldn't need to modify defsystem.lisp at all, i.e. the default
> > entry for CMUCL should work OK:
> > 
> >          #+CMU           ("lisp" . ,(or (c:backend-fasl-file-type c:*backend*)
> >                                         "fasl"))
> > 
> > (At least that's the line I have in defsystem.lisp, maybe this has
> > changed).
> 
> Yes. This is what it is, although it should only be based of
> 
> 	(pathaname-type (compiled-file-pathname ....))

Maybe this should be changed in current versions to only include
special entries for legacy systems, where the default entry

         ("lisp" . ,(pathname-type (compile-file-pathname "foo.lisp")))))

doesn't work for some reason or another.

For CMU CL the portable version should always work as-is.

Regs, Pierre.

-- 
Pierre R. Mai <····@acm.org>                    http://www.pmsf.de/pmai/
 The most likely way for the world to be destroyed, most experts agree,
 is by accident. That's where we come in; we're computer professionals.
 We cause accidents.                           -- Nathaniel Borenstein
From: Vladimir V. Zolotych
Subject: Re: .CL and .LISP in DEFSYSTEM
Date: 
Message-ID: <3AD989FC.4F6F12BC@eurocom.od.ua>
"Pierre R. Mai" wrote:

> 
> You can specify source- (and if need be binary-) extensions at a
> component level via the :source-extension (and :binary-extension)
> options of defsystem,

It doesn't work for me on component level, only on file level.
E.g. 
(:file "postgresql-package" :source-extension "cl")
for each file.
Nevertheless this is sufficient for me, thanks.


-- 
Vladimir Zolotych                         ······@eurocom.od.ua
From: Pierre R. Mai
Subject: Re: .CL and .LISP in DEFSYSTEM
Date: 
Message-ID: <87oftypcgb.fsf@orion.bln.pmsf.de>
"Vladimir V. Zolotych" <······@eurocom.od.ua> writes:

> It doesn't work for me on component level, only on file level.
> E.g. 
> (:file "postgresql-package" :source-extension "cl")
> for each file.
> Nevertheless this is sufficient for me, thanks.

This seems like either some incorrect setup, or a bug in your version
of defsystem, though.  This should definitely work at the component
level, and hence the MaiSQL system definitions should work as-is on
all releases of MK-DEFSYSTEM.  What version of defsystem.lisp are you
using?

Regs, Pierre.

-- 
Pierre R. Mai <····@acm.org>                    http://www.pmsf.de/pmai/
 The most likely way for the world to be destroyed, most experts agree,
 is by accident. That's where we come in; we're computer professionals.
 We cause accidents.                           -- Nathaniel Borenstein
From: Pierre R. Mai
Subject: Re: .CL and .LISP in DEFSYSTEM
Date: 
Message-ID: <87itk6paxy.fsf@orion.bln.pmsf.de>
"Pierre R. Mai" <····@acm.org> writes:

> "Vladimir V. Zolotych" <······@eurocom.od.ua> writes:
> 
> > It doesn't work for me on component level, only on file level.
> > E.g. 
> > (:file "postgresql-package" :source-extension "cl")
> > for each file.
> > Nevertheless this is sufficient for me, thanks.
> 
> This seems like either some incorrect setup, or a bug in your version
> of defsystem, though.  This should definitely work at the component
> level, and hence the MaiSQL system definitions should work as-is on
> all releases of MK-DEFSYSTEM.  What version of defsystem.lisp are you
> using?

Just checked the current CVS[1] version 1.26, and this works with MaiSQL
out of the box, i.e. no changes are needed to let the source-extension
"cl" options work at component level.  Maybe you've got an obsolete
version of defsystem.lisp, or somehow your set-up screwed up this
part.

Regs, Pierre.

Footnotes: 
[1]  See http://clocc.sourceforge.net/ for current versions, which can
     be found in the CVS repository under clocc/src/defsystem-3.x/

-- 
Pierre R. Mai <····@acm.org>                    http://www.pmsf.de/pmai/
 The most likely way for the world to be destroyed, most experts agree,
 is by accident. That's where we come in; we're computer professionals.
 We cause accidents.                           -- Nathaniel Borenstein
From: Vladimir V. Zolotych
Subject: Re: .CL and .LISP in DEFSYSTEM
Date: 
Message-ID: <3AD9B026.F064E0B9@eurocom.od.ua>
"Pierre R. Mai" wrote:
> 
> Just checked the current CVS[1] version 1.26, and this works with MaiSQL
> out of the box, i.e. no changes are needed to let the source-extension
> "cl" options work at component level.  Maybe you've got an obsolete
> version of defsystem.lisp, or somehow your set-up screwed up this
> part.

You're right. DEFSYSTEM 1.26 works exactly as you said.

In my original post for this thread I've wrongly said version
of DEFSYSTEM. It was 1.21. Now it is 1.26 and works fine.

-- 
Vladimir Zolotych                         ······@eurocom.od.ua
From: Marco Antoniotti
Subject: Re: .CL and .LISP in DEFSYSTEM
Date: 
Message-ID: <y6czodgzz2t.fsf@octagon.mrl.nyu.edu>
"Vladimir V. Zolotych" <······@eurocom.od.ua> writes:

> "Pierre R. Mai" wrote:
> > 
> > Just checked the current CVS[1] version 1.26, and this works with MaiSQL
> > out of the box, i.e. no changes are needed to let the source-extension
> > "cl" options work at component level.  Maybe you've got an obsolete
> > version of defsystem.lisp, or somehow your set-up screwed up this
> > part.
> 
> You're right. DEFSYSTEM 1.26 works exactly as you said.
> 
> In my original post for this thread I've wrongly said version
> of DEFSYSTEM. It was 1.21. Now it is 1.26 and works fine.

Just to be precise. Please do not confuse the CVS revision numbers
with the actual release number.  The current RELEASE NUMBER of
MK:DEFSYSTEM is 3.2i.  The next one will be 4.0 (please refer to my
signature to figure out a release date :) ).

Cheers


-- 
Marco Antoniotti ========================================================
NYU Courant Bioinformatics Group	tel. +1 - 212 - 998 3488
719 Broadway 12th Floor                 fax  +1 - 212 - 995 4122
New York, NY 10003, USA			http://bioinformatics.cat.nyu.edu
	       "Hello New York! We'll do what we can!"
			Bill Murray in `Ghostbusters'.