[cl-ppcre-devel] using cl-ppcre functions without package prefixes

terrence.x.brannon at jpmchase.com terrence.x.brannon at jpmchase.com
Thu Jan 10 20:20:40 UTC 2008


I'm partial to the book "Successful Lisp" but neither book covers ASDF. 
This tutorial was of great help in the past:
http://common-lisp.net/~mmommer/asdf-howto.shtml

but it is not quite helping me enough here. In both Case 1 and Case 2 
below, my .sbclrc does not change, yet Case 2 works just fine. I would 
like to be able to do an asdf load on bank-match and have it pull-in 
cl-ppcre, but as it stands I must manually load it first.

(setf asdf:*central-registry*
      '(
        ;;
        *default-pathname-defaults* 
        ;;; 
        #P"C:\\cygwin\\home\\W049945\\prg\\lisp-asdf\\series-2.2.9\\"
        #P"C:\\cygwin\\home\\W049945\\prg\\lisp-asdf\\cl-ppcre-1.3.2\\"
        #P"C:\\cygwin\\home\\W049945\\prg\\redick\\lisp\\"
        #P"C:\\etl\\y.com\\trunk\\zan\\approximate-matching\\src\\lisp\\"
        ))

Case 1: attempt to load cl-ppcre via my defpackage: throw error 'The name 
"CL-PPCRE" does not designate any package.'

relevant source:

(defpackage :bank-match
  (:use :cl :asdf :cl-ppcre)
  )

(in-package :bank-match)

(asdf:defsystem bank-match
    :description "Approximate bank matching"
    :author "Terrence M. Brannon"
    :maintainer "Terrence M. Brannon"
    :licence "Artistic"
    :version "1.0"
    :serial t
    :components (
                 (:file "clean")
                 )
    )

(progn
  (declaim (optimize (debug 3) (safety 3))) 
  (asdf:operate 'asdf:load-op 'bank-match))

Case 2: load cl-ppcre manually and then attempt to load my bank-match 
package using a simple asdf call => works just fine
symbols:   BANK-MATCH::OPTIMIZE, COMMON-LISP:OPTIMIZE

;;;; (asdf:operate 'asdf:load-op 'cl-ppcre) ...
; loading system definition from
; C:\cygwin\home\W049945\prg\lisp-asdf\cl-ppcre-1.3.2\cl-ppcre.asd into
; #<PACKAGE "ASDF0">
; registering #<SYSTEM :CL-PPCRE {B1BA4C1}> as CL-PPCRE

;;;; (asdf:operate 'asdf:load-op 'bank-match) ...
; loading system definition from
; 
c:\etl\aml-ntdb-uat-02.ny.jpmorgan.com\trunk\zan\approximate-matching\src\lisp\bank-match.asd
; into #<PACKAGE "ASDF0">
; registering #<SYSTEM BANK-MATCH {ABCC439}> as BANK-MATCH
;;;; (asdf:operate 'asdf:load-op 'cl-ppcre) ...
;;;; (asdf:operate 'asdf:load-op 'bank-match) ...



--
Terrence Brannon - SID W049945
614-213-2475 (office)
614-213-3426 (fax)
818-359-0893 (cell)





Edi Weitz <edi at agharta.de> 
Sent by: cl-ppcre-devel-bounces at common-lisp.net
01/04/2008 05:43 PM
Please respond to
General interest list about cl-ppcre <cl-ppcre-devel at common-lisp.net>


To
General interest list about cl-ppcre <cl-ppcre-devel at common-lisp.net>
cc

Subject
Re: [cl-ppcre-devel] using cl-ppcre functions without package prefixes






On Fri, 4 Jan 2008 17:20:41 -0500, terrence.x.brannon at jpmchase.com wrote:

> Hello, I know this is more of just a pure Lisp question, but i
> cannot figure out how to get my Lisp program to use cl-ppcre without
> having to prefix the function calls with 'cl-ppcre'

Your technical question was answered already, but I suspect (I may be
wrong, of course) that you make the same mistake many Lisp newbies
make - you're confusing packages and systems.  A "package" is a
first-class Lisp object defined in the ANSI standard.  You can read
about it here for example:

  
http://gigamonkeys.com/book/programming-in-the-large-packages-and-symbols.html


(Read the whole book if you haven't done so already.)

A "system" (that's a common usage of the name although there's no
fixed definition for it) is something that's defined by a defsystem
facility like ASDF - it's more or less a collection of source files
plus instructions on how they are to be compiled.

Very often there's a system and a package of the same name, like it's
the case for CL-PPCRE.  That doesn't have to be the case, though.  The
names could be different, one system could define more than one
package or no package at all, you can define a package without
defining a system, etc.

HTH,
Edi.
_______________________________________________
cl-ppcre-devel site list
cl-ppcre-devel at common-lisp.net
http://common-lisp.net/mailman/listinfo/cl-ppcre-devel



-----------------------------------------
This communication is for informational purposes only. It is not
intended as an offer or solicitation for the purchase or sale of
any financial instrument or as an official confirmation of any
transaction. All market prices, data and other information are not
warranted as to completeness or accuracy and are subject to change
without notice. Any comments or statements made herein do not
necessarily reflect those of JPMorgan Chase & Co., its subsidiaries
and affiliates.

This transmission may contain information that is privileged,
confidential, legally privileged, and/or exempt from disclosure
under applicable law. If you are not the intended recipient, you
are hereby notified that any disclosure, copying, distribution, or
use of the information contained herein (including any reliance
thereon) is STRICTLY PROHIBITED. Although this transmission and any
attachments are believed to be free of any virus or other defect
that might affect any computer system into which it is received and
opened, it is the responsibility of the recipient to ensure that it
is virus free and no responsibility is accepted by JPMorgan Chase &
Co., its subsidiaries and affiliates, as applicable, for any loss
or damage arising in any way from its use. If you received this
transmission in error, please immediately contact the sender and
destroy the material in its entirety, whether in electronic or hard
copy format. Thank you.

Please refer to http://www.jpmorgan.com/pages/disclosures for
disclosures relating to UK legal entities.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/cl-ppcre-devel/attachments/20080110/c3627d4e/attachment.html>


More information about the Cl-ppcre-devel mailing list