 
   forced: -> Sequence.conj @first(), (=> @rest()?.forced()), 'forced'
 
-  @memo: (name, f) -> @::[name] = -> x = f.apply(this); (@[name] = -> x)()
-
-  @memo 'size', ->
-    step = (s, n) -> if s then recur -> step s.rest(), n + 1 else n
-    resolve step this, 0
-
-  @memo 'last', ->
-    step = (s) -> if s.rest() then recur -> step s.rest() else s.first()
-    resolve step this
-
-  @conj: (first, rest, mode) ->
-    r = rest() if mode == 'forced'
-    new Sequence {
-      first: -> first
-      rest:
-        switch mode
-          when 'stored' then -> val = rest(); (@rest = -> val)()
-          when 'forced' then -> r
-          else               -> rest()
-    }
-
-  @from: (start) -> Sequence.conj start, => @from start+1
-
-  @range: (start, end) -> @from(start).take end - start + 1
-
 
 # --------------------------------------------------------------------
 # Exporting.

      @first = source.first
      @rest  = source.rest

  take: (n) ->
    if n > 0
      Sequence.conj @first(), => @rest()?.take n-1
    else
      null

  takeWhile: (pred) ->
    if pred(@first())
      Sequence.conj @first(), => @rest()?.takeWhile pred
    else
      null

  drop: (n) ->
    step = (s, n) -> if s and n > 0 then recur -> step(s.rest(), n - 1) else s
    resolve step this, n

  dropWhile: (pred) ->
    step = (s) -> if s and pred s.first() then recur -> step s.rest() else s
    resolve step this

  get: (n) -> @drop(n)?.first() if n >= 0

  select: (pred) ->
    if pred @first()

# --------------------------------------------------------------------
# A sequence class vaguely inspired by Clojure's sequences.
#
# Copyright (c) 2010 Olaf Delgado-Friedrichs (odf@github.com)
# --------------------------------------------------------------------


if typeof(require) != 'undefined'
  require.paths.unshift __dirname
  { recur, resolve } = require('trampoline')
