fix with-disposals to work on seq or obj

db4
Doug Coleman 2008-02-27 19:36:32 -06:00
parent 5caf407517
commit eb8207a784
2 changed files with 9 additions and 5 deletions

View File

@ -67,8 +67,8 @@ person "PERSON"
"billy" 10 3.14 <person> the-person1 set
"johnny" 10 3.14 <person> the-person2 set
! test-sqlite
test-postgresql
test-sqlite
! test-postgresql
person "PERSON"
{
@ -81,8 +81,8 @@ person "PERSON"
1 "billy" 10 3.14 <assigned-person> the-person1 set
2 "johnny" 10 3.14 <assigned-person> the-person2 set
! test-sqlite
test-postgresql
test-sqlite
! test-postgresql
TUPLE: paste n summary author channel mode contents timestamp annotations ;
TUPLE: annotation n paste-id summary author mode contents ;

View File

@ -64,7 +64,11 @@ HOOK: insert-tuple* db ( tuple statement -- )
dup db-columns swap db-table ;
: with-disposals ( seq quot -- )
[ with-disposal ] curry each ;
over sequence? [
[ with-disposal ] curry each
] [
with-disposal
] if ;
: create-table ( class -- )
create-sql-statement [ execute-statement ] with-disposals ;