์๋ง๋ ์ด๊ฒ์ ์ค๋ฅ๋ฅผ ๋์ง ๊ฒ์ ๋๋ค.
julia> identity.[3,4,5]
:([3, 4, 5])
FWIW identity
์์๋ง ์ด๊ฒ์ ๋ณด๊ณ ์์ต๋๋ค.
julia> sum.[1,2,3]
ERROR: MethodError: no method matching start(::Expr)
Closest candidates are:
start(::SimpleVector) at essentials.jl:259
start(::Base.MethodList) at reflection.jl:560
start(::ExponentialBackOff) at error.jl:107
...
Stacktrace:
[1] mapfoldl(::Base.#identity, ::Function, ::Expr) at ./reduce.jl:67
[2] sum(::Expr) at ./reduce.jl:342
[3] broadcast(::Function, ::Expr) at ./broadcast.jl:415
julia> identity.[1,2,3]
:([1, 2, 3])
julia> length.[1,2,3]
ERROR: MethodError: no method matching length(::Expr)
Closest candidates are:
length(::SimpleVector) at essentials.jl:257
length(::Base.MethodList) at reflection.jl:558
length(::MethodTable) at reflection.jl:634
...
Stacktrace:
[1] broadcast(::Function, ::Expr) at ./broadcast.jl:415
broadcast(identity, :([1,2,3]))
๋ก ๋ฎ์์ง๋ ๊ฒ ๊ฐ์ต๋๋ค.
์ด๊ฒ์ ๊ฒฐ์ฝ ์๋ฏธ๊ฐ ์๋ ํํ์ด ์๋๋๋ค. julia์ ๋ชจ๋ ๋ฒ์ ์์ ๋ค์ํ ์ค๋ฅ๋ฅผ ์ ๊ณตํฉ๋๋ค. ๊ตฌ๋ฌธ ๋ถ์์ ํ์ฉํ๋ฏ๋ก ๋ฎ์ถ๋ ๋์ ์ผ์ข ์ ์ค๋ฅ์ผ ๊ฒ์ ๋๋ค.
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
์ด๊ฒ์ ๊ฒฐ์ฝ ์๋ฏธ๊ฐ ์๋ ํํ์ด ์๋๋๋ค. julia์ ๋ชจ๋ ๋ฒ์ ์์ ๋ค์ํ ์ค๋ฅ๋ฅผ ์ ๊ณตํฉ๋๋ค. ๊ตฌ๋ฌธ ๋ถ์์ ํ์ฉํ๋ฏ๋ก ๋ฎ์ถ๋ ๋์ ์ผ์ข ์ ์ค๋ฅ์ผ ๊ฒ์ ๋๋ค.