Return multiple values: Difference between revisions

m
→‎{{header|Factor}}: Use bi* to prevent swap.
(added php and python)
m (→‎{{header|Factor}}: Use bi* to prevent swap.)
Line 13:
15 3 */
 
[ "15 /* 3 = " write .</lang> ]
swap
[ "15 */ 3 = " write . ] bi*</lang>
"15 / 3 = " write .</lang>
 
Its stack effect declares that ''*/'' always returns 2 values. To return a variable number of values, a word must bundle those values into a [[sequence]] (perhaps an array or vector). For example, ''factors'' (defined in ''math.primes.factors'' and demonstrated at [[Prime decomposition#Factor]]) returns a sequence of prime factors.
Anonymous user