SpinalHDL / SpinalWorkshop

Labs to learn SpinalHDL
144 stars 39 forks source link

Why function "orR" can be used in type scala.collection.immutable.IndexedSeq[spinal.core.Bool]) ? #24

Closed LurenAA closed 1 year ago

LurenAA commented 1 year ago

in Prime.solution, image

the type of "primesHits" is scala.collection.immutable.IndexedSeq[spinal.core.Bool]), I find no function "orR" in scala.collection.immutable.IndexedSeq class of Scala document , in SpinalHDL document orR is only for image .

Why function "orR" can be used in type scala.collection.immutable.IndexedSeq[spinal.core.Bool]) ? I feel very confused.

Dolu1990 commented 1 year ago

I think that one come from : https://github.com/SpinalHDL/SpinalHDL/blob/48a9b0bd0182786da75c23503eacf3a91913261c/lib/src/main/scala/spinal/lib/Utils.scala#L1072

It is a scala way to extends a pre-existing class with some additional functions.

LurenAA commented 1 year ago

thank you