PatternDispatch.jl icon indicating copy to clipboard operation
PatternDispatch.jl copied to clipboard

Add Associative pattern

Open toivoh opened this issue 12 years ago • 0 comments

Something like

@pattern f([:x => x::Int, :y => y::Int]) = ...

The rhs of => should be a pattern, while the lhs should probably be fixed in advance, or at least computable in some other way. It would be nice to have some syntax like

@pattern f([:x => x::Int, :y => y::Int, rest...]) = ...

to let rest swamp up the dict entries that were not matched.

toivoh avatar Jan 05 '13 21:01 toivoh