Paste: start-all
Author: | pruned |
Mode: | factor |
Date: | Mon, 29 Sep 2008 08:14:08 |
Plain Text |
: start-all ( subseq seq -- iseq )
0
[ 3dup start* nip dup ]
[ [ 1 + ] keep ]
[ ] produce
[ 3drop ] dip ;
Author: | slava |
Mode: | factor |
Date: | Mon, 29 Sep 2008 08:16:15 |
Plain Text |
: start-all ( subseq seq -- iseq )
0 [ start* dup ] with with [ [ 1 + ] keep ] [ ] produce nip ;
Author: | slava |
Mode: | factor |
Date: | Mon, 29 Sep 2008 08:20:30 |
Plain Text |
: prunedtree ( initial quot1 quot2 -- seq )
[ [ dup ] compose ] [ [ keep ] curry ] bi* [ ] produce nip ; inline
: 2with ( obj1 obj2 ignore quot -- ignore quot' ) with with ; inline
: start-all ( subseq seq -- iseq )
0 [ start* ] 2with [ 1+ ] prunedtree ;
Author: | erg |
Mode: | factor |
Date: | Tue, 30 Sep 2008 00:33:27 |
Plain Text |
:: insert-trigger ( table column foreign-table foreign-column -- sql )
[
"CREATE TRIGGER " % table foreign-table fki_bar_foo_id
" BEFORE INSERT ON " % table %
" FOR EACH ROW BEGIN" %
" SELECT RAISE(ROLLBACK, 'insert on table \"" % table % "\" violates foreign key constraint " %
foreign-table fk_foo_id
" WHERE (SELECT " % column % " FROM " % table %
" WHERE " % column % " = NEW." % foreign-column % ") IS NULL; END;" % ] "" make ;
New Annotation