Open mimoo opened 6 months ago
check the iterate.no example:
fn House.room(self, const idx: Field) -> Room { return self.rooms[idx]; }
do we really need the const here? Can't we just have the compiler complain if you pass a variable instead of a const for an actual circuit? It feels to me like this keyword just adds more mental load to the developer
const
(I did document the decision back then)
in my notes I had "replace const Field with Number or Int or smthg"
const Field
Number
Int
I think the const keyword is acting like a generic right now, which is nicer than having an extra syntax like fn House.room[idx](self) IMO
fn House.room[idx](self)
check the iterate.no example:
do we really need the
const
here? Can't we just have the compiler complain if you pass a variable instead of a const for an actual circuit? It feels to me like this keyword just adds more mental load to the developer(I did document the decision back then)