Variadic function: Difference between revisions
no edit summary
Drkameleon (talk | contribs) No edit summary |
|||
Line 286:
=={{header|Arturo}}==
<lang rebol>;-------------------------------------------
; a quasi-variadic function
;-------------------------------------------
variadic: function [args][
print arg
]
]
; calling function with one block param
; and the arguments inside
▲ loop args {
;-------------------------------------------
; a function with optional attributes
;-------------------------------------------
variable: function [args][
print ["args:" args]
if? attr? "with" [
print ["with:" attr "with"]
]
else [
print "without attributes"
]
]
variable "yes"
variable.with:"something" "yes!"</lang>
{{out}}
<pre>one
2
three
args: yes
without attributes
args: yes!
with: something</pre>
=={{header|AutoHotkey}}==
|