Z"( [chars<">] -- z* ) => [FORTH]
scan the input to the next doublequote and create a buffer
that holds the chars - return the address of that zero-terminated
string-buffer, either POCKET-PAD or ALLOTed into the dictionary.
compiling word = [p4_z_quote]
ZCOUNT( z* -- z* len ) => [FORTH]
push length of z-string, additionally to the string addr itself.
: ZSTRLEN ZCOUNT NIP ;
(see libc strlen(3)) / compare with COUNT / ZSTRLEN
primitive code = [p4_zcount]
ZSTRLEN( z* -- len ) => [FORTH]
push length of z-string.
: ZSTRLEN ZCOUNT NIP ;
(see libc strlen(3)) / compare with ZMOVE / CMOVE
primitive code = [p4_zstrlen]
ZMOVE( zsrc* zdest* -- ) => [FORTH]
copy a zero terminated string
(see libc strcpy(3)) / compare with ZSTRLEN / COUNT
primitive code = [p4_zmove]
ZPLACE( addr* len zaddr* -- ) => [FORTH]
copy string and place as 0 terminated
(see libc strncpy(3)) / see also +ZPLACE / Z+PLACE
primitive code = [p4_zplace]
+ZPLACE( caddr* u zdest* -- ) => [FORTH]
Add the string defined by CADDR LEN to the zero terminated string
at ZDEST - (for older scripts the SYNONYM named APPENDZ exists)
(see libc strncat(3)) / compare with ZPLACE / +PLACE
primitive code = [p4_appendz]
S\"( [backslashed-strings_<">] -- str cnt ) => [FORTH]
scan the following text to create a literal just
like S" does, but backslashes can be used to
escape special chars. The rules for the backslashes
follow C literals, implemented techniques are
\n \r \b \a \f \v \e \777
and all non-alnum chars represent themselves, esp.
\" \' \ \? \! \% \( \) \[ \] \{ \} etcetera.
most importantly the doublequote itself can be escaped.
but be also informed that the usage of \' and \" is not
portable as some systems preferred to map [\'] into ["].
Here I use the experimental addition to map [\q] to ["] and [\i] to [']
compiling word = [p4_s_backslash_quote]
C\"( [backslashed-strings_<">] -- bstr* ) => [FORTH]
scan the following text to create a literal just
like C" does, but backslashes can be used to
escape special chars. The rules for the backslashes
follow C literals, implemented techniques are
\n \r \b \a \f \v \e \777
and all non-alnum chars represent themselves, esp.
\" \' \ \? \! \% \( \) \[ \] \{ \} etcetera.
most importantly the doublequote itself can be escaped.
but be also informed that the usage of \' and \" is not
portable as some systems preferred to map [\'] into ["].
Here I use the experimental addition to map [\q] to ["] and [\i] to [']
compiling word = [p4_c_backslash_quote]
Z\"( [backslashed-strings_<">] -- zstr* ) => [FORTH]
scan the following text to create a literal just
like Z" does, but backslashes can be used to
escape special chars. The rules for the backslashes
follow C literals, implemented techniques are
\n \r \b \a \f \v \e \777
and all non-alnum chars represent themselves, esp.
\" \' \ \? \! \% \( \) \[ \] \{ \} etcetera.
most importantly the doublequote itself can be escaped
but be also informed that the usage of \' and \" is not
portable as some systems preferred to map [\'] into ["].
Here I use the experimental addition to map [\q] to ["] and [\i] to [']
compiling word = [p4_z_backslash_quote]