Am Tue, 3 Mar 2015 06:40:44 -0800
schrieb John Benediktsson :
Hi John,
thank you
Georg
> Hi Georg,
>
> The ``printf`` word is a macro. You can see it starts with MACRO:
> definition.
>
> That means you can do this to see the code (``quot``) that is
> generated:
>
> [ "Test\n" printf ] e
Thanks, John - Interesting! ... let me chew on this ~cw
On Tue, Mar 3, 2015 at 6:35 AM, John Benediktsson wrote:
> Well, this fails:
>
> "" string>xml
>
> But these both succeed:
>
> "" string>xml
>
> "" string>xml
>
> Looks like it's not proper XHTML?
>
> If it helps we have HTML5 p
Hi Georg,
The ``printf`` word is a macro. You can see it starts with MACRO:
definition.
That means you can do this to see the code (``quot``) that is generated:
[ "Test\n" printf ] expand-macros
It also means that when you call it like you did, it will essentially
generate and run that quo
Well, this fails:
"" string>xml
But these both succeed:
"" string>xml
"" string>xml
Looks like it's not proper XHTML?
If it helps we have HTML5 parsers in html.parser, and words to work with it
in html.parser.analyzer:
"" parse-html
"http://factorcode.org"; http-get nip
Hallo,
http://docs.factorcode.org/content/word-printf%2Cformatting.html
says
printf ( format-string -- quot )
but in scratchpad
USE: formatting "test\n" printf
works without leaving a quotation on stack.
Georg
signature.asc
Description: PGP signature
---
Greetings, folks -
In an idle moment, I pasted this snippet of example code
from the factorcode.org page, just for fun:
USING: io kernel sequences
http.client xml xml.data xml.traversal ;
"http://factorcode.org"; http-get nip string>xml
"a" deep-tags-named
[ "href" attr ] map
[ print ] each
! th