Created
November 26, 2022 10:49
-
-
Save neuro-sys/ec5655a153208687e215735ee1b00a73 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
: """s s\" \"\"\"s" ; | |
: s""" ( -- caddr u ) | |
begin | |
refill 0= if exit then | |
source """s compare 0= if | |
refill drop ( ignore the line ) | |
0 c, ( put zero terminator ) | |
exit | |
then | |
source s, \n, | |
again | |
; | |
( example ) | |
create sample-string | |
s""" | |
This is a | |
multi line string | |
"""s | |
\ Print zero terminated string | |
: ztype ( addr -- ) begin dup c@ emit 1+ dup c@ 0= until drop ; | |
sample-string ztype |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment