[Cl-perec-devel] Bug with accessors to boolean field.
Levente Mészáros
levente.meszaros at gmail.com
Tue Oct 13 08:18:01 UTC 2009
As for the setup of #t and #f and other special syntaxes see the
function setup-readtable in configuration.lisp and its use in the asd
files.
levy
ps: The newly refactored code at dwim.hu does this somewhat simpler
(and may be simplified even further).
On Tue, Oct 13, 2009 at 12:17 AM, Mihai Bazon <mihai at bazon.net> wrote:
> 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
> _______________________________________________
> Cl-perec-devel mailing list
> Cl-perec-devel at common-lisp.net
> http://common-lisp.net/cgi-bin/mailman/listinfo/cl-perec-devel
>
--
There's no perfectoin
More information about the cl-perec-devel
mailing list