 createSymbol = (value) ->
   (msg) ->
     switch msg
-      when sType then sValue
+      when sType then sSymbol
       when sName then value
       when sBoolify then (x, y) -> x
 

# corresponding boxed value.

defInitial = (name, value) ->
  allocate 1, mem_global, (addrs, mem2) ->
    env_global = update env_global, (new Symbol name), (car addrs)
    mem_global = update mem2, (car addrs), value

defPrimitive = (name, arity, value) ->
  defInitial name, allocate 1, mem_global, (addrs, mem2) ->
    mem_global = expandStore (car addrs), mem2
    createFunction (car addrs), (values, mem, kont) ->
      if (eq arity (length values))
        value values, mem, kont
      else
        throw new LispInterpreterError "Wrong arity for #{name}"

  else
    throw new LispInterpreterError "Not a pair"

defPrimitive "eqv?", 2, (values, mem, kont) ->
  kont createBoolean (
    if (eq ((car values) sType) ((cadr values) sType))
      switch ((car values) sType)
