Pragmatic directives: Difference between revisions

Added XPL0 description.
mNo edit summary
(Added XPL0 description.)
Line 740:
Using Linux which has a "\n" line separator.
</pre>
 
=={{header|XPL0}}==
XPL0 has a single compiler directive called "string." It changes the way
text strings are terminated.
 
Originally, strings were terminated by setting the most significant bit set on
the last character. This conserved memory on early personal computers
such as the Apple II by making strings one byte shorter than if they were
terminated by a zero byte. As computer memory grew, this method became
less desirable. It prevented using the extended character codes 128
through 255 in strings, and it prevented null strings ("").
 
The RawText intrinsic was added as an alternative to the Text intrinsic
that enabled extended characters to be displayed in strings. It relied on
a final space character added by the programmer that had its high bit set
($A0) and was not displayed.
 
To make XPL0 more consistent with programming standards, in 2012 the
"string" directive was added.
 
string 0; \makes all following strings in the code zero-terminated
string 1; \(or any non-zero argument) reverts to MSB termination
 
{{omit from|AWK}}
772

edits