Taine Zhao

Results 334 comments of Taine Zhao

This can be achieved by defining active patterns: ```julia julia> @active GlobalRef(x) begin (x.mod, x.name) end julia> @match GlobalRef(Base, :getfield) begin GlobalRef(a, b) => (a, b) end (Base, :getfield) julia>...

Sorry for missing this, I'd like to add them into https://github.com/thautwarm/MLStyle.jl/blob/master/src/Pervasives.jl

After considering it again I guess these patterns would be better to get separated from MLStyle base. MLStyle is to provide infrastructure, but implementing patterns for stdlib types might be...

Seems it's due to the AST change in Julia 1.5, gonna update it.

No match: ```julia @match :(f(x) = x + 100) begin :($func(x) = $(::LineNumberNode) $(body...)) => body x => nothing end ``` This is because `$` in `f(x) = a $(body...)`...

Sorry, this is because generated code takes line numbers from the macro caller inside the package. It could be possible for us to clean them up in the future.

Our compiler does know this information, however, for a more complex case, the checker can do nothing(I mean, we cannot complete this feature in MLStyle, so I decided not to...

`static_eval`: https://github.com/JuliaLang/julia/blob/master/src/codegen.cpp#L2270

I think the support for named arguments is from julia itself. Did you mean by the covariant named argument types?

I do agree with the idea to bring exhaustiveness check.. However, this proposal approach can have many problems with respect to its completeness: ```julia function (...) U = Union{Int, Tuple{Int,...