Update HTTPD for removal of define-open/define-close words

slava 2006-10-28 06:43:13 +00:00
parent e520478032
commit fe1420ae9e
1 changed files with 8 additions and 9 deletions

View File

@ -56,53 +56,52 @@ SYMBOL: html
: write-html ( str -- ) : write-html ( str -- )
H{ { html t } } format ; H{ { html t } } format ;
: html-word ( name def -- word ) : html-word ( name def -- )
#! Define 'word creating' word to allow #! Define 'word creating' word to allow
#! dynamically creating words. #! dynamically creating words.
>r "html" create dup r> define-compound ; >r "html" create r> define-compound ;
: <foo> "<" swap ">" append3 ; : <foo> "<" swap ">" append3 ;
: def-for-html-word-<foo> ( name -- ) : def-for-html-word-<foo> ( name -- )
#! Return the name and code for the <foo> patterned #! Return the name and code for the <foo> patterned
#! word. #! word.
dup <foo> swap [ <foo> write-html ] curry html-word dup <foo> swap [ <foo> write-html ] curry html-word ;
define-open ;
: <foo "<" swap append ; : <foo "<" swap append ;
: def-for-html-word-<foo ( name -- ) : def-for-html-word-<foo ( name -- )
#! Return the name and code for the <foo patterned #! Return the name and code for the <foo patterned
#! word. #! word.
<foo dup [ write-html ] curry html-word drop ; <foo dup [ write-html ] curry html-word ;
: foo> ">" append ; : foo> ">" append ;
: def-for-html-word-foo> ( name -- ) : def-for-html-word-foo> ( name -- )
#! Return the name and code for the foo> patterned #! Return the name and code for the foo> patterned
#! word. #! word.
foo> [ ">" write-html ] html-word define-open ; foo> [ ">" write-html ] html-word ;
: </foo> [ "</" % % ">" % ] "" make ; : </foo> [ "</" % % ">" % ] "" make ;
: def-for-html-word-</foo> ( name -- ) : def-for-html-word-</foo> ( name -- )
#! Return the name and code for the </foo> patterned #! Return the name and code for the </foo> patterned
#! word. #! word.
</foo> dup [ write-html ] curry html-word define-close ; </foo> dup [ write-html ] curry html-word ;
: <foo/> [ "<" % % "/>" % ] "" make ; : <foo/> [ "<" % % "/>" % ] "" make ;
: def-for-html-word-<foo/> ( name -- ) : def-for-html-word-<foo/> ( name -- )
#! Return the name and code for the <foo/> patterned #! Return the name and code for the <foo/> patterned
#! word. #! word.
dup <foo/> swap [ <foo/> write-html ] curry html-word drop ; dup <foo/> swap [ <foo/> write-html ] curry html-word ;
: foo/> "/>" append ; : foo/> "/>" append ;
: def-for-html-word-foo/> ( name -- ) : def-for-html-word-foo/> ( name -- )
#! Return the name and code for the foo/> patterned #! Return the name and code for the foo/> patterned
#! word. #! word.
foo/> [ "/>" write-html ] html-word define-close ; foo/> [ "/>" write-html ] html-word ;
: define-closed-html-word ( name -- ) : define-closed-html-word ( name -- )
#! Given an HTML tag name, define the words for #! Given an HTML tag name, define the words for