Some questions about function (size(i::Int))

It’s a local function definition. It’s the same as

function size(i::Int)
    return i==0 ? 3 : 4*i
end