; This is how Sublang could should be written, making extensive use of macros
; Output: Hello, Sublang!
#sublib
#sublib/Control
p_string -> &"Hello, Sublang!\n"
**
Print a string using macros from standard lib
**
@PrintStdLib P_STRING? {
p_local = P_STRING?
char = 0
!Loop {
!DerefAndCopy p_local char ; char = *p_local
!IfFalse char {
!Break
}
!IO -= char
!Inc p_local
}
}
; Executing starts here
.main -> {
!PrintStdLib p_string
!Halt
}