P
julia> f(x,y) = x .+ y
f (generic function with 1 method)
julia> f.([1, 2, 3], Ref([4, 5, 6]))
3-element Array{Array{Int64,1},1}:
[5, 6, 7]
[6, 7, 8]
[7, 8, 9]
Size: a a a
АО
julia> f(x,y) = x .+ y
f (generic function with 1 method)
julia> f.([1, 2, 3], Ref([4, 5, 6]))
3-element Array{Array{Int64,1},1}:
[5, 6, 7]
[6, 7, 8]
[7, 8, 9]
P
АО
АО
map кстати вариант нормальный, потому что есть ThreadX, который паралелит всё 😊АО
АО
using ThreadsX
f(x,y) = x .+ y
y = collect(1:1000);
ThreadsX.map(x -> f(x, y), 1:1000000)
АО
julia> let x::Int = 0
struct Foo
x::Int
function Foo()
x += 1
new(x)
end
end
end
julia> Foo()
Foo(1)
julia> Foo()
Foo(2)
julia> Foo()
Foo(3)
P
АО
АО
АО
RS
RS
АО
MW
АО
АО
module MyModule
include(“file1.jl”)
include(“file2.jl”)
export f
f(x) = g(x+1)
g(x) = 2x
end # moduleАО