Actually solved it in a different way, created an enum to pass meaningful
information to the next proc.
type
Intersection = enum
intersect,
parallel,
zerolength,
notsegment
proc lintersect(p1, .): (Intersection, Vec2) =
...
Ah. I'll have a go at it. Thanks.
Oh, this remind me of Maybe in Haskell. Excellent.
Have a look at
[https://nim-lang.github.io/Nim/options](https://nim-lang.github.io/Nim/options)
.
some of my procs can have no result so I'd like them to return false or a
value. For now I have
proc lintersect(p1, p2, p3, p4: Vec2, segments=false): (bool, Vec2) =
.
if parallel
return (false, vec2(0,0))
.
.
return (true, vec2(x,y))
Run