RequiredKeywords.jl

Create functions with required keyword arguments
Author adamslc
Popularity
1 Star
Updated Last
4 Years Ago
Started In
March 2017

RequiredKeywords

Build Status Build status codecov.io

This package allows you to specify required keyword arguments, as suggusted in JuliaLang/julia#5111.

As of Julia version 0.7.0, this functionality is built in. From this version forward, the @required_keywords macro won't do anything.

Usage

julia> using RequiredKeywords

julia> @required_keywords f(x; y::Int64) = x*y
f (generic function with 1 method)

julia> f(2,y=2)
4

julia> f(2)
ERROR: Unassigned Keyword:  Required keyword y::Int64 not included.
Stacktrace:
 [1] f(::Int64) at ./REPL[5]:1