Map-function with range syntax map(f❌kw, seq)

Hey,
I came across the following syntax.

map(f:x:kw, ys)

I would be very happy if someone could explain that line in detail to me. Or hint me to the appropriate page of the julia documentation. So far I was not able to find anything useful.

A minimal example for using that line might look like

function f(x, y; info=false)
    @info "inside f" x y info
    return 42
end

x = 2
ys = [4,5,6]
kw = (;info=true)
map(f:x:kw, ys) 

Thanks for your help.

where?

This is invalid syntax, and results in

julia> map(f:x:kw, ys)
ERROR: MethodError: no method matching (::Colon)(::typeof(f), ::Int64, ::@NamedTuple{info::Bool})

There must be a typo somewhere.

While it is correct syntax, your example does not run. It is very hard to tell what it should do.

Would it be possible, that the first colon should have been a comma? Like e.g.

julia> f(x,y) = @info "" x y
f (generic function with 1 method)

julia> x = 2; y=5; ys=[7,8,9];

julia> map(f, x:y, ys)
┌ Info: 
│   x = 2
└   y = 7
┌ Info: 
│   x = 3
└   y = 8
┌ Info: 
│   x = 4
└   y = 9
3-element Vector{Nothing}:
 nothing
 nothing
 nothing

The a:b:c constructs a range and just means range(;start=a, stop=c, step=c).

You are right, while boiling things down to a minimal example, I forgot to include.

using StdLib

As I found out, here the colon operator is defined for callables, allowing for a condensed way to construct Fixes. So

f:x:kw 

becomes a callable with only one parameter (effectively y), thus suited for the map function.

what is this? can you point us to where are you getting these examples/tutorials?

At least to me, it is now all clear. But thanks anyway.