Issue 1:
I have tried to make StaticArrays.jl compatible with the functions in Base.LinAlg but I get hung up on some inconsistencies.

The functions lufact(), qr() and svd() all use similar() to construct a (mutable) array for working with and returning output. In StaticArrays that would be e.g. the MMatrix type for a matrix. However, internal types like Base.LinAlg.SVD have fields which must be of type Array.

I consider this a bug since, according to the docs, similar should "Create an uninitialized mutable array with the given element type and size" and is not bound to return Array. We should widen the array field types in SVD and LU using an extra type parameter like in Eigen, and do something to fix the problem with qr() (also, there may be other functions with similar problems).

Alternatively we could use Array constructors where they are required, but I think this is not preferable. Julia is meant to be a generic language.

Examples:

_
_ _ _(_)_ | A fresh approach to technical computing
(_) | (_) (_) | Documentation: http://docs.julialang.org
_ _ _| |_ __ _ | Type "?help" for help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 0.5.1-pre+2 (2016-09-20 03:34 UTC)
_/ |\__'_|_|_|\__'_| | Commit f0d40ec (13 days old release-0.5)
|__/ | x86_64-linux-gnu

julia> using StaticArrays

julia> m = @SMatrix [1.0 2.0; 3.0 4.0]
2×2 StaticArrays.SMatrix{2,2,Float64,4}:
1.0 2.0
3.0 4.0

julia> eig(m) # successfully returns MVector and MMatrix (not Array)
([-0.372281,5.37228],
[-0.824565 -0.415974; 0.565767 -0.909377])

julia> lufact(m)
ERROR: MethodError: no method matching Base.LinAlg.LU{Float64,StaticArrays.MMatrix{2,2,Float64,4}}(::StaticArrays.MMatrix{2,2,Float64,4}, ::StaticArrays.MVector{2,Int64}, ::Int64)
Closest candidates are:
Base.LinAlg.LU{Float64,StaticArrays.MMatrix{2,2,Float64,4}}{T,S<:AbstractArray{T,2}}(::AbstractArray{T,2}, ::Array{Int64,1}, ::Int64) at linalg/lu.jl:10
Base.LinAlg.LU{Float64,StaticArrays.MMatrix{2,2,Float64,4}}{T}(::Any) at sysimg.jl:53
in lufact!(::StaticArrays.MMatrix{2,2,Float64,4}, ::Type{Val{true}}) at ./linalg/lu.jl:20
in lufact(::StaticArrays.SMatrix{2,2,Float64,4}) at ./linalg/lu.jl:72

julia> svd(m)
ERROR: MethodError: no method matching Base.LinAlg.SVD{T,Tr,M<:AbstractArray}(::StaticArrays.MMatrix{2,2,Float64,4}, ::StaticArrays.MVector{2,Float64}, ::StaticArrays.MMatrix{2,2,Float64,4})
Closest candidates are:
Base.LinAlg.SVD{T,Tr,M<:AbstractArray}{T,Tr}(::AbstractArray{T,N}, ::Array{Tr,1}, ::AbstractArray{T,N}) at linalg/svd.jl:10
Base.LinAlg.SVD{T,Tr,M<:AbstractArray}{T}(::Any) at sysimg.jl:53
in #svdfact!#32(::Bool, ::Function, ::StaticArrays.MMatrix{2,2,Float64,4}) at ./linalg/svd.jl:19
in (::Base.LinAlg.#kw##svdfact!)(::Array{Any,1}, ::Base.LinAlg.#svdfact!, ::StaticArrays.MMatrix{2,2,Float64,4}) at ./<missing>:0
in #svdfact#33(::Bool, ::Function, ::StaticArrays.SMatrix{2,2,Float64,4}) at ./linalg/svd.jl:37
in (::Base.LinAlg.#kw##svdfact)(::Array{Any,1}, ::Base.LinAlg.#svdfact, ::StaticArrays.SMatrix{2,2,Float64,4}) at ./<missing>:0
in #svd#36 at ./linalg/svd.jl:57 [inlined]
in svd(::StaticArrays.SMatrix{2,2,Float64,4}) at ./linalg/svd.jl:57

julia> qr(m)
ERROR: TypeError: typeassert: expected Array{Float64,2}, got StaticArrays.MMatrix{2,2,Float64,4}
in (::Base.LinAlg.#kw##_qr)(::Array{Any,1}, ::Base.LinAlg.#_qr, ::StaticArrays.SMatrix{2,2,Float64,4}, ::Type{Val{false}}) at ./<missing>:0
in qr(::StaticArrays.SMatrix{2,2,Float64,4}) at ./linalg/qr.jl:173

Issue 2:
This was reported at Stack Overflow:

http://stackoverflow.com/questions/35094986/does-macro-hygiene-only-protect-you-in-different-modules

_ _ _(_)_ | By greedy hackers for greedy hackers
(_) | (_) (_) | Documentation: http://docs.julialang.org
_ _ _| |_ __ _ | Type "?help" for help.
| | | | | | |/ _' | |
| | |_| | | | (_| | | Version 0.5.0-dev+2446 (2016-02-01 14:54 UTC)
_/ |\__'_|_|_|\__'_| | custom/a9c732a (fork: 2 commits, 0 days)
|__/ | Arch Linux x86_64

julia> macro g(y)
:((x, $y, $(esc(y))))
end

x = 1
function t()
x = 2
println(macroexpand(:(@g(x))))
println(@g(x))
end

t()
println(x)
(x,x,x)
(2,2,2)
1

julia> workspace()

julia> module A
macro g(y)
:((x, $y, $(esc(y))))
end
x = 1
end

x = 3

function t()
x = 2
println(macroexpand(:(A.@g(x))))
println(A.@g(x))
end

t()
(A.x,A.x,x)
(1,1,2)

I had expected the result to be (1, 1, 2).

However, if I define the macro in a different module, it works as expected.

Seems the hygiene simply prefix the symbols with the module namespace. Therefore it is impossible for the macro expander to distinguish different scopes in the first case.