semantic-db: change 2apply to bi@

db4
Alex Chapman 2008-04-01 13:41:03 +11:00
parent 4d2cb451f3
commit e8abcf8d85
2 changed files with 4 additions and 4 deletions

View File

@ -54,10 +54,10 @@ test-db [
"charlie" create-node "charlie" set
"gertrude" create-node "gertrude" set
[ ] [ "bob" get "adam" get has-parent ] unit-test
{ { "bob" "eve" } { "fran" "eve" } { "gertrude" "bob" } { "fran" "bob" } { "charlie" "fran" } } [ first2 [ get ] 2apply has-parent ] each
{ { "bob" "eve" } { "fran" "eve" } { "gertrude" "bob" } { "fran" "bob" } { "charlie" "fran" } } [ first2 [ get ] bi@ has-parent ] each
[ { "bob" "fran" } ] [ "eve" get has-parent-relation children [ node-content ] map ] unit-test
[ { "adam" "eve" } ] [ "bob" get has-parent-relation parents [ node-content ] map ] unit-test
[ "fran" { "charlie" } ] [ "fran" get has-parent-relation get-node-hierarchy dup node>> node-content swap children>> [ node>> node-content ] map ] unit-test
[ "fran" { "charlie" } ] [ "fran" get has-parent-relation get-node-tree-s dup node>> node-content swap children>> [ node>> node-content ] map ] unit-test
[ { "adam" "eve" } ] [ "charlie" get has-parent-relation get-root-nodes [ node-content ] map natural-sort >array ] unit-test
[ { } ] [ "charlie" get dup "fran" get !has-parent has-parent-relation parents [ node-content ] map ] unit-test
[ { "adam" "eve" } ] [ has-parent-relation ultimate-objects node-results [ node-content ] map ] unit-test

View File

@ -110,7 +110,7 @@ arc "arc"
[ node-result ] map ;
: subjects-with-cor ( content object relation -- sql-results )
[ id>> ] 2apply
[ id>> ] bi@
[
":relation" INTEGER param ,
":object" INTEGER param ,
@ -119,7 +119,7 @@ arc "arc"
"select n.id, n.content from node n, arc a where n.content = :content and n.id = a.subject and a.relation = :relation and a.object = :object" results ;
: objects-with-csr ( content subject relation -- sql-results )
[ id>> ] 2apply
[ id>> ] bi@
[
":relation" INTEGER param ,
":subject" INTEGER param ,