suve

awful: function: func-args

Declaration

array :func-args

Summary

Returns an array containing all the parameters passed to current function. Note that array entries are always value-copies; it is impossible to use variable references this way. When called in main function, the array is empty.

Example

# :func-args example.
!fun :average 
  :set &A :func-args
  :set &S f0.0
  
  :set &i :arr-count &A
  !while $i
    :sub &i i1
    :add &S $A[$i]
  !done
  
  :return :div $S :arr-count &A
!nuf

:writeln :average b11 o11 i11 h11

wikipage modified on 2014/0601/2317