From: Hoehle, Joerg-C. <Joe...@t-...> - 2004-09-21 11:43:11
|
Reini Urban wrote: >>>CL-USER> (make-package :km :case-sensistive t) >>>CL-USER> (in-package :km) >>>EVAL: undefined function in-package >Maybe I should downcase all existing symbols, [...] Hmm... >(make-package :km :case-sensistive t) If you intend to use CL symbols there, add :use "COMMON-LISP" Inside KM, either of these work for me: o explicit cl: package prefix, with lower case as usual o uppercase -- which people will probably find ugly. [52]> (make-package :km :case-sensitive t :use "CL") #<PACKAGE KM> [53]> (in-package"KM") #<PACKAGE KM> KM[54]> (apropos"defun") *** - EVAL: undefined function apropos [...] Break 1 KM[55]> (cl:describe cl:*package*) #<PACKAGE KM> is the package named KM. It imports the external symbols of 1 package COMMON-LISP and exports no symbols, but no package uses these exports. Break 1 KM[55]> :q KM[56]> (APROPOS"defun") CUSTOM:*DEFUN-ACCEPT-SPECIALIZED-LAMBDA-LIST* variable SYSTEM::C-DEFUN function DEFUN macro SYSTEM::IN-DEFUN SYSTEM::IN-DEFUN-P function Kind regards, J=F6rg |
From: Bruno H. <br...@cl...> - 2004-09-21 19:58:21
|
Reini Urban writes: > [1]> (make-package :km :case-sensitive t) > #<PACKAGE KM> > [2]> (in-package :km) > #<PACKAGE KM> > KM[3]> (defun xx ()(print 'ok)) The next clisp version will contain an implementation of http://www-jcsu.jesus.cam.ac.uk/~csr21/papers/lightning/lightning.html#htoc4 Is that what you are looking for? Bruno |
From: Reini U. <ru...@x-...> - 2004-09-21 22:51:16
|
Bruno Haible schrieb: > Reini Urban writes: >>[1]> (make-package :km :case-sensitive t) >>#<PACKAGE KM> >>[2]> (in-package :km) >>#<PACKAGE KM> >>KM[3]> (defun xx ()(print 'ok)) > > The next clisp version will contain an implementation of > http://www-jcsu.jesus.cam.ac.uk/~csr21/papers/lightning/lightning.html#htoc4 > > Is that what you are looking for? Yes. I thought clisp already has this described implementation from your presentation, since it is in the impnotes: (make-package :case-sensitive t) I see for example that the new ffi'ed WIN32 package successfully uses it. I'd need exactly the same. |
From: Reini U. <ru...@x-...> - 2004-09-21 12:02:10
|
Hoehle, Joerg-Cyril schrieb: > Reini Urban wrote: >>>>CL-USER> (make-package :km :case-sensistive t) >>>>CL-USER> (in-package :km) >>>>EVAL: undefined function in-package > >>Maybe I should downcase all existing symbols, [...] > Hmm... > >>(make-package :km :case-sensistive t) > > If you intend to use CL symbols there, add :use "COMMON-LISP" I read in CLHS that :use "COMMON-LISP" is the default. Now I defined it explicitly. I also switched to defpackage. > Inside KM, either of these work for me: > o explicit cl: package prefix, with lower case as usual > o uppercase -- which people will probably find ugly. Yes, that's the problem. But I found a workaround. ;;; (cl:load (cl:translate-logical-pathname "ai:kb;km;km-2-0-9-packaged")) (defpackage "KM" ;; #+clisp (:case-sensitive t) (:use "COMMON-LISP") (:export "km")) (cl:in-package :km) ;;; shs suggested this: ;;;#+clisp (cl:setf (cl:readtable-case cl:*readtable*) :invert) #+clisp (cl:use-package :common-lisp) ...and so on... ;;; KM package is now the current package (defconstant *km-package* *package*) The case-sensitive package feature (despites brunos 2004 talk), seems to be not that what I want. The explicit symbol generation later on in the read-eval-print loop is case-preservant, so it's basically the same as (:case-sensitive t), but without affecting case of imported packages. So this works fine now: > (a Car) Car1 > (Car has (superclasses (Vehicle))) > [52]> (make-package :km :case-sensitive t :use "CL") > #<PACKAGE KM> > [53]> (in-package"KM") > #<PACKAGE KM> > KM[54]> (apropos"defun") > *** - EVAL: undefined function apropos > [...] > > Break 1 KM[55]> (cl:describe cl:*package*) > #<PACKAGE KM> is the package named KM. > It imports the external symbols of 1 package COMMON-LISP and exports no > symbols, but no package uses these exports. > Break 1 KM[55]> :q > > KM[56]> (APROPOS"defun") > CUSTOM:*DEFUN-ACCEPT-SPECIALIZED-LAMBDA-LIST* variable > SYSTEM::C-DEFUN function > DEFUN macro > SYSTEM::IN-DEFUN > SYSTEM::IN-DEFUN-P function -- Reini Urban http://xarch.tu-graz.ac.at/home/rurban/ |
From: Paul F. D. <di...@dl...> - 2004-09-21 12:16:29
|
Reini Urban wrote: > Hoehle, Joerg-Cyril schrieb: > >> Reini Urban wrote: >> Hmm... >> >>> (make-package :km :case-sensistive t) >> >> >> If you intend to use CL symbols there, add :use "COMMON-LISP" > > > I read in CLHS that :use "COMMON-LISP" is the default. > Now I defined it explicitly. I also switched to defpackage. Where did you read that? On the page for MAKE-PACKAGE: use---a list of package designators. The default is implementation-defined. Paul |
From: Reini U. <ru...@x-...> - 2004-09-21 12:19:47
|
Paul F. Dietz schrieb: > Reini Urban wrote: >> Hoehle, Joerg-Cyril schrieb: >>> Reini Urban wrote: >>> Hmm... >>>> (make-package :km :case-sensistive t) >>> >>> If you intend to use CL symbols there, add :use "COMMON-LISP" >> >> I read in CLHS that :use "COMMON-LISP" is the default. >> Now I defined it explicitly. I also switched to defpackage. > > Where did you read that? On the page for MAKE-PACKAGE: > > use---a list of package designators. The default is > implementation-defined. Sorry, it was in the impnotes: http://clisp.cons.org/impnotes/pack-dict.html#make-pack -- Reini Urban http://xarch.tu-graz.ac.at/home/rurban/ |