In [52]:
using GeometryTypes    

mutable struct Node
        id::Int64
        parentID::Int64
        state::Point{2, Float64}
        cost::Float64
        Node(id::Int64, state::Point{2, Float64}) = new(id, -9999999, state, -9999999) #todo do this with outer constructors?
        Node(id::Int64, parentID::Int64, state::Point{2, Float64}) = new(id, parentID, state, -9999999)
        Node(id::Int64, parentID::Int64, state::Point{2, Float64}, cost::Float64) = new()
end

In [3]:
struct LSD
   pounds::Int 
   shillings::Int
   pence::Int
   
   function LSD(a, b, c)
    if a < 0 || b < 0 
      error("no negative numbers")
    end
    if c > 12 || b > 20
      error("too many pence or shillings")
    end
    new(a, b, c) 
   end   
end

In [55]:
Node(1, 3, Point(2.,3.), 34.)


Out[55]:
Node(3, 140482257436696, [6.94072e-310, 0.0], 0.0)
Pt2D{T} = Point{2, Float64} Pt2D(2., 3.)

In [102]:
x = [1 3 4 2 10]

findfirst(x) do y
 z = y+2
 z > 3
end

findfirst(y -> y>2, x)


Out[102]:
2

In [97]:
a = Point(2,3)
b= Point(3,4)
c= Point(5,10)
alist = [a b c]

foo =3 

findfirst(alist) do pt
    a = pt[1]
    a == foo
end


TypeError: non-boolean (Int64) used in boolean context

Stacktrace:
 [1] findnext(::##55#56, ::StaticArrays.SArray{Tuple{2,3},Int64,2,6}, ::Int64) at ./array.jl:1311
 [2] findfirst(::Function, ::StaticArrays.SArray{Tuple{2,3},Int64,2,6}) at ./array.jl:1338
 [3] include_string(::String, ::String) at ./loading.jl:522