From: JanTheKing
Subject: Register/ include macros in the Lisp Box permanently
Date: 
Message-ID: <1162899467.078228.96490@f16g2000cwb.googlegroups.com>
Hi,

I am using certain custom macros like - PPMX, DTRACE, SDRAW - which
have not been supplied by the Lisp vendor. The issue here is -
everytime I start my allegro lisp box, I need to load these macros
manually. Is there a mechanism by which a macro can be permanently
registered/included in the lisp box permanently (i.e. I do not need to
compile-load these macros everytime I open Lisp box)?

Thanks,
Jan

From: Ken Tilton
Subject: Re: Register/ include macros in the Lisp Box permanently
Date: 
Message-ID: <6F%3h.1780$DK5.1045@newsfe12.lga>
JanTheKing wrote:
> Hi,
> 
> I am using certain custom macros like - PPMX, DTRACE, SDRAW - which
> have not been supplied by the Lisp vendor. The issue here is -
> everytime I start my allegro lisp box, I need to load these macros
> manually. Is there a mechanism by which a macro can be permanently
> registered/included in the lisp box permanently (i.e. I do not need to
> compile-load these macros everytime I open Lisp box)?

Generally a Lisp implementation will look in its root directory for a 
startup file or two to load, or take a command-line parameter you could 
put in a win32 shortcut, or some such. AllegroCL looks for startup.cl.

kt

-- 
Cells: http://common-lisp.net/project/cells/

"I'll say I'm losing my grip, and it feels terrific."
    -- Smiling husband to scowling wife, New Yorker cartoon
From: JanTheKing
Subject: Re: Register/ include macros in the Lisp Box permanently
Date: 
Message-ID: <1162966641.253155.243920@h48g2000cwc.googlegroups.com>
Hi Ken,

Thank you, it works. I created a file called startup.cl (as well as
clinit.cl) and put them in the allegro home directory. I entered the
files to be loaded in this file and the files are now loaded
automatically on startup. Thanks again.

Cheers,
Jan

Ken Tilton wrote:
> JanTheKing wrote:
> > Hi,
> >
> > I am using certain custom macros like - PPMX, DTRACE, SDRAW - which
> > have not been supplied by the Lisp vendor. The issue here is -
> > everytime I start my allegro lisp box, I need to load these macros
> > manually. Is there a mechanism by which a macro can be permanently
> > registered/included in the lisp box permanently (i.e. I do not need to
> > compile-load these macros everytime I open Lisp box)?
>
> Generally a Lisp implementation will look in its root directory for a
> startup file or two to load, or take a command-line parameter you could
> put in a win32 shortcut, or some such. AllegroCL looks for startup.cl.
>
> kt
>
> --
> Cells: http://common-lisp.net/project/cells/
>
> "I'll say I'm losing my grip, and it feels terrific."
>     -- Smiling husband to scowling wife, New Yorker cartoon
From: Ken Tilton
Subject: Re: Register/ include macros in the Lisp Box permanently
Date: 
Message-ID: <91f4h.186$ng.149@newsfe10.lga>
JanTheKing wrote:
> Hi Ken,
> 
> Thank you, it works. I created a file called startup.cl (as well as
> clinit.cl) and put them in the allegro home directory. I entered the
> files to be loaded in this file and the files are now loaded
> automatically on startup. Thanks again.

No! To hell with you! I am a horrible demon well and rightly villified 
in blogs far and wide! Try to keep up, will you? Dammit?!!!

hth, kenneth

ps. I have a reputation to preserve, OK? <sheesh>

-- 
Cells: http://common-lisp.net/project/cells/

"I'll say I'm losing my grip, and it feels terrific."
    -- Smiling husband to scowling wife, New Yorker cartoon
From: JanTheKing
Subject: Re: Register/ include macros in the Lisp Box permanently
Date: 
Message-ID: <1162970580.400354.251620@i42g2000cwa.googlegroups.com>
I am sorry Ken.


Ken Tilton wrote:
> JanTheKing wrote:
> > Hi Ken,
> >
> > Thank you, it works. I created a file called startup.cl (as well as
> > clinit.cl) and put them in the allegro home directory. I entered the
> > files to be loaded in this file and the files are now loaded
> > automatically on startup. Thanks again.
>
> No! To hell with you! I am a horrible demon well and rightly villified
> in blogs far and wide! Try to keep up, will you? Dammit?!!!
>
> hth, kenneth
>
> ps. I have a reputation to preserve, OK? <sheesh>
>
> --
> Cells: http://common-lisp.net/project/cells/
>
> "I'll say I'm losing my grip, and it feels terrific."
>     -- Smiling husband to scowling wife, New Yorker cartoon
From: Thomas A. Russ
Subject: Re: Register/ include macros in the Lisp Box permanently
Date: 
Message-ID: <ymiwt6595qd.fsf@sevak.isi.edu>
"JanTheKing" <········@gmail.com> writes:

> Hi Ken,
> 
> Thank you, it works. I created a file called startup.cl (as well as
> clinit.cl) and put them in the allegro home directory. I entered the
> files to be loaded in this file and the files are now loaded
> automatically on startup. Thanks again.

Don't forget to compile the files first.  You don't want to be loading
uncompiled code.

-- 
Thomas A. Russ,  USC/Information Sciences Institute
From: JanTheKing
Subject: Re: Register/ include macros in the Lisp Box permanently
Date: 
Message-ID: <1163055556.652836.84330@k70g2000cwa.googlegroups.com>
Hi Thomas,

Should I first compile the .lisp files and create .fasl files and
should write the load call for the .fasl file instead of .lisp file?

Thanks,
Jan

Thomas A. Russ wrote:
> "JanTheKing" <········@gmail.com> writes:
>
> > Hi Ken,
> >
> > Thank you, it works. I created a file called startup.cl (as well as
> > clinit.cl) and put them in the allegro home directory. I entered the
> > files to be loaded in this file and the files are now loaded
> > automatically on startup. Thanks again.
>
> Don't forget to compile the files first.  You don't want to be loading
> uncompiled code.
> 
> -- 
> Thomas A. Russ,  USC/Information Sciences Institute
From: Thomas A. Russ
Subject: Re: Register/ include macros in the Lisp Box permanently
Date: 
Message-ID: <ymiodre917b.fsf@sevak.isi.edu>
"JanTheKing" <········@gmail.com> writes:

> Hi Thomas,
> 
> Should I first compile the .lisp files and create .fasl files and
> should write the load call for the .fasl file instead of .lisp file?

Pretty much.

Actually, what you should really do is just compile the files and have
the load call not specify the file type.  That will take advantage of
the general policy of lisp implementations to first try loading a
compiled version of the file, and if they can't find one, trying to load
the source.

In other words, do this in some lisp:

  (compile-file "my-file")

And then in your initialization file include

  (load "my-file")

In both cases just use the filename without the extension.

-- 
Thomas A. Russ,  USC/Information Sciences Institute
From: Gene Ash
Subject: Re: Register/ include macros in the Lisp Box permanently
Date: 
Message-ID: <1163235218.432988.317070@h48g2000cwc.googlegroups.com>
Thank you for the valuable info Thomas.

Cheers,
Gene

Thomas A. Russ wrote:
> "JanTheKing" <········@gmail.com> writes:
>
> > Hi Thomas,
> >
> > Should I first compile the .lisp files and create .fasl files and
> > should write the load call for the .fasl file instead of .lisp file?
>
> Pretty much.
>
> Actually, what you should really do is just compile the files and have
> the load call not specify the file type.  That will take advantage of
> the general policy of lisp implementations to first try loading a
> compiled version of the file, and if they can't find one, trying to load
> the source.
>
> In other words, do this in some lisp:
>
>   (compile-file "my-file")
>
> And then in your initialization file include
>
>   (load "my-file")
>
> In both cases just use the filename without the extension.
> 
> -- 
> Thomas A. Russ,  USC/Information Sciences Institute
From: Rob Warnock
Subject: Re: Register/ include macros in the Lisp Box permanently
Date: 
Message-ID: <irOdnSIKNsgHXsjYnZ2dnUVZ_oidnZ2d@speakeasy.net>
Thomas A. Russ <···@sevak.isi.edu> wrote:
+---------------
| Actually, what you should really do is just compile the files and have
| the load call not specify the file type.  That will take advantage of
| the general policy of lisp implementations to first try loading a
| compiled version of the file, and if they can't find one, trying to
| load the source.
...
|   (compile-file "my-file")
| And then in your initialization file include
|   (load "my-file")
+---------------

CMUCL has a neat extension that adds a bit of further convenience
to this:

    (load "my-file" :if-source-newer :compile)

This will not compile the source if no corresponding FASL already
exists, but if it does *and* the source is newer than the FASL,
it will re-COMPILE-FILE the source and load the resulting FASL.
Quite handy if you want to make a quick edit and re-LOAD.

It's not a substitute for ASDF or DEFSYSTEM, but quite handy
during exploratory programming.


-Rob

-----
Rob Warnock			<····@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607