[plt-scheme] Errors from Snooze Quick Start

From: Henk Boom (lunarc.lists at gmail.com)
Date: Tue Jan 6 19:49:51 EST 2009

2009/1/6 Henk Boom <lunarc.lists at gmail.com>:
> 2009/1/6 Dave Gurnell <d.j.gurnell at gmail.com>:
>> This has always bugged me.
>> I've been working on an SQL language for Mirrors, to give people the ability
>> to create SQL without all the ERA trappings of Snooze. I thought about this
>> problem again and I came up with a tentative solution.
>> The Mirrors language as it stands will have a define-table macro, which is
>> basically like define-persistent-struct:
>>   (define-table person
>>     ([name ...]
>>      [age  ...]))
>> One you have defined a table, you can access the run-time metadata using the
>> identifier without parentheses:
>>   (table-name person)    ; ==> symbol
>>   (table-columns person) ; ==> (listof column)
>>   ; and so on ...
>> but if you use my-table with parentheses, you get what is effectively an
>> alias for use in queries:
>>   (person)               ; ==> table-alias
>>   (person name)          ; ==> column-alias
>>   (sql (select #:from (my-table)))
> That could work, but why not allow the use of the accessors directly?
> It seems that that would be much simpler.

I quoted so much here I'm not sure it's clear what I was referring to.
What I was suggesting is that rather than using person-name as an
accessor and (person name) as an alias, you allow the use of
person-name as both a structure accessor and as an sql column alias. I
think that would be much clearer to use.


Posted on the users mailing list.