[elephant-devel] Problem with Elephant and BTree access
Robert L. Read
read at robertlread.net
Fri Jan 6 02:40:04 UTC 2006
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.
On Thu, 2006-01-05 at 17:01 -0500, Waldo Rubinstein wrote:
> Hi,
>
> I'm starting to use BTrees in elephant and am encountering a problem.
> Basically, I added a BTree object to the root under a key named
> "EDI-834-TAPES". I can retrieve the BTree object, but when I try to
> access a BTree element (whether to read or write), I get an error.
> See below:
>
> CL-USER> (in-package ele)
> #<Package "ELEPHANT">
> ELE> (open-store "testdb")
> #<BDB-STORE-CONTROLLER #x8A5C816>
> ELE> (setf tapes (get-from-root "EDI-834-TAPES"))
> #<BTREE #x8A5805E>
> ELE> (get-value 1234 tapes)
> CL-USER> (in-package ele)
> #<Package "ELEPHANT">
> ELE> (open-store "testdb")
> #<BDB-STORE-CONTROLLER #x8A5C816>
> ELE> (setf tapes (get-from-root "EDI-834-TAPES"))
> #<BTREE #x8A5805E>
> ELE> (get-value 1234 tapes)
>
> No applicable method for args:
> (1234 #<BTREE #x8A5805E>)
> to #<STANDARD-GENERIC-FUNCTION GET-VALUE #x84146AE>
> [Condition of type SIMPLE-ERROR]
>
> Restarts:
> 0: [ABORT-REQUEST] Abort handling SLIME request.
> 1: [ABORT-BREAK] Reset this process
> 2: [ABORT] Kill this process
>
> Backtrace:
> 0: (#<CCL::STANDARD-KERNEL-METHOD NO-APPLICABLE-METHOD (T)>
> #<STANDARD-GENERIC-FUNCTION GET-VALUE #x84146AE>)
> 1: (CCL::CALL-CHECK-REGS 'GET-VALUE)
>
> Basically, the last statement (get-value) should return NIL since
> there is not BTree element within the BTree object.
>
> What am I doing wrong? I tried to "mimic" as close as possible the
> steps in the Blog tutorial but keep getting to the same problem.
>
> Thanks,
> Waldo
> _______________________________________________
> elephant-devel site list
> elephant-devel at common-lisp.net
> http://common-lisp.net/mailman/listinfo/elephant-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/elephant-devel/attachments/20060105/cbfd6e08/attachment.html>
-------------- next part --------------
; printed 11 notes
#<PACKAGE "ELEPHANT-TESTS">
ELE-TESTS> (open-store "../tests/testdb")
#<BDB-STORE-CONTROLLER {A18C361}>
ELE-TESTS> (setq bt (make-btree))
#<BDB-BTREE {A3770B9}>
ELE-TESTS> (add-to-root "EDI-834-TAPES" bt)
#<BDB-BTREE {A3770B9}>
ELE-TESTS> (get-value 1234 tapes)
; Evaluation aborted
ELE-TESTS> (setf tapes (get-from-root "EDI-834-TAPES"))
; in: LAMBDA NIL
; (SETF ELEPHANT-TESTS::TAPES (ELEPHANT:GET-FROM-ROOT "EDI-834-TAPES"))
; ==>
; (SETQ ELEPHANT-TESTS::TAPES (ELEPHANT:GET-FROM-ROOT "EDI-834-TAPES"))
;
; caught WARNING:
; undefined variable: TAPES
;
; caught WARNING:
; This variable is undefined:
; TAPES
;
; compilation unit finished
; caught 2 WARNING conditions
#<BDB-BTREE {A3770B9}>
ELE-TESTS> (get-value 1234 tapes)
NIL
NIL
ELE-TESTS> (open-store "../tests/testdb")
#<BDB-STORE-CONTROLLER {A5BA8F1}>
ELE-TESTS> (setf tapes (get-from-root "EDI-834-TAPES"))
; in: LAMBDA NIL
; (SETF ELEPHANT-TESTS::TAPES (ELEPHANT:GET-FROM-ROOT "EDI-834-TAPES"))
; ==>
; (SETQ ELEPHANT-TESTS::TAPES (ELEPHANT:GET-FROM-ROOT "EDI-834-TAPES"))
;
; caught WARNING:
; undefined variable: TAPES
;
; caught WARNING:
; This variable is undefined:
; TAPES
;
; compilation unit finished
; caught 2 WARNING conditions
#<BDB-BTREE {A5D6AD9}>
ELE-TESTS> (get-value 1234 tapes)
NIL
NIL
ELE-TESTS>
More information about the elephant-devel
mailing list