             new Lambda(args[0], args[1])
           'defun': ->
             currentEnv().set(args[0].name, new Lambda(args[1], args[2]))
+          'setq': =>
+            value = @eval_expr(args[1])
+            currentEnv().set(args[0].name, value)
+          'defmacro': ->
+            currentEnv().setMacro(args[0].name, new Lambda(args[1], args[2]))
         }[expr.name.name]()
 
       when 'CallFun'

            @exec_lambda(funname)
          when 'Symbol'
            funcs = {
              '+': -> args.reduce(((sum, n) -> sum + n), 0),
              'car': -> args[0].values[0]
              'cdr': -> new List args[0].values[1..]
              'cons': -> new List [args[0], args[1].values...]


class Environment
  constructor: (@variables) ->
    @macros = {}
  get: (name)      -> @variables[name]
  set: (name, val) -> @variables[name] = val
  getMacro: (name)        -> @macros[name]
  setMacro: (name, macro) -> @macros[name] = macro

class LispError extends Error
  constructor: (@message) ->
