 
 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


    if this.sign != other.sign
      this.plus other.neg()
    else
      digits = sub(this.digits, other.digits)
      if digits.last() < 0
        new LongInt(sub(other.digits, this.digits), -this.sign)
      else
        new LongInt(digits, this.sign)

  toString: (sep = '') ->
    rev = @digits.reverse().drop_while (d) -> d == 0


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

console.log "a   = #{a.toString('_')}"
console.log "b   = #{b.toString('_')}"
console.log "c   = #{c.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('_')}"
console.log "a+c = #{(a.plus c).toString('_')}"

###
