[postmodern-devel] Unbound slots on nullable values?

Mikko Ahonen mikko.ahonen at iki.fi
Tue Mar 18 22:14:11 UTC 2008


Hello,

Actually my definition had (:or integer db-null), but Ryan's
suggestion made sense, as he recommended me to use :initform to define
default NULL values for fields which I do not want to define manually.

I think just documenting this behavior is fine. If the doc would say
something like "all fields must have value when saving object, if you
want to have NULL value, please use :initform to set it to NULL by
default" it would be OK.

Ryan's tip led me to the solution, but with a twist: "nil" should be
":null". "nil" is parsed (at least for SQL integers but probably
others) into boolean value false, while ":null" to NULL.

I also had some problems with deftable with long (over 80 characters
long) lines.

I will try the darcs version.

Thanks for the help!

Best regards,

Mikko Ahonen

On Tue, Mar 18, 2008 at 8:43 PM, Marijn Haverbeke <marijnh at gmail.com> wrote:
> Hello Mikko,
>
>  As Ryan mentioned, you have to use (:or db-null integer) to specify a
>  regular integer field, since it will default to "NOT NULL". Also, if
>  you are just starting to use the library, it is probably a better idea
>  to get the current code from the darcs repository -- I'm about to
>  release a new version with a slightly changed interface, and one of
>  the changes is that the defclass macro is replaced by a dao-class
>  metaclass, which handles unbound slots in a much nicer way. The
>  repository contains docs which are updated for that version, and is
>  not expected to change much before the 1.10 release. (I don't usually
>  break backwards compatibility, but there were a few issues that
>  required cleaning up, so 1.10 will.)
>
>  On the subject of 1.10 -- has anyone apart from Attila tried the
>  current code yet?
>
>  Cheers,
>  Marijn
>
>
> _______________________________________________
>  postmodern-devel mailing list
>  postmodern-devel at common-lisp.net
>  http://common-lisp.net/cgi-bin/mailman/listinfo/postmodern-devel
>



More information about the postmodern-devel mailing list