[elephant-devel] Problem with Elephant and BTree access

Robert L. Read read at robertlread.net
Fri Jan 6 14:07:58 UTC 2006


Wonderful!  You have found a bug in my documentation.  I will fix it
today.




On Fri, 2006-01-06 at 01:59 -0500, Waldo Rubinstein wrote:

> After reading your script, I tried it again in OpenMCL and it worked.  
> See below (but please see further below):
> 
> Welcome to OpenMCL Version 1.0 (DarwinPPC32)!
> ? (in-package :ele)
> #<Package "ELEPHANT">
> ? (open-store "testdb")
> #<BDB-STORE-CONTROLLER #x89CF54E>
> ? (setq bt (make-btree))
> #<BDB-BTREE #x89CD506>
> ? (add-to-root "EDI-834-TAPES" bt)
> #<BDB-BTREE #x89CD506>
> ? (close-store)
> NIL
> ? (setq bt nil)
> NIL
> ? (open-store "testdb")
> #<BDB-STORE-CONTROLLER #x89CC55E>
> ? (setq bt (get-from-root "EDI-834-TAPES"))
> #<BDB-BTREE #x89CBADE>
> ? (get-value 1234 bt)
> NIL
> NIL
> ? (setf (get-value 1234 bt) "My test")
> ;Compiler warnings :
> ;   Undeclared free variable BT, in an anonymous lambda form.
> "My test"
> ? (close-store)
> NIL
> ? (setq bt nil)
> NIL
> ? (open-store "testdb")
> #<BDB-STORE-CONTROLLER #x89C9E36>
> ? (get-value 1234 (get-from-root "EDI-834-TAPES"))
> "My test"
> T
> ? (close-store)
> NIL
> 
> However, when I try it using the format used in the Tutorial, it  
> fails. See below:
> 
> ? (open-store "testdb")
> #<BDB-STORE-CONTROLLER #x89C8DEE>
> ? (setq bt (make-instance 'btree))
> #<BTREE #x89C851E>
> ? (add-to-root "EDI-834-TAPES" bt)
> #<BTREE #x89C851E>
> ? (close-store)
> NIL
> ? (setq bt nil)
> NIL
> ? (open-store "testdb")
> #<BDB-STORE-CONTROLLER #x89C7BAE>
> ? (setq bt (get-from-root "EDI-834-TAPES"))
> #<BTREE #x89C7256>
> ? (get-value 1234 bt)
>  > Error in process listener(1): No applicable method for args:
>  >                                (1234 #<BTREE #x89C7256>)
>  >                                to #<STANDARD-GENERIC-FUNCTION GET- 
> VALUE #x84146AE>
>  > While executing: #<CCL::STANDARD-KERNEL-METHOD NO-APPLICABLE- 
> METHOD (T)>
>  > Type :POP to abort.
> Type :? for other options.
> 1 >
> 
> The main difference is the way the BTree class is created. In the  
> tutorial, it says to use (make-instance 'btree). In your script,  
> which worked, you suggest to use (make-btree). Apparently, these are  
> two different CLOS classes. I believe that the tutorial is then  
> somehow inaccurate.
> 
> Thanks,
> Waldo
> 
> On Jan 5, 2006, at 9:40 PM, Robert L. Read wrote:
> 
> > This works for me under SBCL; please see the attached typescript.
> >
> > I can't conjecture what the problem might be; is the script you  
> > show below everything?
> > Are the packages changes somehow done in a visual environment and  
> > there for not showing?
> > Try running through my script and let me know what the results are,  
> > if this is still a problem for you.
> >
> <snip>
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/elephant-devel/attachments/20060106/70206f37/attachment.html>


More information about the elephant-devel mailing list