Mimics
Inactive cells
Active cells
Specs
Inactive cells (details)
kind = "Sequence Index"
Active cells (details)
baseCreate(wrappedSequence, context, messages, +rest)

nil

method(wrappedSequence, context, messages, +rest, 
  res = mimic 
  res wrappedSequence = wrappedSequence 
  res context = context 
  res messages = messages 
  res restArguments = rest 
  if(messages length ==(2), 
    res destructor = Mixins Enumerable Destructor from(messages [](0)) 
    res lexicalBlock = LexicalBlock createFrom(res destructor argNames +(list(messages [](1))), context) 
    ) 
  res 
  )
create(+args)

nil

method(+args, 
  myNewSelf = baseCreate(*(args)) 
  myNewSelf index = myNewSelf restArguments [](0) 
  myNewSelf step = myNewSelf restArguments [](1) 
  myNewSelf 
  )
next()

nil

method(
  if(@ current?, 
    @ current? = false 
    @ cell(:current), 
    while(@ wrappedSequence next?, 
      n = @ wrappedSequence next 
      x = transformValue(cell(:n)) 
      if(
        true, 
        return(
          result = list(@ index, cell(:n)) 
          @ index = @ index +(@ step) 
          result 
          ))) 
    ) 
  )
next?()

nil

method(
  if(@ current?, 
    true, 
    while(@ wrappedSequence next?, 
      n = @ wrappedSequence next 
      x = transformValue(cell(:n)) 
      if(
        true, 
        @ current? = true 
        @ current = result = list(@ index, cell(:n)) 
          @ index = @ index +(@ step) 
          result 
           
        return(true) 
        ) 
      ) 
    false) 
  )