update tangle and semantic-db for latest changes to factor

db4
Alex Chapman 2008-04-28 13:44:46 +10:00
parent 21c50fefe0
commit aa0daed072
5 changed files with 11 additions and 9 deletions

View File

@ -0,0 +1 @@
Alex Chapman

View File

@ -1,8 +1,8 @@
! Copyright (C) 2008 Alex Chapman ! Copyright (C) 2008 Alex Chapman
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: accessors arrays combinators combinators.cleave combinators.lib USING: accessors arrays combinators combinators.cleave combinators.lib
continuations db db.tuples db.types db.sqlite hashtables kernel math continuations db db.tuples db.types db.sqlite kernel math
math.parser namespaces parser sequences sequences.deep math.parser namespaces parser sets sequences sequences.deep
sequences.lib strings words ; sequences.lib strings words ;
IN: semantic-db IN: semantic-db
@ -28,7 +28,7 @@ node "node"
TUPLE: arc id subject object relation ; TUPLE: arc id subject object relation ;
: <arc> ( subject object relation -- arc ) : <arc> ( subject object relation -- arc )
arc construct-empty swap >>relation swap >>object swap >>subject ; arc new swap >>relation swap >>object swap >>subject ;
: <id-arc> ( id -- arc ) : <id-arc> ( id -- arc )
arc new swap >>id ; arc new swap >>id ;

1
extra/tangle/authors.txt Normal file
View File

@ -0,0 +1 @@
Alex Chapman

View File

@ -7,11 +7,11 @@ TUPLE: element attributes ;
TUPLE: ulist < element items ; TUPLE: ulist < element items ;
: <ulist> ( items -- element ) : <ulist> ( items -- element )
H{ } clone swap ulist construct-boa ; H{ } clone swap ulist boa ;
TUPLE: link < element href text ; TUPLE: link < element href text ;
: <link> ( href text -- element ) : <link> ( href text -- element )
H{ } clone -rot link construct-boa ; H{ } clone -rot link boa ;
GENERIC: >html ( element -- str ) GENERIC: >html ( element -- str )

View File

@ -1,6 +1,6 @@
! Copyright (C) 2008 Alex Chapman ! Copyright (C) 2008 Alex Chapman
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: accessors assocs db db.sqlite db.postgresql http.server io kernel namespaces semantic-db sequences strings ; USING: accessors assocs db db.sqlite db.postgresql http.server http.server.actions io kernel namespaces semantic-db sequences strings ;
IN: tangle IN: tangle
GENERIC: render* ( content templater -- output ) GENERIC: render* ( content templater -- output )
@ -20,7 +20,7 @@ TUPLE: sqlite-tangle ;
TUPLE: postgres-tangle ; TUPLE: postgres-tangle ;
: make-tangle ( db templater type -- tangle ) : make-tangle ( db templater type -- tangle )
construct-empty [ <tangle> ] dip tuck set-delegate ; new [ <tangle> ] dip tuck set-delegate ;
: <sqlite-tangle> ( db templater -- tangle ) sqlite-tangle make-tangle ; : <sqlite-tangle> ( db templater -- tangle ) sqlite-tangle make-tangle ;
: <postgres-tangle> ( db templater -- tangle ) postgres-tangle make-tangle ; : <postgres-tangle> ( db templater -- tangle ) postgres-tangle make-tangle ;
@ -40,8 +40,8 @@ M: postgres-tangle new-db ( tangle args -- tangle )
TUPLE: node-responder tangle ; TUPLE: node-responder tangle ;
C: <node-responder> node-responder C: <node-responder> node-responder
M: node-responder call-responder ( path responder -- response ) M: node-responder call-responder* ( path responder -- response )
"text/plain" <content> nip request-params "text/plain" <content> nip params get
[ "node-id" swap at* [ >>body ] [ drop ] if ] when* nip ; [ "node-id" swap at* [ >>body ] [ drop ] if ] when* nip ;
: test-tangle ( -- ) : test-tangle ( -- )