From 824df4182ab5c3268f6f1deea0f9af59263da809 Mon Sep 17 00:00:00 2001 From: Daniel Ehrenberg Date: Tue, 27 Jan 2009 15:10:56 -0600 Subject: [PATCH] Fixing xml.interpolate docs --- basis/xml/interpolate/interpolate-docs.factor | 18 ++++++++++-------- basis/xml/interpolate/interpolate-tests.factor | 1 + 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/basis/xml/interpolate/interpolate-docs.factor b/basis/xml/interpolate/interpolate-docs.factor index 2633ef11cb..23972ba7a4 100644 --- a/basis/xml/interpolate/interpolate-docs.factor +++ b/basis/xml/interpolate/interpolate-docs.factor @@ -23,10 +23,11 @@ ARTICLE: { "xml.interpolate" "in-depth" } "XML interpolation syntax" $nl "These forms can be used where a tag might go, as in " { $snippet "[XML <-> XML]" } " or where an attribute might go, as in " { $snippet "[XML /> XML]" } ". When an attribute is spliced in, it is not included if the value is " { $snippet "f" } " and if the value is not a string, the value is put through " { $link present } ". Here is an example of the fry style of XML interpolation:" { $example -{" "one two three" " " split +{" USING: splitting sequences xml.writer xml.interpolate ; +"one two three" " " split [ [XML <-> XML] ] map -<-> XML> pprint-xml>string "} -{" <' +<-> XML> pprint-xml"} +{" one @@ -37,10 +38,11 @@ $nl three -'> "} } +"} } "Here is an example of the locals version:" { $example -{" [let | +{" USING: locals urls xml.interpolate xml.writer ; +[let | number [ 3 ] false [ f ] url [ URL" http://factorcode.org/" ] @@ -53,6 +55,6 @@ $nl url=<-url-> string=<-string-> word=<-word-> /> - XML> pprint-xml>string ] "} -{" <' -'> "} } ; + XML> pprint-xml ] "} +{" +"} } ; diff --git a/basis/xml/interpolate/interpolate-tests.factor b/basis/xml/interpolate/interpolate-tests.factor index 3067254a60..817cb453fa 100644 --- a/basis/xml/interpolate/interpolate-tests.factor +++ b/basis/xml/interpolate/interpolate-tests.factor @@ -56,3 +56,4 @@ IN: xml.interpolate.tests \ parse-def must-infer [ "" interpolate-chunk ] must-infer +[ [XML <-> /> XML] ] must-infer