From: Esteban
Subject: multiple source files
Date: 
Message-ID: <DEFA150647044931.25D416351A49B6CA.39C47A34D439010C@lp.airnews.net>
How does one partition source code into multiple files and compile them?
For example, if I were to split class definitions into their own files,
java-like.  How does one specify multiple source files to the compiler?

(gnu CLISP)

Thanks for your help.

From: Jonathan BAILLEUL
Subject: Re: multiple source files
Date: 
Message-ID: <3A4081D6.570C6ACE@labri.u-bordeaux.fr>
Esteban a �crit :
> 
> How does one partition source code into multiple files and compile them?
> For example, if I were to split class definitions into their own files,
> java-like.  How does one specify multiple source files to the compiler?
> 
> (gnu CLISP)
> 
> Thanks for your help.

I think you have two options:

1- make a lisp file from which you load/compile all the remote source
files and then lauch your program.
2- use the DEFSYSTEM package to do it properly and automatically (same
functionalities as GNU make).

This should be available from the CLOCC...

-- 
----------------------------
Bailleul Jonathan
DEA Informatique
LaBRI, Universite Bordeaux I
From: ········@hex.net
Subject: Re: multiple source files
Date: 
Message-ID: <wkk88ta89e.fsf@mail.hex.net>
>>>>> "Esteban" == Esteban  <····@catfish.net> writes:
Esteban> How does one partition source code into multiple files and
Esteban> compile them?  For example, if I were to split class
Esteban> definitions into their own files, java-like.  How does one
Esteban> specify multiple source files to the compiler?

Esteban> (gnu CLISP)

Well, you place them into their own files, and load as needed.

This is something that can be done at different levels of
sophistication; you could go with "low tech," which I'll outline.

Let's assume that there are three class files, class1.lsp, class2.lsp,
class3.lsp.

;;; Compiler script: "compile.lsp"
;;; The sophisticated way of compiling them is thus:
(dolist (dest '("class1" "class2" "class3"))
  (compile-file dest))

Then you load in the "master" file that loads the classes, and then
runs some main body of code...

;;; Master file  "master.lsp"
(load "class1")
(load "class2")
(load "class3")
;; Or, alternatively, using dolist...
;(dolist (dest '("class1" "class2" "class3"))
;  (load dest))
(run-main-body)

You do the _selection_ of what is to be _loaded_ in a more
sophisticated manner using the PACKAGE function set, where each of
those files would define what packages they implement, allowing you to
get pretty fancy in indicating what files implement what namespaces.

While that would certainly be fancier, it does not change how you'd go
about compiling the files, so I don't think it really contributes to
the answer.
-- 
(reverse (concatenate 'string ····················@" "454aa"))
<http://www.ntlug.org/~cbbrowne/lisp.html>
If ignorance is bliss, you must be orgasmic. 
From: Marco Antoniotti
Subject: Re: multiple source files
Date: 
Message-ID: <y6ck88sw88c.fsf@octagon.mrl.nyu.edu>
········@hex.net writes:

> >>>>> "Esteban" == Esteban  <····@catfish.net> writes:
> Esteban> How does one partition source code into multiple files and
> Esteban> compile them?  For example, if I were to split class
> Esteban> definitions into their own files, java-like.  How does one
> Esteban> specify multiple source files to the compiler?
> 
> Esteban> (gnu CLISP)
> 
> Well, you place them into their own files, and load as needed.
> 
> This is something that can be done at different levels of
> sophistication; you could go with "low tech," which I'll outline.
> 
> Let's assume that there are three class files, class1.lsp, class2.lsp,
> class3.lsp.
> 
> ;;; Compiler script: "compile.lsp"
> ;;; The sophisticated way of compiling them is thus:
> (dolist (dest '("class1" "class2" "class3"))
>   (compile-file dest))

Wellllll, the "Right Way" to do this is :)

(mk:defsystem classes
   :components ("class1" "class2" "class3"))

and then issue

(mk:compile-system 'classes)

YMMW :)

Cheers

-- 
Marco Antoniotti =============================================================
NYU Bioinformatics Group			 tel. +1 - 212 - 998 3488
719 Broadway 12th Floor                          fax  +1 - 212 - 995 4122
New York, NY 10003, USA				 http://galt.mrl.nyu.edu/valis
             Like DNA, such a language [Lisp] does not go out of style.
			      Paul Graham, ANSI Common Lisp
From: Esteban
Subject: Re: multiple source files
Date: 
Message-ID: <D9F3657CB0A86B0D.844C1EC0CB54EC3C.88A632786B9FA46F@lp.airnews.net>
Thanks very much.


"Marco Antoniotti" <·······@cs.nyu.edu> wrote in message
····················@octagon.mrl.nyu.edu...
>
> Wellllll, the "Right Way" to do this is :)
>
> (mk:defsystem classes
>    :components ("class1" "class2" "class3"))
>
> and then issue
>
> (mk:compile-system 'classes)
>
> YMMW :)
>
> Cheers
>
> --
> Marco Antoniotti
=============================================================
> NYU Bioinformatics Group tel. +1 - 212 - 998 3488
> 719 Broadway 12th Floor                          fax  +1 - 212 - 995 4122
> New York, NY 10003, USA http://galt.mrl.nyu.edu/valis
>              Like DNA, such a language [Lisp] does not go out of style.
>       Paul Graham, ANSI Common Lisp