query type of an instance

Stephen Compall s11@member.fsf.org
Fri Dec 14 03:08:00 GMT 2007


On Thu, 2007-12-13 at 15:23 -0800, John Whittaker wrote:
> Finally, what all this is really leading up to is a
> bigger Kawa and Scheme macro question.  I'd like to
> have a macro (maybe a function would do as well)which
> I will call "with-result-set" (perhaps
> "collect-result-set" would be better).  You would give
> it a result set instance (say a
> sun.jdbc.odbc.JdbcOdbcResult) and a variable number of
> pairs consisting of a type and a field name.  So an
> invocation might look like (with-result-set my-rs
> '(String "Field1") '(Float "Field2") ...).  It would
> return a list of lists of all those fields in the
> result set: (("abc" 42) ("def" 56.2) ...).

Actually you could do this the way you have written it as a simple
function.  You could simply choose the method to call at runtime based
on the car of each field spec.

Syntax would help you if you wanted to add more, like binding variables
in an implicit or explicit loop, possibly named after the SQL fields,
with Kawa variable types inferred from the car.

-- 
Our last-ditch plan is to change the forums into a podcast, then send
RSS feeds into the blogosphere so our users can further debate the
legality of mashups amongst this month's 20 'sexiest' gadgets.
        --Richard "Lowtax" Kyanka
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://sourceware.org/pipermail/kawa/attachments/20071214/d17e581d/attachment.sig>


More information about the Kawa mailing list