Skip to content

Allow default arguments #130

@skx

Description

@skx

I came across this example, recently:

(define*
 ;; function name: hi
 ;; a is needed
 ;; b has default argument 32
 ;; c has default argument "hi"
 (hi a (b 32) (c "hi"))
 ;; just returning the arguments
 (list a b c))

(list
 (hi 1)
 (hi :c 332 :a 3)
 (hi 3 2 1))

I'm not sure about the named-arguments, used when calling a function, but allowing default values for parameters seems nice and the syntax is trivial to handle.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions