 
 if typeof(require) != 'undefined'
   require.paths.unshift __dirname
-  { Stream } = require 'stream'
+  { recur, resolve } = require 'trampoline'
+  { List }           = require 'list'
+  { Stream }         = require 'stream'
 else
-  { Stream } = this.pazy
+  { recur, resolve, List, Stream } = this.pazy
 
 
 class LongInt


a = new LongInt(Stream.fromArray([499, 999, 999, 999]), -1)
b = new LongInt(Stream.fromArray [501])

console.log "a   = #{a.toString('_')}"
console.log "b   = #{b.toString('_')}"
console.log "a+b = #{(a.plus b).toString('_')}"
console.log "a-b = #{(a.minus b).toString('_')}"
console.log "a-a = #{(a.minus a).toString('_')}"
console.log "b-a = #{(b.minus a).toString('_')}"

###

      new LongInt(add(this.digits, other.digits), this.sign)

  minus: (other) ->
    cmp = (diff, r, s) ->
      if r and s
        recur -> cmp(new List(r.first() - s.first(), diff), r.rest(), s.rest())
      else if r or s
        if r then 1 else -1
      else
        diff.drop_while((x) -> x == 0)?.first() or 0

    sub = (r, s, b = 0) ->
      if b or (r and s)
        [r_, s_] = [r or Z, s or Z]
