I'm using import sequtils. FilterIt and MapIt work fine, but countIt is not recognised despite being in the documentation for seqUtils. What am I doing wrong?
import strformat
import sequtils
import Constants
import Support
const InputData = "Day03Test.txt"
type
State =tuple[ Data: seq[seq[char]], Transposed :seq[seq[char]]]
let s = new State
s.Data = toSeq((RawDataPath & InputData).lines).mapit(it.toseq())
s.Transposed = s.Data.Transpose()
proc Part01() =
var
myOnes:int
myGamma,myEpsilon:string
for myitem in s.Transposed:
myOnes=myitem.countIt(it=='1') ' countIt is underlined with the error message 'attempting to call undeclared routine'
let s = new State
Why?
@yhfle, @SolitudeSF. Compilation fails with 'attempting to call undeclared routine: 'countIt''
@minran To be equally opaque, why why?
compiles fine on my machine.
@minran To be equally opaque, why why?
new State allocates State on the heap and returns reference, while your program gains nothing from it.
Or perhaps not.
Choosenim stable reports that 1.6.0 is installed nim - h reports that version 1.0.4 is being used.
what do I do next?