Reassigning a variable in a pure function
The complete source of basics_pure_reassign.ek9, which fails to compile exactly as captioned. Shown on basics.html.
Fails with E08100: reassignment not allowed when scope is marked as 'pure' (':=?' is supported)
#!ek9 defines module bad.site.basics.purereassign defines function sumOfSquares() as pure -> n as Integer <- sum as Integer: 0 limit <- n limit := 20 for i in 1 ... limit sum: sum + i*i
Download basics_pure_reassign.ek9 - it fails to compile on purpose, with the error its @Error line states.