Updating other vocabs for XML changes

db4
Daniel Ehrenberg 2009-01-27 13:38:13 -06:00
parent ea741a786c
commit 50cd0c4ccc
4 changed files with 10 additions and 51 deletions

View File

@ -0,0 +1,6 @@
! Copyright (C) 2009 Daniel Ehrenberg
! See http://factorcode.org/license.txt for BSD license.
USING: lcs.diff2html lcs kernel tools.test strings sequences xml.writer ;
IN: lcs.diff2html.tests
[ ] [ "hello" "heyo" [ 1string ] { } map-as diff htmlize-diff xml-chunk>string drop ] unit-test

View File

@ -3,7 +3,7 @@
USING: accessors kernel xml arrays math generic http.client USING: accessors kernel xml arrays math generic http.client
combinators hashtables namespaces io base64 sequences strings combinators hashtables namespaces io base64 sequences strings
calendar xml.data xml.writer xml.utilities assocs math.parser calendar xml.data xml.writer xml.utilities assocs math.parser
debugger calendar.format math.order xml.interpolate ; debugger calendar.format math.order xml.interpolate xml.dispatch ;
IN: xml-rpc IN: xml-rpc
! * Sending RPC requests ! * Sending RPC requests
@ -15,7 +15,7 @@ GENERIC: item>xml ( object -- xml )
M: integer item>xml M: integer item>xml
dup 31 2^ neg 31 2^ 1 - between? dup 31 2^ neg 31 2^ 1 - between?
[ "Integers must fit in 32 bits" throw ] unless [ "Integers must fit in 32 bits" throw ] unless
number>string [XML <i4><-></i4> XML] ; [XML <i4><-></i4> XML] ;
UNION: boolean t POSTPONE: f ; UNION: boolean t POSTPONE: f ;
@ -176,10 +176,3 @@ TAG: array xml>item
: invoke-method ( params method url -- ) : invoke-method ( params method url -- )
[ swap <rpc-method> ] dip post-rpc ; [ swap <rpc-method> ] dip post-rpc ;
: put-http-response ( string -- )
"HTTP/1.1 200 OK\nConnection: close\nContent-Length: " write
dup length number>string write
"\nContent-Type: text/xml\nDate: " write
now timestamp>http-string write "\n\n" write
write ;

View File

@ -1,30 +0,0 @@
! Copyright (C) 2005, 2006 Daniel Ehrenberg
! See http://factorcode.org/license.txt for BSD license.
IN: xml.tests
USING: xml io kernel math sequences strings xml.utilities tools.test math.parser ;
PROCESS: calculate ( tag -- n )
: calc-2children ( tag -- n n )
children-tags first2 [ calculate ] dip calculate ;
TAG: number calculate
children>string string>number ;
TAG: add calculate
calc-2children + ;
TAG: minus calculate
calc-2children - ;
TAG: times calculate
calc-2children * ;
TAG: divide calculate
calc-2children / ;
TAG: neg calculate
children-tags first calculate neg ;
: calc-arith ( string -- n )
string>xml first-child-tag calculate ;
[ 32 ] [
"<math><times><add><number>1</number><number>3</number></add><neg><number>-8</number></neg></times></math>"
calc-arith
] unit-test

View File

@ -1,17 +1,7 @@
! Copyright (C) 2008 Jeff Bigot ! Copyright (C) 2008 Jeff Bigot
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: adsoda USING: adsoda xml xml.utilities xml.dispatch accessors combinators
xml sequences math.parser kernel splitting values continuations ;
xml.utilities
accessors
combinators
sequences
math.parser
kernel
splitting
values
continuations
;
IN: 4DNav.space-file-decoder IN: 4DNav.space-file-decoder
: decode-number-array ( x -- y ) "," split [ string>number ] map ; : decode-number-array ( x -- y ) "," split [ string>number ] map ;