Changeset 2594
- Timestamp:
- 02/22/08 13:39:15 (9 months ago)
- Files:
-
- trunk/bknr/datastore/doc/Makefile (modified) (1 diff)
- trunk/bknr/datastore/doc/indices.tex (modified) (2 diffs)
- trunk/bknr/datastore/src/indices/tutorial.lisp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/bknr/datastore/doc/Makefile
r969 r2594 1 PBOOK=../../tools/pbook.py 2 1 3 all: manual.pdf 2 4 3 5 manual.pdf: manual.tex introduction.tex guidedtour.tex indices2.tex datastore2.tex impex2.tex 4 6 pdflatex manual && pdflatex manual 5 cp manual.pdf /home/manuel/public_html/7 cp manual.pdf ../../../projects/bknr-website/pdf/ 6 8 7 9 indices2.tex: ../src/indices/tutorial.lisp 8 /usr/local/bin/pbook.py-c BknrTexFile -t "BKNR Indices" -o indices2.tex ../src/indices/tutorial.lisp10 $(PBOOK) -c BknrTexFile -t "BKNR Indices" -o indices2.tex ../src/indices/tutorial.lisp 9 11 10 12 datastore2.tex: ../src/data/tutorial.lisp 11 /usr/local/bin/pbook.py-c BknrTexFile -t "BKNR Datastore" -o datastore2.tex ../src/data/tutorial.lisp13 $(PBOOK) -c BknrTexFile -t "BKNR Datastore" -o datastore2.tex ../src/data/tutorial.lisp 12 14 13 15 impex2.tex: ../src/xml-impex/tutorial.lisp 14 /usr/local/bin/pbook.py-c BknrTexFile -t "BKNR XML Import/Export" -o impex2.tex ../src/xml-impex/tutorial.lisp16 $(PBOOK) -c BknrTexFile -t "BKNR XML Import/Export" -o impex2.tex ../src/xml-impex/tutorial.lisp 15 17 16 18 clean: trunk/bknr/datastore/doc/indices.tex
r999 r2594 449 449 \begin{Verbatim}[fontsize=\small,frame=leftline,framerule=0.9mm,rulecolor=\color{gray},framesep=5.1mm,xleftmargin=5mm,fontfamily=cmtt] 450 450 (defvar *class-index* 451 (index-create 'class-index :index-subclasses t)) 451 (index-create 'class-index :index-subclasses t :slot-name 'id)) 452 (defvar *object-id* 0) 452 453 453 454 (defclass base-object () 454 ( )455 ((id :initform (incf *object-id*))) 455 456 (:metaclass indexed-class) 456 457 (:class-indices (class :index *class-index* 457 :slots nil458 458 :index-reader objects-of-class 459 459 :index-values all-objects … … 462 462 (classes :index-type class-index 463 463 :index-initargs (:index-superclasses t) 464 :slots nil464 :slots (id) 465 465 :index-subclasses t 466 466 :index-reader objects-with-class))) trunk/bknr/datastore/src/indices/tutorial.lisp
r2584 r2594 118 118 ;;; 119 119 ;;; Using the `INDEXED-CLASS', we can redefine our gorilla example. 120 121 ;;; Before we are able to refine GORILLA with a new metaclass, we need 122 ;;; to delete the old class definition: 123 124 (setf (find-class 'gorilla) nil) 120 125 121 126 (defclass gorilla () … … 130 135 :index-reader gorillas-with-description)) 131 136 (:metaclass indexed-class)) 137 138 (defmethod print-object ((gorilla gorilla) stream) 139 (print-unreadable-object (gorilla stream :type t) 140 (format stream "~S" (gorilla-name gorilla)))) 132 141 133 142 ;;; We have to recreate the gorillas though, as the old instances … … 419 428 ; => #<TEST-CLASS2 5,5,0> 420 429 430 #| 431 432 ;;; XXX the class index tutorial needs updating, please skip to next section! 433 421 434 ;;; Another example of a class index is the `CLASS-INDEX' index. 422 435 … … 475 488 ; => NIL 476 489 ; NIL 490 |# 477 491 478 492 ;;;## Destroying objects … … 485 499 486 500 (let ((obj (test-with-coords '(5 5 0)))) 487 (destroy-object obj))501 (destroy-object obj) 488 502 489 503 ;;; This will throw an error. 490 504 ;;; 491 505 492 (test-class-x obj)506 (test-class-x obj)) 493 507 494 508 ;;;## Class and object reinitialization
