Anonymous user
Parametric polymorphism: Difference between revisions
m
→{{header|REXX}}: added/changed comments and whitespace.
m (→{{header|Wren}}: Removed blank line from output.) |
m (→{{header|REXX}}: added/changed comments and whitespace.) |
||
Line 1,073:
=={{header|REXX}}==
This REXX programming example is modeled after the '''D''' example.
<lang rexx>/*REXX program demonstrates (with displays) a method of parametric polymorphism.
call newRoot 1.00, 3 /*new root, and also indicate 3 stems.*/
/* [↓] no need to label the stems. */
Line 1,087:
exit /*stick a fork in it, we're all done. */
/*──────────────────────────────────────────────────────────────────────────────────────*/
addStem: nodes= nodes + 1;
newRoot: parse arg @,stems; nodes= -1; call addStem copies('═',9); call addStem @;
/*──────────────────────────────────────────────────────────────────────────────────────*/
modRoot: arg #;
return
/*──────────────────────────────────────────────────────────────────────────────────────*/
sayNodes: w= 9;
say /*show a blank line to separate outputs*/
return
{{out|output|text= when using the default input:}}
<pre>
|