Closed thacuber2a03 closed 1 year ago
Method 1:
(= my-func (fn (arg opt-1 opt-2 opt-3 opt-4)
; do something with that
))
Method 2:
(= my-func (fn (arg . opt)
; now, 'opt' is list of arguments after 'arg'
))
If you're asking about writing a C function for fe, you should check the argument list before getting an optional argument (via fe_nextarg
) to see if it is nil (via fe_isnil
). If the argument list is nil, it means that there are no further arguments.
I figured it out a long time ago, but still thanks lol
how would I check the amount of arguments the user passed to a function, or at least check if there's an argument after the current one? I wanna make a function with 4 optional arguments