I\'m reading a spreadsheet looking for different structures. When I tried the following using Moose it seems to do what I want. I could create different types of objects, as
You probably want them to do a common role and specify that as the type
role Common {}
class Sch-Symbol does Common {…}
…
class Cell {
…
has Common $.found is rw;
}
Or you will have to use a where constraint
class Cell {
…
has $.found is rw where Sch-Symbol|Chip-Symbol|Net;
}
You could also create a subset to wrap the where constraint.
subset Common of Any where Sch-Symbol|Chip-Symbol|Net;
class Cell {
…
has Common $.found is rw;
}
Note that a where constraint is slower than using a common role.