Newsgroups: comp.lang.lisp
From: t...@sevak.isi.edu (Thomas A. Russ)
Date: 21 Oct 2010 09:26:55 -0700
Local: Thurs, Oct 21 2010 12:26 pm
Subject: Re: Problem with packages and READ
Josef Wolf <j...@raven.inka.de> writes: Well, for starters, DEFPARAMETER doesn't really know anything about > Hello, > I am somewhat struggling with the package system. Here is an excerpt: > CL-USER> (in-package :cl-user) > So READ seems to put symbols into the "toplevel" package, while DEFPARAMETER packages and it doesn't care. Packages affect the way the reader converts strings into symbols. So the real issue is what package is the "current package" when the reader encounters a string that it needs to turn into a symbol. There are essentially two levels to this. The first is an explicit IN-PACKAGE is one way of setting the current package, which is kept in > Is there any way to tell READ to put the symbols into the FOO package? So, yes, there are a couple of ways to do this. One of the simplest is to just use a package prefix: (defun huhu () By the way, the reason *bar* and 'bar are in the FOO package is because So, explicit qualification works if you have a constant string to read. (defun huhu () =========== Notes =========== [1] There is also #: to indicate to tell the reader to not intern the [2] The package qualifier indicates the package in which the lookup of [3] OK, there are program calls like INTERN that can also do this, but -- You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||