From: Stephen Gibberd
Subject: NREGEX in debian acl-compat package
Date: 
Message-ID: <20ab4a7f.0206172234.3a16323e@posting.google.com>
Hello,

I am new to lisp, and am trying to trying to use the nregex library in
the acl-compat package with cmucl. When I type:
(require :acl-compat)

It gives the message:
 
Warning: System NREGEX doesn't seem to be defined...
(#<FILE: uri> #<FILE: meta> #<FILE: acl-sys-cmu> #<FILE: acl-excl-cmu>
 #<FILE: acl-socket-cmu> #<FILE: acl-mp-cmu> #<FILE: nregex>)

I can see the file:
/usr/share/common-lisp/repositories/acl-compat/nregex.lisp where the
uri.lisp, etc. files are. When I try:
(load "/usr/share/common-lisp/repositories/acl-compat/nregex.lisp")

It loads OK, but I still can't use the regex functions:
Warning: This function is undefined:
  REGEX

Can someone give me any pointers as to where I should be looking?

Thanks.

From: James A. Crippen
Subject: Re: NREGEX in debian acl-compat package
Date: 
Message-ID: <m3vg8hgeqq.fsf@kappa.unlambda.com>
···@everyday.com.kh (Stephen Gibberd) writes:

> I am new to lisp, and am trying to trying to use the nregex library in
> the acl-compat package with cmucl. When I type:
> (require :acl-compat)
> 
> It gives the message:
>  
> Warning: System NREGEX doesn't seem to be defined...
> (#<FILE: uri> #<FILE: meta> #<FILE: acl-sys-cmu> #<FILE: acl-excl-cmu>
>  #<FILE: acl-socket-cmu> #<FILE: acl-mp-cmu> #<FILE: nregex>)
> 
> I can see the file:
> /usr/share/common-lisp/repositories/acl-compat/nregex.lisp where the
> uri.lisp, etc. files are. When I try:
> (load "/usr/share/common-lisp/repositories/acl-compat/nregex.lisp")
> 
> It loads OK, but I still can't use the regex functions:
> Warning: This function is undefined:
>   REGEX
> 
> Can someone give me any pointers as to where I should be looking?

I don't have the sources to this handy, but I'll bet you need to be
looking in a different package.

Lisp has the concept of packages, created (usually) by DEFPACKAGE.
Each package has its own namespace for symbols.  When you refer to a
symbol such as FOO you are referring to it in the current package.
When you start Lisp you are (almost always) in the package
COMMON-LISP-USER (which can be referred to as CL-USER, it's nickname).
So when you refer to FOO in a freshly started Lisp you are really
referring to CL-USER::FOO.

To refer to symbols in other packages you use the colon notation,
PACKAGE:SYMBOL.  This only works for SYMBOLs which PACKAGE has
exported, ie made available to external packages.  If SYMBOL is not
exported by PACKAGE but PACKAGE still contains SYMBOL you can refer to
it with PACKAGE::SYMBOL.  But this is typically a bad sign if you need
to refer to unexported symbols in another package; it usually means
you're working around the 'official' interface of the package, which
is probably going against the package's design.

If all this sounds vaguely familar then it's probably because many
other languages (such as Java) have borrowed these concepts from Lisp.

Read up on packages.  They're essential to working with multiple Lisp
libraries and programs.  Here's the end-all reference for packages:
http://www.xanalys.com/software_tools/reference/HyperSpec/Body/11_a.htm
Read the Introduction.  You should also see your particular Lisp's
documentation for more details on how it makes packages work, and what
non-standard packages it implements.

To figure out what package you're supposed to find a symbol in, if the
documentation for the library or program fails you, you can typically
look in the source code for an IN-PACKAGE or DEFPACKAGE statement in
the appropriate file.  If these fail you then look at the top of the
file for an Emacs modeline and see if it has a 'Package:' declaration.

HTH
'james
(sigh, back to compiling X...)

-- 
James A. Crippen <·····@unlambda.com> ,-./-.  Anchorage, Alaska,
Lambda Unlimited: Recursion 'R' Us   |  |/  | USA, 61.20939N, -149.767W
Y = \f.(\x.f(xx)) (\x.f(xx))         |  |\  | Earth, Sol System,
Y(F) = F(Y(F))                        \_,-_/  Milky Way.
From: Chris Double
Subject: Re: NREGEX in debian acl-compat package
Date: 
Message-ID: <uy9dc72a0.fsf@double.co.nz>
> It loads OK, but I still can't use the regex functions: Warning:
> This function is undefined: REGEX

If it's the version of NREGEX that I modified to get my Corman Lisp
port of AllegroServe working then it sits in the nregex package. Try:

(use-package 'nregex)

before calling any regex functions. The original NREGEX did not use a
package so if it's the original it is another problem. Before someone
asks, I did get permission from the author to distribute my modified
version with my Corman Lisp port of AlegroServe.

If you're looking for more full featured regex support take a look at
the packages described at Cliki: http://ww.telent.net/cliki

Chris.
-- 
http://www.double.co.nz/cl
From: Jochen Schmidt
Subject: Re: NREGEX in debian acl-compat package
Date: 
Message-ID: <aeoce6$fq3$1@rznews2.rrze.uni-erlangen.de>
Chris Double wrote:

>> It loads OK, but I still can't use the regex functions: Warning:
>> This function is undefined: REGEX
> 
> If it's the version of NREGEX that I modified to get my Corman Lisp
> port of AllegroServe working then it sits in the nregex package. Try:
> 
> (use-package 'nregex)
> 
> before calling any regex functions. The original NREGEX did not use a
> package so if it's the original it is another problem. Before someone
> asks, I did get permission from the author to distribute my modified
> version with my Corman Lisp port of AlegroServe.

Well - yes we use your modified version because adding a package around it 
is/was a good idea and you already made and announced that modification to 
the author.
The copyright-statement (at the CMU AI Archive) says that distribution of 
nregex.lisp is permitted so this should not be a problem. We later applied 
a patch to our version which too got reported to the author. There is 
another issue now because there is a (in-package "USER") in the code and 
MCL does not like it (it has no "USER" package). I have reported this issue 
and that we changed that in our version to the author.

Our port of AllegroServe does not use the regex-functions anymore.

Speaking of our port (which now works on CMUCL, LispWorks, MCL and OpenMCL).
If I remember right I contacted you if you are interested to join the 
PortableAServe effort with your work on the Corman Lisp port. I would be 
pleased to welcome you to our small group of developers. You would of 
course get full CVS access at the SourceForge project site.

> If you're looking for more full featured regex support take a look at
> the packages described at Cliki: http://ww.telent.net/cliki

This may be a good idea.

ciao,
Jochen

--
http://www.dataheaven.de
From: Dmitri Ivanov
Subject: Re: NREGEX in debian acl-compat package
Date: 
Message-ID: <aeq1tb$1fd9$1@news.aha.ru>
Jochen Schmidt <···@dataheaven.de> wrote in message
·················@rznews2.rrze.uni-erlangen.de...
| ...snip... |
| Our port of AllegroServe does not use the regex-functions anymore.

Sorry for misundersanding, but what does that mean? Is not the nregex
listed in acl-compat system?
---
Sincerely,
Dmitri Ivanov
www.aha.ru/~divanov
From: Jochen Schmidt
Subject: Re: NREGEX in debian acl-compat package
Date: 
Message-ID: <aer3kh$d9o$1@rznews2.rrze.uni-erlangen.de>
Dmitri Ivanov wrote:

> 
> Jochen Schmidt <···@dataheaven.de> wrote in message
> ·················@rznews2.rrze.uni-erlangen.de...
> | ...snip... |
> | Our port of AllegroServe does not use the regex-functions anymore.
> 
> Sorry for misundersanding, but what does that mean? Is not the nregex
> listed in acl-compat system?

PortableAServe depends on ACL-COMPAT but not vice versa. ACL-COMPAT can be
understood as a general compatbility library to create an ACL alike API for
other Lispsystems. Besides of that, actually my comment is not really true.
We do not use match-regexp anymore for parsing the datetimes but it is 
still used in FIND-URI-INFO in proxy.cl

ciao,
Jochen

--
http://www.dataheaven.de
From: Chris Double
Subject: Re: NREGEX in debian acl-compat package
Date: 
Message-ID: <uptyn7r7w.fsf@double.co.nz>
Jochen Schmidt <···@dataheaven.de> writes:

> Well - yes we use your modified version because adding a package
> around it is/was a good idea and you already made and announced that
> modification to the author.

Yes, I was quite sure you were doing the right thing with regards to
the original author. I made the comment about having asked for
permission because I mentioned having modified NREGEX once before and
got comments from a few people via email about how bad it is to modify
and distribute other peoples software. It was not to imply you were
doing anything wrong.

> Speaking of our port (which now works on CMUCL, LispWorks, MCL and
> OpenMCL).  If I remember right I contacted you if you are interested
> to join the PortableAServe effort with your work on the Corman Lisp
> port. I would be pleased to welcome you to our small group of
> developers. You would of course get full CVS access at the
> SourceForge project site.

This has always been on my 'to do' list but because of lack of free
time I haven't had a chance to get to it. I do plan to use
AllegroServe in a future project and if someone else hasn't worked on
it by then I'd be happy to do it.

> 
> > If you're looking for more full featured regex support take a look at
> > the packages described at Cliki: http://ww.telent.net/cliki
> 
> This may be a good idea.

I've been using CL-AWK. It's a very nice package.

Cheers,
Chris.
-- 
http://www.double.co.nz/cl
From: Jochen Schmidt
Subject: Re: NREGEX in debian acl-compat package
Date: 
Message-ID: <aep8f9$8u3$1@rznews2.rrze.uni-erlangen.de>
Chris Double wrote:

> Jochen Schmidt <···@dataheaven.de> writes:
> 
>> Well - yes we use your modified version because adding a package
>> around it is/was a good idea and you already made and announced that
>> modification to the author.
> 
> Yes, I was quite sure you were doing the right thing with regards to
> the original author. I made the comment about having asked for
> permission because I mentioned having modified NREGEX once before and
> got comments from a few people via email about how bad it is to modify
> and distribute other peoples software. It was not to imply you were
> doing anything wrong.

Hm - well the problem is that the original library is probably not even 
maintained anymore - at least the CMU AI version looks a bit old.
Maybe removing it from acl-compat is a better idea then.

>> Speaking of our port (which now works on CMUCL, LispWorks, MCL and
>> OpenMCL).  If I remember right I contacted you if you are interested
>> to join the PortableAServe effort with your work on the Corman Lisp
>> port. I would be pleased to welcome you to our small group of
>> developers. You would of course get full CVS access at the
>> SourceForge project site.
> 
> This has always been on my 'to do' list but because of lack of free
> time I haven't had a chance to get to it. I do plan to use
> AllegroServe in a future project and if someone else hasn't worked on
> it by then I'd be happy to do it.

Most of the portableaserve developers do not have much free time (including 
me). It would be no problem to maintain a half-finished port in the CVS.
The good thing with portableaserve is that the real "server" stuff is 
portable to the acl-compat library and can therefore be done by all 
developers. The other nice thing is that the other ports already contain 
code to look at when implementing the necessary stuff for a new port.
If all goes well you should not even change a line in the aserve sources - 
implementing the necessary stuff in ACL-COMPAT should suffice.

And as time showed the developers tend to work on all ports often.

I'm not sure but it seems that your acl compatible MP and socket stuff 
comes now with Corman Lisp - this would make the ACL-COMPAT layer for 
Corman Lisp rather thin which is a good thing.

I have added you to the SourceForge Project

  http://sourceforge.net/projects/portableaserve

so if you find the time you can simply start hacking.


>> > If you're looking for more full featured regex support take a look at
>> > the packages described at Cliki: http://ww.telent.net/cliki
>> 
>> This may be a good idea.
> 
> I've been using CL-AWK. It's a very nice package.

Definitely - it is on my to-look-at list :-)

ciao,
Jochen

--
http://www.dataheaven.de