Lisp Package Name Prepending Itself to my data without me telling it to -


This is my first time working with packages in lisp. I have general summaries that they can be used as data and code How do it work similar to other languages, I do not have to worry about the differences yet.

However, I'm running into a problem where I set something in my code:

  (setf baseNames' (coffee wax blue pepper sink green soya blanched garden ))   

It will come out later:

  (print base-names) (PIZZabel :: COFFEEE PIZZABAGEL :: WAX PIZZABAGEL :: BLUE PIZZABAGEL :: CHILI PIZZABAGEL :: STINK PIZZABAGEL :: GREEN   

PIZZABAGEL :: SOY PIZZABAGEL :: BLACKEYED PIZZABAGEL :: Garden)

Pizza Bagel is the name of my package Is this normal behavior? Suppose I want to do something like this:

  (position 'wax base-name)   

I expected that it would return 1, but the package I am prepaid myself by name, it gives zero, I want to know how i can not make it everywhere, or b) What is normal practice for working with this? I am currently writing the work of my position which I hope is handling this matter, but it appears that there is a wrong view to do this in this situation. Thanks in advance for any tips or pointers, which you can provide.

There are some package confusions in what you are running.

Whenever you read a symbol with the reader, then the package name of the current package is symbolically inherited.

You can show it here:

  1] & gt; (Setf Besanem '(Coffee Wax Blue Chili Sink Green Soya Blaked Garden)) (Kofi wax blue pepper stunts green soy blackhead garden) [2] & gt; (Export 'basename) t [3] & gt; (Defpackage (therefore: Use cl user cl)) # & lt; Package SO & gt; [4] & gt; (Package is in) # & lt; Package SO & gt; So [5] & gt; (Print bassname) (Common-Lip-User :: Coffee Commons-Lip-User: Wax Common-Lip-User :: Blue Comon-Lip-User :: Chile Comon-Lip-User :: Senate Commons-Lip-User :: Common COMMON-LISP-USER :: SOY COMMON-LISP-USER :: Blackhead Comon-Lip-User :: Garden) (Common-Lip-User: Coffee Commons-Lip-User: Wax Common-Lip-User :: BLUE COMMON-LISP-USER :: CHILI COMMON-LISP-USER :: STINK COMMON-Lip-User :: Gene Comon-Lip-User :: SOY Common-Lip-User :: BlackAid Commons-Lip-User :: GARDEN)   

By default, you Typically starting in the CL-USER package, here is the case CLISP when it is CL-USER (when you call it SO to SO , when we switch to SO ).

So, anyway, what's happening is that you have narrowed compressed.

Consider:

  SO [6]> (Position 'wax basenames) Zero   

This fails because it is looking for the name of the base in SO :: WAX (because we have the SO package), COMMON-LISP-USER :: WAX no. The list which is in the list is the reason that it fails (the short name / surname for CL-user COMMON-LISP-USER ) < / Div>

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -