From: Stephen Schmid
Subject: HELP: - dealing w/ interpreter and packages.
Date: 
Message-ID: <CGpKKI.Dy9@news2.cis.umn.edu>
I am working on an interpreter and I use a parser that extracts tokens
that are seperated by spaces.  I am using a parser from a text book.

it begins with:

(defun scanner (instring)
(let* ((spacestring (make-sequence '(vector character)
           10:
           initial-element #\SPACE))
   (outlist NIL)(pos2 (position #\SPACE inbstring))
                     (pos 1 0)
   (stringend (length instring))(newstring
             spacestring))
   (loop
..etc

when loading it says

Error: There is no package with the name 10.

Being new to lisp, I am wondering first of all what this will do and
how to make this package, because the use of this is not mentioned
anywhere else in the textbook.

Thanks in advance,
steve

From: Len Charest
Subject: Re: HELP: - dealing w/ interpreter and package
Date: 
Message-ID: <1993Nov18.230840.13794@jpl-devvax.jpl.nasa.gov>
In article ···@news2.cis.umn.edu, ······@flounder.micro.umn.edu (Stephen Schmid) writes:
>I am working on an interpreter and I use a parser that extracts tokens
>that are seperated by spaces.  I am using a parser from a text book.
>when loading it says
>
>Error: There is no package with the name 10.

The error is not due to any missing package but rather to a misplaced
colon, which is used to delimit package-names in symbols. For example
AI:HYPE refers to a symbol HYPE that is accessible in the package AI.
There is a built-in package whose package name is the empty string.
Symbols in this package are known as keywords and are written,
for-example, like :INITIAL-ELEMENT.

Here's a fix for your code (with some reformatting in good Lisp style):

(defun scanner (instring)
  (let* ((spacestring (make-sequence '(vector character)
                      10
                      :initial-element #\SPACE))
         (outlist NIL)
         (pos2 (position #\SPACE instring))
         (pos 1 0)
         (stringend (length instring))
         (newstring spacestring))
   (loop
...etc

Note that (MAKE-STRING ...) could be used in place of (MAKE-SEQUENCE
'(VECTOR CHARACTER) ...) to enhance readability (and perhaps efficiency
in some lisps).
---
..................................Len Charest, Jr.
.................JPL Artificial Intelligence Group
·································@aig.jpl.nasa.gov
From: Syed Zaeem Hosain
Subject: Re: HELP: - dealing w/ interpreter and packages
Date: 
Message-ID: <1993Nov20.175655.22749@zcon.com>
In article ···@news2.cis.umn.edu,  ······@flounder.micro.umn.edu (Stephen Schmid) writes:
>I am working on an interpreter and I use a parser that extracts tokens
>that are seperated by spaces.  I am using a parser from a text book.
>
>it begins with:
>
>(defun scanner (instring)
>(let* ((spacestring (make-sequence '(vector character)
>           10:
>           initial-element #\SPACE))
>   (outlist NIL)(pos2 (position #\SPACE inbstring))
>                     (pos 1 0)
>   (stringend (length instring))(newstring
>             spacestring))
>   (loop
>...etc
>
>when loading it says
>
>Error: There is no package with the name 10.

The error is due to the colon (:) after the 10. This gets treated as a
package (if you do not understand packages for now, ignore this for the
moment - you will need it later to avoid namespace collisions in any
large program).

Basically, the colon should be part of the "initial-element" symbol,
not part of the number 10. The following few lines should explain:

>(let* ((spacestring (make-sequence '(vector character)
>           10
>           :initial-element #\SPACE))

								Z


-- 
-------------------------------------------------------------------------
| Syed Zaeem Hosain          P. O. Box 610097            (408) 441-7021 |
| Z Consulting Group        San Jose, CA 95161             ···@zcon.com |
-------------------------------------------------------------------------