RosettaCodeData/Task/Variadic-function/Arturo/variadic-function.arturo
2026-02-01 16:33:20 -08:00

28 lines
632 B
Text

;-------------------------------------------
; a quasi-variadic function
;-------------------------------------------
variadic: function [args][
loop args 'argv [
print argv
]
]
; calling function with one block param
; and the arguments inside
variadic ["one" 2 "three"]
;-------------------------------------------
; a function with optional attributes
;-------------------------------------------
variable: function [args][
print ["args:" args]
switch attr? "with" [
print ["with:" attr "with"]
][
print "without attributes"
]
]
variable "yes"
variable.with:"something" "yes!"