?he 'PRINTARROW''Page %'
?fo 'Steven Hardy'- % -'\*(DY'
.ce 2
The Print arrow ("=>")
======================

Putting the print arrow after an expression is the simplest way of
printing something in POP11, For example:
 	: 3 + 5 =>
 	** 8
 	: [% 3 + 5, REV([A B C D]), 'A STRING'%] =>
 	** [8 [D C B A] 'A STRING']
.br
If used in execute mode the print arrow prints everything on the stack,
for example:
 	 : 3 * 5, (4 - 2) * (4 + 2) =>
 	: ** 15 12
.br
If used inside a function the print arrow prints only one thing, for
example:
 	: FUNCTION SILLY(); 3 * 5, (4-2) * (4 + 2) => END;
 	: SILLY();
 	** 12
.br
In this example, the result of 3 * 5 hasn't been used and so remains
on the stack.
.br
Exercises
.br
_________
 	: VARS X,Y; 3->X; 5->Y;
 	: X =>
 	: X + Y =>
 	: "X" =>
 	: 'X + Y' =>
 	: [X + Y] =>
 	: [%X + Y%] =>
 	: '%X + Y%' =>
 	: [% "THE", "SUM", "OF", X, "AND", Y, "IS", X + Y%] =>
 	: CREATE PRSUM;
 	 10: FUNCTION PRSUM(X,Y);
 	 20: 	[%"THE", "SUM", "OF", X, "AND", Y, "IS", X+Y%] =>
 	 30: END;
 	 40:
 	: PRSUM(X,Y);
 	: PRSUM(Y,X);
 	: PRSUM (100 * (16 - 3), 29 + 17 * 4);
 	: PRSUM ("X", "Y");
 	: PRSUM (100, 1) =>
 	:EDIT PRSUM;
 	 40: 20:     [% 'THE SUM OF', X, 'AND', Y, 'IS', X + Y %] =>
 	 40:
 	: PRSUM(29,17);
 	: SHOW PRSUM;.
 	
.br
Write a function called PRLARGER such that
 	: PRLARGER(3,9);
.br
prints out
 	** [THE LARGER OF 3 AND 9 IS 9].
.br
Write a function called GREET, such that
 	: GREET("STEVE")
.br
prints out
 	** [HELLO STEVE - I AM PLEASED TO MEET YOU]
