Moontalk server and client (provided by many parties)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 line
640B

  1. \ An extended string is essentially the same
  2. \ as a counted string, with the only difference that
  3. \ instead of storing max 1 char length of a string,
  4. \ we can store up to cell sized strings.
  5. \ Copy an extended string to
  6. : xplace ( c-addr u a-addr -- )
  7. swap dup >r over ! ( c-addr a-addr )
  8. cell + r> move ;
  9. : xcount ( a-addr -- c-addr u )
  10. dup cell + swap @ ;
  11. : +xplace ( c-addr u a-addr -- )
  12. 2dup >r >r xcount ( c-addr u c-addr u )
  13. + swap ( c-addr a-addr u )
  14. move ( -- )
  15. r> r> +! ;
  16. \ single char
  17. create somechar 1 chars allot align
  18. : +xplace-char ( n a-addr -- )
  19. swap somechar c! somechar 1 rot +xplace ;