size-of: Use bake syntax
parent
568f91daca
commit
31d0e3c77b
|
@ -12,15 +12,15 @@ IN: size-of
|
||||||
VAR: headers
|
VAR: headers
|
||||||
|
|
||||||
: include-headers ( -- seq )
|
: include-headers ( -- seq )
|
||||||
headers> [ { "#include <" , ">" } bake to-string ] map ;
|
headers> [ `{ "#include <" , ">" } to-string ] map ;
|
||||||
|
|
||||||
: size-of-c-program ( type -- lines )
|
: size-of-c-program ( type -- lines )
|
||||||
{
|
`{
|
||||||
"#include <stdio.h>"
|
"#include <stdio.h>"
|
||||||
include-headers
|
include-headers
|
||||||
{ "main() { printf( \"%i\" , sizeof( " , " ) ) ; }" }
|
{ "main() { printf( \"%i\" , sizeof( " , " ) ) ; }" }
|
||||||
}
|
}
|
||||||
bake to-strings ;
|
to-strings ;
|
||||||
|
|
||||||
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue