[plt-scheme] Errors from Snooze Quick Start

From: Henk Boom (lunarc.lists at gmail.com)
Date: Tue Jan 6 18:17:26 EST 2009

2009/1/6 Dave Gurnell <d.j.gurnell at gmail.com>:
> Damn - sorry - that's a typo. You want "entity:person" in that case rather
> than "person".

Cool, with that fix the only hitch I ran into was that the sqlite3
version of make-database seems to expect a path, and not a string as
the Quick Start suggests.

> define-persistent-struct binds "person" to the same sort of thing
> "define-struct" creates - its expansion-time value contains useful
> information but it's basically useless at run time. define-persistent-struct
> also binds "entity:person" to a struct containing metadata to use at run
> time. All the macros in Snooze use "person" and the procedures use
> "entity:person". For example you have:
>  (define-alias p person)
> but you have:
>  (create-table entity:person)
> It's ugly but when I wrote the code I didn't know how to do it any other way
> (suggestions for improvement would be much appreciated).

I see, I've been thinking that it would be convenient for the
structure syntax to expand to dynamic structure information when used
as an expression. This is one place that would be useful.

> Anyway the docs are clearly wrong, which is my bad. I'll run through the
> quick start and correct it and post to this thread when I'm done. Feel free
> to contact me off-list if you need specific advice.

This is more of a general question, not related to the quick start, so
I guess the list is still the right place. Is there a way to avoid
having two sets of names for each data type? I can see that person1 is
used to prevent the names from conflicting with the structure
accessors, but it's confusing to have to remember the differences
between person and person1.

On the other hand, if we really need the two sets of names in every
case, why not have define-persistent-struct generate the alias
automatically, using a consistent naming convention? (e.g. person:,
person:id, person:revision, etc.)


Posted on the users mailing list.