Racket Function Arguments

The racket guide introduces functions with keyword arguments:

(define (F #:keyword argument) ...)

When we use it, we need to associate a specific value with an argument:

(F #:keyword 'value)

But in the same manual there is an example of a keyword argument without a value :

(struct posn (x y)
    #:transparent)

Is it possible to create such flag arguments for programmers, or is this obviously an internal function?

+3
source share
1 answer

structnot a function, this is a macro. You can define your own macros that use keywords in the same way.

+3
source

All Articles