Artifact b05f4ba4b6560b02fd133333b25b43e623f48359:


0000: 3b 3b 20 43 6f 70 79 72 69 67 68 74 20 32 30 30  ;; Copyright 200
0010: 37 2d 32 30 30 38 2c 20 4d 61 74 74 68 65 77 20  7-2008, Matthew 
0020: 57 65 6c 6c 61 6e 64 2e 20 4b 69 61 74 6f 61 2e  Welland. Kiatoa.
0030: 63 6f 6d 20 41 6c 6c 20 72 69 67 68 74 73 20 72  com All rights r
0040: 65 73 65 72 76 65 64 2e 0a 3b 3b 20 0a 0a 3b 3b  eserved..;; ..;;
0050: 20 44 4f 4e 27 54 20 55 53 45 20 54 48 49 53 21   DON'T USE THIS!
0060: 21 21 21 20 49 74 20 77 61 73 20 61 20 62 61 64  !!! It was a bad
0070: 20 69 64 65 61 20 3a 2d 28 0a 0a 3b 3b 20 49 66   idea :-(..;; If
0080: 20 70 65 72 66 6f 72 6d 61 6e 63 65 20 62 65 63   performance bec
0090: 6f 6d 65 73 20 61 6e 20 69 73 73 75 65 20 75 70  omes an issue up
00a0: 67 72 61 64 65 20 74 68 69 73 20 74 6f 20 75 73  grade this to us
00b0: 65 20 61 20 76 65 63 74 6f 72 20 74 6f 20 0a 0a  e a vector to ..
00c0: 28 72 65 71 75 69 72 65 2d 65 78 74 65 6e 73 69  (require-extensi
00d0: 6f 6e 20 74 69 6e 79 63 6c 6f 73 29 0a 0a 28 64  on tinyclos)..(d
00e0: 65 66 69 6e 65 2d 63 6c 61 73 73 20 3c 73 71 6c  efine-class <sql
00f0: 74 62 6c 3e 20 28 29 0a 20 20 28 72 6f 77 73 0a  tbl> ().  (rows.
0100: 20 20 20 66 69 65 6c 64 73 20 20 20 20 20 20 20     fields       
0110: 3b 3b 20 6c 69 73 74 20 6f 66 20 66 69 65 6c 64  ;; list of field
0120: 0a 20 20 20 66 69 65 6c 64 73 2d 68 61 73 68 20  .   fields-hash 
0130: 20 3b 3b 20 68 61 73 68 20 6f 66 20 66 69 65 6c   ;; hash of fiel
0140: 64 73 20 2d 3e 20 6e 75 6d 62 65 72 0a 20 20 20  ds -> number.   
0150: 71 75 65 72 79 20 20 20 20 20 20 20 20 3b 3b 20  query        ;; 
0160: 71 75 65 72 79 20 73 74 72 69 6e 67 20 75 73 69  query string usi
0170: 6e 67 20 3f 27 73 0a 20 20 20 71 75 65 72 79 2d  ng ?'s.   query-
0180: 70 61 72 61 6d 73 20 3b 3b 20 6c 69 73 74 20 6f  params ;; list o
0190: 66 20 70 61 72 61 6d 73 20 66 6f 72 20 74 68 65  f params for the
01a0: 20 71 75 65 72 79 0a 20 20 20 63 6f 6e 6e 20 20   query.   conn  
01b0: 20 20 20 20 20 20 20 3b 3b 20 63 6f 6e 6e 65 63         ;; connec
01c0: 74 69 6f 6e 20 74 6f 20 64 62 0a 20 20 20 6e 75  tion to db.   nu
01d0: 6d 2d 72 6f 77 73 20 20 20 20 20 3b 3b 20 77 68  m-rows     ;; wh
01e0: 61 74 65 76 65 72 20 0a 20 20 20 63 75 72 72 2d  atever .   curr-
01f0: 72 6f 77 2d 70 74 72 20 3b 3b 20 6e 75 6d 62 65  row-ptr ;; numbe
0200: 72 20 6f 66 20 74 68 65 20 63 75 72 72 65 6e 74  r of the current
0210: 20 72 6f 77 0a 20 20 20 63 75 72 72 2d 72 6f 77   row.   curr-row
0220: 20 20 20 20 20 3b 3b 20 74 68 65 20 63 75 72 72       ;; the curr
0230: 65 6e 74 20 72 6f 77 20 76 65 63 74 6f 72 20 28  ent row vector (
0240: 3f 3f 20 64 6f 20 77 65 20 72 65 61 6c 6c 79 20  ?? do we really 
0250: 77 61 6e 74 20 74 68 69 73 20 3f 3f 29 0a 20 20  want this ??).  
0260: 20 29 29 0a 0a 28 64 65 66 69 6e 65 2d 6d 65 74   ))..(define-met
0270: 68 6f 64 20 28 69 6e 69 74 69 61 6c 69 7a 65 20  hod (initialize 
0280: 28 73 65 6c 66 20 3c 73 71 6c 74 62 6c 3e 29 20  (self <sqltbl>) 
0290: 69 6e 69 74 61 72 67 73 29 0a 20 20 28 63 61 6c  initargs).  (cal
02a0: 6c 2d 6e 65 78 74 2d 6d 65 74 68 6f 64 29 0a 20  l-next-method). 
02b0: 20 28 73 6c 6f 74 2d 73 65 74 21 20 73 65 6c 66   (slot-set! self
02c0: 20 27 6e 75 6d 2d 72 6f 77 73 20 30 29 0a 20 20   'num-rows 0).  
02d0: 28 73 6c 6f 74 2d 73 65 74 21 20 73 65 6c 66 20  (slot-set! self 
02e0: 27 63 75 72 72 2d 72 6f 77 2d 70 74 72 20 30 29  'curr-row-ptr 0)
02f0: 0a 20 20 28 73 6c 6f 74 2d 73 65 74 21 20 73 65  .  (slot-set! se
0300: 6c 66 20 27 66 69 65 6c 64 73 20 27 28 29 29 0a  lf 'fields '()).
0310: 20 20 28 73 6c 6f 74 2d 73 65 74 21 20 73 65 6c    (slot-set! sel
0320: 66 20 27 66 69 65 6c 64 73 2d 68 61 73 68 20 28  f 'fields-hash (
0330: 6d 61 6b 65 2d 68 61 73 68 2d 74 61 62 6c 65 29  make-hash-table)
0340: 29 0a 20 20 28 69 6e 69 74 69 61 6c 69 7a 65 2d  ).  (initialize-
0350: 73 6c 6f 74 73 20 73 65 6c 66 20 69 6e 69 74 61  slots self inita
0360: 72 67 73 29 29 0a 3b 3b 20 20 28 69 66 20 28 3e  rgs)).;;  (if (>
0370: 20 28 6c 65 6e 67 74 68 20 28 73 6c 6f 74 2d 72   (length (slot-r
0380: 65 66 20 73 65 6c 66 20 27 72 6f 77 73 29 20 30  ef self 'rows) 0
0390: 29 29 0a 3b 3b 20 20 20 20 20 20 28 73 6c 6f 74  )).;;      (slot
03a0: 2d 73 65 74 21 20 73 65 6c 66 20 27 63 75 72 72  -set! self 'curr
03b0: 2d 72 6f 77 20 28 63 61 72 20 72 6f 77 73 29 29  -row (car rows))
03c0: 29 29 0a 0a 28 64 65 66 69 6e 65 2d 6d 65 74 68  ))..(define-meth
03d0: 6f 64 20 28 73 71 6c 74 62 6c 3a 6e 65 78 74 2d  od (sqltbl:next-
03e0: 72 6f 77 20 28 73 65 6c 66 20 3c 73 71 6c 74 62  row (self <sqltb
03f0: 6c 3e 29 29 0a 20 20 28 6c 65 74 20 28 28 63 75  l>)).  (let ((cu
0400: 72 72 2d 72 6f 77 2d 70 74 72 20 28 2b 20 28 73  rr-row-ptr (+ (s
0410: 6c 6f 74 2d 72 65 66 20 73 65 6c 66 20 27 63 75  lot-ref self 'cu
0420: 72 72 2d 72 6f 77 2d 70 74 72 29 20 31 29 29 0a  rr-row-ptr) 1)).
0430: 20 20 20 20 20 20 20 20 28 6e 75 6d 2d 72 6f 77          (num-row
0440: 73 20 20 20 20 20 28 73 6c 6f 74 2d 72 65 66 20  s     (slot-ref 
0450: 73 65 6c 66 20 27 6e 75 6d 2d 72 6f 77 73 29 29  self 'num-rows))
0460: 0a 20 20 20 20 20 20 20 20 28 72 6f 77 73 20 20  .        (rows  
0470: 20 20 20 20 20 20 20 28 73 6c 6f 74 2d 72 65 66         (slot-ref
0480: 20 73 65 6c 66 20 27 72 6f 77 73 29 29 29 0a 20   self 'rows))). 
0490: 20 20 20 28 69 66 20 28 3e 20 63 75 72 72 2d 72     (if (> curr-r
04a0: 6f 77 2d 70 72 74 20 28 73 6c 6f 74 2d 72 65 66  ow-prt (slot-ref
04b0: 20 73 65 6c 66 20 27 6e 75 6d 2d 72 6f 77 73 29   self 'num-rows)
04c0: 29 20 23 66 20 3b 3b 20 74 68 65 72 65 20 69 73  ) #f ;; there is
04d0: 20 6e 6f 20 6e 65 78 74 20 72 6f 77 0a 20 20 20   no next row.   
04e0: 20 20 20 20 20 28 6c 65 74 20 28 28 6e 65 77 2d       (let ((new-
04f0: 63 75 72 72 2d 72 6f 77 20 28 6c 69 73 74 2d 72  curr-row (list-r
0500: 65 66 20 72 6f 77 73 20 63 75 72 72 2d 72 6f 77  ef rows curr-row
0510: 2d 70 74 72 29 29 29 0a 20 20 20 20 20 20 20 20  -ptr))).        
0520: 20 20 28 73 6c 6f 74 2d 73 65 74 21 20 73 65 6c    (slot-set! sel
0530: 66 20 27 63 75 72 72 2d 72 6f 77 20 6e 65 77 2d  f 'curr-row new-
0540: 63 75 72 72 2d 72 6f 77 29 0a 20 20 20 20 20 20  curr-row).      
0550: 20 20 20 20 28 73 6c 6f 74 2d 73 65 74 21 20 73      (slot-set! s
0560: 65 6c 66 20 27 63 75 72 72 2d 72 6f 77 2d 70 72  elf 'curr-row-pr
0570: 74 20 63 75 72 72 2d 72 6f 77 2d 70 72 74 29 0a  t curr-row-prt).
0580: 20 20 20 20 20 20 20 20 20 20 6e 65 77 2d 63 75            new-cu
0590: 72 72 2d 72 6f 77 29 29 29 29 0a 0a 3b 3b 20 72  rr-row))))..;; r
05a0: 75 6e 20 74 68 65 20 71 75 65 72 79 20 61 6e 64  un the query and
05b0: 20 66 69 6c 6c 20 74 68 65 20 72 6f 77 73 20 6c   fill the rows l
05c0: 69 73 74 20 0a 28 64 65 66 69 6e 65 2d 6d 65 74  ist .(define-met
05d0: 68 6f 64 20 28 73 71 6c 74 62 6c 3a 72 75 6e 2d  hod (sqltbl:run-
05e0: 71 75 65 72 79 20 28 73 65 6c 66 20 3c 73 71 6c  query (self <sql
05f0: 74 62 6c 3e 29 20 2e 20 70 61 72 61 6d 73 29 0a  tbl>) . params).
0600: 20 20 28 6c 65 74 2a 20 28 28 71 75 65 72 79 20    (let* ((query 
0610: 20 28 73 6c 6f 74 2d 72 65 66 20 73 65 6c 66 20   (slot-ref self 
0620: 27 71 75 65 72 79 29 29 0a 20 20 20 20 20 20 20  'query)).       
0630: 20 20 28 66 69 65 6c 64 73 20 28 73 6c 6f 74 2d    (fields (slot-
0640: 72 65 66 20 73 65 6c 66 20 27 66 69 65 6c 64 73  ref self 'fields
0650: 29 29 0a 20 20 20 20 20 20 20 20 20 28 72 6f 77  )).         (row
0660: 73 20 28 6c 65 74 20 28 28 72 65 73 75 6c 74 20  s (let ((result 
0670: 27 28 29 29 0a 20 20 20 20 20 20 20 20 20 20 20  '()).           
0680: 20 20 20 20 20 20 20 20 20 20 28 61 63 74 75 61            (actua
0690: 6c 2d 71 75 65 72 79 20 28 61 70 70 6c 79 20 73  l-query (apply s
06a0: 3a 73 71 6c 70 61 72 61 6d 20 71 75 65 72 79 20  :sqlparam query 
06b0: 66 69 65 6c 64 73 20 70 61 72 61 6d 73 29 29 29  fields params)))
06c0: 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20  .               
06d0: 20 20 3b 3b 20 28 73 3a 6c 6f 67 20 22 61 63 74    ;; (s:log "act
06e0: 75 61 6c 2d 71 75 65 72 79 3d 22 20 61 63 74 75  ual-query=" actu
06f0: 61 6c 2d 71 75 65 72 79 29 0a 20 20 20 20 20 20  al-query).      
0700: 20 20 20 20 20 20 20 20 20 20 20 28 64 62 69 3a             (dbi:
0710: 66 6f 72 2d 65 61 63 68 2d 72 6f 77 20 28 6c 61  for-each-row (la
0720: 6d 62 64 61 20 28 74 75 70 6c 65 29 0a 20 20 20  mbda (tuple).   
0730: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
0740: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
0750: 20 20 20 28 73 65 74 21 20 72 65 73 75 6c 74 20     (set! result 
0760: 28 63 6f 6e 73 20 74 75 70 6c 65 20 72 65 73 75  (cons tuple resu
0770: 6c 74 29 29 29 0a 20 20 20 20 20 20 20 20 20 20  lt))).          
0780: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
0790: 20 20 20 20 20 20 20 20 20 20 28 73 6c 6f 74 2d            (slot-
07a0: 72 65 66 20 73 65 6c 66 20 27 63 6f 6e 6e 29 0a  ref self 'conn).
07b0: 09 09 09 09 61 63 74 75 61 6c 2d 71 75 65 72 79  ....actual-query
07c0: 29 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20  ).              
07d0: 20 20 20 28 73 6c 6f 74 2d 73 65 74 21 20 73 65     (slot-set! se
07e0: 6c 66 20 27 71 75 65 72 79 2d 70 61 72 61 6d 73  lf 'query-params
07f0: 20 70 61 72 61 6d 73 29 0a 20 20 20 20 20 20 20   params).       
0800: 20 20 20 20 20 20 20 20 20 20 28 73 6c 6f 74 2d            (slot-
0810: 73 65 74 21 20 73 65 6c 66 20 27 6e 75 6d 2d 72  set! self 'num-r
0820: 6f 77 73 20 28 6c 65 6e 67 74 68 20 72 65 73 75  ows (length resu
0830: 6c 74 29 29 0a 20 20 20 20 20 20 20 20 20 20 20  lt)).           
0840: 20 20 20 20 20 20 28 73 71 6c 74 62 6c 3a 73 65        (sqltbl:se
0850: 74 75 70 2d 66 69 65 6c 64 73 20 73 65 6c 66 29  tup-fields self)
0860: 20 20 3b 3b 20 75 70 64 61 74 65 20 74 68 65 20    ;; update the 
0870: 66 69 65 6c 64 73 20 6c 6f 6f 6b 75 70 20 68 61  fields lookup ha
0880: 73 68 0a 20 20 20 20 20 20 20 20 20 20 20 20 20  sh.             
0890: 20 20 20 20 28 72 65 76 65 72 73 65 20 72 65 73      (reverse res
08a0: 75 6c 74 29 29 29 29 0a 20 20 20 20 28 73 6c 6f  ult)))).    (slo
08b0: 74 2d 73 65 74 21 20 73 65 6c 66 20 27 72 6f 77  t-set! self 'row
08c0: 73 20 72 6f 77 73 29 0a 20 20 20 20 28 69 66 20  s rows).    (if 
08d0: 28 6e 6f 74 20 28 6e 75 6c 6c 3f 20 72 6f 77 73  (not (null? rows
08e0: 29 29 0a 20 20 20 20 20 20 20 20 28 73 6c 6f 74  )).        (slot
08f0: 2d 73 65 74 21 20 73 65 6c 66 20 27 63 75 72 72  -set! self 'curr
0900: 2d 72 6f 77 20 28 63 61 72 20 72 6f 77 73 29 29  -row (car rows))
0910: 29 0a 20 20 20 20 28 73 6c 6f 74 2d 73 65 74 21  ).    (slot-set!
0920: 20 73 65 6c 66 20 27 63 75 72 72 2d 72 6f 77 2d   self 'curr-row-
0930: 70 74 72 20 30 29 0a 20 20 20 20 72 6f 77 73 29  ptr 0).    rows)
0940: 29 0a 0a 28 64 65 66 69 6e 65 2d 6d 65 74 68 6f  )..(define-metho
0950: 64 20 28 73 71 6c 74 62 6c 3a 73 65 74 75 70 2d  d (sqltbl:setup-
0960: 66 69 65 6c 64 73 20 28 73 65 6c 66 20 3c 73 71  fields (self <sq
0970: 6c 74 62 6c 3e 29 29 0a 20 20 28 6c 65 74 20 28  ltbl>)).  (let (
0980: 28 66 69 65 6c 64 73 2d 68 61 73 68 20 28 73 6c  (fields-hash (sl
0990: 6f 74 2d 72 65 66 20 73 65 6c 66 20 27 66 69 65  ot-ref self 'fie
09a0: 6c 64 73 2d 68 61 73 68 29 29 0a 20 20 20 20 20  lds-hash)).     
09b0: 20 20 20 28 66 69 65 6c 64 73 2d 6c 69 73 74 20     (fields-list 
09c0: 28 73 6c 6f 74 2d 72 65 66 20 73 65 6c 66 20 27  (slot-ref self '
09d0: 66 69 65 6c 64 73 29 29 29 0a 20 20 20 20 28 6c  fields))).    (l
09e0: 65 74 20 6c 6f 6f 70 20 28 28 68 65 61 64 20 28  et loop ((head (
09f0: 63 61 72 20 66 69 65 6c 64 73 2d 6c 69 73 74 29  car fields-list)
0a00: 29 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20  ).              
0a10: 20 28 74 61 69 6c 20 28 63 64 72 20 66 69 65 6c   (tail (cdr fiel
0a20: 64 73 2d 6c 69 73 74 29 29 0a 20 20 20 20 20 20  ds-list)).      
0a30: 20 20 20 20 20 20 20 20 20 28 66 6e 75 6d 20 30           (fnum 0
0a40: 29 29 0a 20 20 20 20 20 20 28 68 61 73 68 2d 74  )).      (hash-t
0a50: 61 62 6c 65 2d 73 65 74 21 20 66 69 65 6c 64 73  able-set! fields
0a60: 2d 68 61 73 68 20 68 65 61 64 20 66 6e 75 6d 29  -hash head fnum)
0a70: 0a 20 20 20 20 20 20 28 69 66 20 28 6e 75 6c 6c  .      (if (null
0a80: 3f 20 74 61 69 6c 29 20 66 6e 75 6d 0a 20 20 20  ? tail) fnum.   
0a90: 20 20 20 20 20 20 20 28 6c 6f 6f 70 20 28 63 61         (loop (ca
0aa0: 72 20 74 61 69 6c 29 28 63 64 72 20 74 61 69 6c  r tail)(cdr tail
0ab0: 29 28 2b 20 66 6e 75 6d 20 31 29 29 29 29 29 29  )(+ fnum 1))))))
0ac0: 0a 0a 3b 3b 20 67 65 74 20 61 20 76 61 6c 75 65  ..;; get a value
0ad0: 20 66 72 6f 6d 20 74 68 65 20 63 75 72 72 65 6e   from the curren
0ae0: 74 20 72 6f 77 0a 28 64 65 66 69 6e 65 2d 6d 65  t row.(define-me
0af0: 74 68 6f 64 20 28 73 71 6c 74 62 6c 3a 67 65 74  thod (sqltbl:get
0b00: 2d 66 69 65 6c 64 2d 76 61 6c 75 65 2d 63 75 72  -field-value-cur
0b10: 72 20 28 73 65 6c 66 20 3c 73 71 6c 74 62 6c 3e  r (self <sqltbl>
0b20: 29 20 66 69 65 6c 64 29 0a 20 20 28 6c 65 74 20  ) field).  (let 
0b30: 28 28 63 75 72 72 2d 72 6f 77 20 20 28 73 6c 6f  ((curr-row  (slo
0b40: 74 2d 72 65 66 20 73 65 6c 66 20 27 63 75 72 72  t-ref self 'curr
0b50: 2d 72 6f 77 29 29 0a 20 20 20 20 20 20 20 20 28  -row)).        (
0b60: 66 69 65 6c 64 2d 6e 75 6d 20 28 68 61 73 68 2d  field-num (hash-
0b70: 74 61 62 6c 65 2d 72 65 66 2f 64 65 66 61 75 6c  table-ref/defaul
0b80: 74 20 28 73 6c 6f 74 2d 72 65 66 20 73 65 6c 66  t (slot-ref self
0b90: 20 27 66 69 65 6c 64 73 2d 68 61 73 68 29 20 66   'fields-hash) f
0ba0: 69 65 6c 64 20 23 66 29 29 29 0a 20 20 20 20 28  ield #f))).    (
0bb0: 69 66 20 66 69 65 6c 64 2d 6e 75 6d 20 0a 20 20  if field-num .  
0bc0: 20 20 20 20 20 20 28 76 65 63 74 6f 72 2d 72 65        (vector-re
0bd0: 66 20 63 75 72 72 2d 72 6f 77 20 66 69 65 6c 64  f curr-row field
0be0: 2d 6e 75 6d 29 0a 20 20 20 20 20 20 20 20 23 66  -num).        #f
0bf0: 29 29 29 20 3b 3b 20 6e 6f 74 20 66 6f 75 6e 64  ))) ;; not found
0c00: 20 2d 3e 20 23 66 0a 0a 28 64 65 66 69 6e 65 2d   -> #f..(define-
0c10: 6d 65 74 68 6f 64 20 28 73 71 6c 74 62 6c 3a 76  method (sqltbl:v
0c20: 65 63 74 6f 72 2d 3e 68 61 73 68 20 28 73 65 6c  ector->hash (sel
0c30: 66 20 3c 73 71 6c 74 62 6c 3e 29 20 76 65 63 29  f <sqltbl>) vec)
0c40: 0a 20 20 28 6c 65 74 20 28 28 68 20 20 20 20 20  .  (let ((h     
0c50: 20 28 6d 61 6b 65 2d 68 61 73 68 2d 74 61 62 6c   (make-hash-tabl
0c60: 65 29 29 0a 20 20 20 20 20 20 20 20 28 66 69 65  e)).        (fie
0c70: 6c 64 73 20 28 73 6c 6f 74 2d 72 65 66 20 73 65  lds (slot-ref se
0c80: 6c 66 20 27 66 69 65 6c 64 73 29 29 29 0a 20 20  lf 'fields))).  
0c90: 20 20 28 64 6f 20 28 28 69 20 30 20 28 2b 20 69    (do ((i 0 (+ i
0ca0: 20 31 29 29 29 0a 20 20 20 20 20 20 20 20 28 28   1))).        ((
0cb0: 3e 3d 20 69 20 28 6c 65 6e 67 74 68 20 66 69 65  >= i (length fie
0cc0: 6c 64 73 29 29 29 0a 20 20 20 20 20 20 28 68 61  lds))).      (ha
0cd0: 73 68 2d 74 61 62 6c 65 2d 73 65 74 21 20 68 20  sh-table-set! h 
0ce0: 28 6c 69 73 74 2d 72 65 66 20 66 69 65 6c 64 73  (list-ref fields
0cf0: 20 69 29 28 76 65 63 74 6f 72 2d 72 65 66 20 76   i)(vector-ref v
0d00: 65 63 20 69 29 29 29 0a 20 20 20 20 68 29 29 0a  ec i))).    h)).
0d10: 0a 0a 3b 3b 20 72 75 6e 73 20 70 72 6f 63 20 6f  ..;; runs proc o
0d20: 6e 20 65 61 63 68 20 72 6f 77 20 61 6e 64 20 72  n each row and r
0d30: 65 74 75 72 6e 73 20 74 68 65 20 72 65 73 75 6c  eturns the resul
0d40: 74 69 6e 67 20 6c 69 73 74 0a 28 64 65 66 69 6e  ting list.(defin
0d50: 65 2d 6d 65 74 68 6f 64 20 28 73 71 6c 74 62 6c  e-method (sqltbl
0d60: 3a 6d 61 70 20 28 73 65 6c 66 20 3c 73 71 6c 74  :map (self <sqlt
0d70: 62 6c 3e 29 20 70 72 6f 63 29 0a 20 20 28 6d 61  bl>) proc).  (ma
0d80: 70 20 28 6c 61 6d 62 64 61 20 28 72 6f 77 29 0a  p (lambda (row).
0d90: 20 20 20 20 20 20 20 20 20 28 70 72 6f 63 20 28           (proc (
0da0: 73 71 6c 74 62 6c 3a 76 65 63 74 6f 72 2d 3e 68  sqltbl:vector->h
0db0: 61 73 68 20 73 65 6c 66 20 72 6f 77 29 29 29 20  ash self row))) 
0dc0: 28 73 6c 6f 74 2d 72 65 66 20 73 65 6c 66 20 27  (slot-ref self '
0dd0: 72 6f 77 73 29 29 29 0a 20 20 20 0a              rows))).   .