Phrase reversals: Difference between revisions

Added Bracmat example
m (→‎{{header|REXX}}: "copied" the remark I found under C)
(Added Bracmat example)
Line 95:
each word reversed : attesoR edoC esarhP lasreveR
</pre>
 
=={{header|Bracmat}}==
This example only works correctly with strings only consisting of byte-sized characters.
<lang bracmat>( "rosetta code phrase reversal":?text
& rev$!text:?output1
& get$(!text,MEM):?words
& :?output2:?output3
& whl
' ( !words:%?word %?words
& !output2 rev$!word " ":?output2
& " " !word !output3:?output3
)
& str$(!output2 rev$!words):?output2
& str$(!words !output3):?output3
& out
$ ( str
$ ("0:\"" !text "\"\n1:\"" !output1 "\"\n2:\"" !output2 "\"\n3:\"" !output3 \"\n)
)
);</lang>
Output:
<pre>0:"rosetta code phrase reversal"
1:"lasrever esarhp edoc attesor"
2:"attesor edoc esarhp lasrever"
3:"reversal phrase code rosetta"</pre>
 
=={{header|C}}==
483

edits