0 votes
in LISP by
What Is Meant By Keyword Argument In Lisp?

1 Answer

0 votes
by
Keyword arguments are function arguments that are passed by keyword, instead of position. Keyword arguments can be mixed with by-position arguments, and default-value expressions can be supplied for either kind of argument:

(define greet

  (lambda (given #:last surname)

    (string-append "Hello, " given " " surname)))

 > (greet "John" #:last "Smith")

"Hello, John Smith"

> (greet #:last "Doe" "John")

"Hello, John Doe"

In above example last is a keyword argument.

Related questions

0 votes
asked Mar 4, 2021 in LISP by SakshiSharma
0 votes
asked Mar 2, 2021 in LISP by SakshiSharma
...