[Cl-perec-devel] Bug with accessors to boolean field.

Mihai Bazon mihai at bazon.net
Mon Oct 12 22:17:34 UTC 2009


The default accessors for boolean fields end in "-p", rather than "-of".
So for your example, use (f2-p e).  (I just learned this today ;-)

You can safely use T and NIL instead of #T and #F; these are reader
macros, not sure where they are defined (maybe cl-syntax-sugar) but you
need to import them or :use that package... or just define them
yourself.  I myself prefer sticking with T and NIL.

Cheers,
-Mihai

Valeriy Fedotov <valeriy.fedotov at gmail.com> wrote:
> Hello.
> 
> I think I have found a bug in cl-perec. The following lines in REPL
> reproduce it. (My lisp is SBCL 1.0.29, cl-perec and all required
> libraries are installed via clbuild.)
> 
> (asdf:oos 'asdf:load-op :cl-perec)
> 
> (in-package :cl-perec)
> 
> ;; Then I connect to database, Postgresql in my case.
> 
> (defpclass* example ()
>        ((f1 :type string)
> 	(f2 :type boolean)))
> 
> (with-transaction
>        (make-instance 'example :f1 "123" :f2 t))
> 
> (with-transaction
>        (let ((e (select-instance (e example))))
> 	 (f1-of e)))
> ;; Works fine and returns "123"
> 
> (with-transaction
>        (let ((e (select-instance (e example))))
> 	 (f2-of e)))
> ;; The function F2-OF is undefined.
> ;;    [Condition of type UNDEFINED-FUNCTION]
> 
> PS. By the way, do you rejected #t and #f convection for true and
> false? T and NIL work fine for me, but Pinterface's tutorial and tests
> confused me and I tried get them working.
> 
> -- 
> С уважением, Валерий Федотов.
> 
> _______________________________________________
> Cl-perec-devel mailing list
> Cl-perec-devel at common-lisp.net
> http://common-lisp.net/cgi-bin/mailman/listinfo/cl-perec-devel



More information about the cl-perec-devel mailing list