Open EvanKirshenbaum opened 5 months ago
It dawns on me that while a pad
should implicitly convert to a coord
, a coord
should implicitly convert to a maybe pad
, not a pad
, to allow for coord
s that refer off the board or to dead pads. That would allow c exists
or c is missing
to test whether the pad actually exists.
Currently, if you say
(x, y)
, the system takes this to refer to thepad
at that coordinate.There are situations such as reservations (#242) in which it would be useful to be able to talk about the coordinates themselves, so that you can do arithmetic on them (e.g.,
p + (1, 3)
). To handle this, we can add a newcoord
type and have coordinate pairs return this value. If we do this, we probably want pads and coordinates to be freely interconvertable.Also, for reservations, it would be useful to be able to talk about regions of pads/coordinates by specifying two corners or one corner and two extents. The obvious syntax for the first would be
p1 to p2
, but that would cause problems forrepeat with
expressions. So probablyp1 ... p2
. (Or maybethrough
.) Or possibly with a prefixedregion
, e.g.,region p1 through p2
.For the other forms, maybe
stretched
?p1 stretched 2 left, 3 up
,p1 stretched (-2, 3)
Migrated from internal repository. Originally created by @EvanKirshenbaum on Feb 11, 2023 at 12:06 PM PST.