# core/implementation/Sequence.tcl

    @implementation Sequence {

      - init {} {
          $super init
          set length [expr [string length [@maxInteger]] -1]
          $self value: 0
        }

      - next {} {
          set incrementing 1
          set index [expr [llength $counter] -1]
          while {$incrementing} {
            #- incrementing the current counter
            set count [expr [string trimleft [lindex $counter $index] 0] + 1]
            #- have we reached the limit ?
            if {[string length $count] == [expr $length + 1]} {
              #- reset it + report to next counter
              set counter [lreplace $counter $index $index [format %0${length}i 0]]
              incr index -1
              if {$index == -1} {
                #- next counter doesn't exist yet
                set counter [linsert $counter 0 0]
                set index 0
              }
            } else {
              #- no limit reached so, updating counter
              set counter \
                [lreplace $counter $index $index [format %0${length}i $count]]
              set incrementing 0
            }
          }
          set value [string trimleft [join $counter {}] 0]
          return $value
        }

      - value {} {
          return $value
        }

      - value: aValue {
          set value $aValue
          set counter [format %0${length}i $aValue]
        }
    }