Skip to content

Naming struct fields with keywords for constructing and matching

License

Notifications You must be signed in to change notification settings

AlexKnauth/kw-make-struct

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kw-make-struct Build Status

documentation: http://pkg-build.racket-lang.org/doc/kw-make-struct/index.html

like make from unstable/struct except allowing keywords

make/kw is also defined as a match-expander.

Examples:

> (struct foo (a b c) #:transparent)
> (make/kw foo 'a 'b 'c)
(foo 'a 'b 'c)
> (make/kw foo #:a 'a #:b 'b #:c 'c)
(foo 'a 'b 'c)
> (make/kw foo #:a 'a 'b 'c)
(foo 'a 'b 'c)
> (make/kw foo #:c 'c 'a #:b 'b)
(foo 'a 'b 'c)
> (match (foo 'a 'b 'c)
    [(make/kw foo #:a a #:b b #:c c)
     (list a b c)])
'(a b c)

About

Naming struct fields with keywords for constructing and matching

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages