[pypy-svn] r44750 - pypy/dist/pypy/lang/scheme
jlg at codespeak.net
jlg at codespeak.net
Thu Jul 5 18:57:24 CEST 2007
Author: jlg
Date: Thu Jul 5 18:57:24 2007
New Revision: 44750
Modified:
pypy/dist/pypy/lang/scheme/object.py
pypy/dist/pypy/lang/scheme/ssparser.py
Log:
(quote <obj>) does nothing
Modified: pypy/dist/pypy/lang/scheme/object.py
==============================================================================
--- pypy/dist/pypy/lang/scheme/object.py (original)
+++ pypy/dist/pypy/lang/scheme/object.py Thu Jul 5 18:57:24 2007
@@ -26,7 +26,7 @@
def __repr__(self):
return "<W_symbol " + self.name + ">"
-class W_Identifier(W_Root):
+class W_Identifier(W_Symbol):
def __init__(self, val):
self.name = val
@@ -36,9 +36,6 @@
def __repr__(self):
return "<W_Identifier " + self.name + ">"
- def to_symbol(self):
- return W_Symbol(self.name)
-
def eval(self, ctx):
if ctx is None:
@@ -321,21 +318,8 @@
return W_Pair(W_Identifier('quote'), W_Pair(sexpr, W_Nil()))
class Quote(W_Macro):
- def symbolize(self, lst):
- if isinstance(lst, W_Pair):
- arg = lst
- while not isinstance(arg, W_Nil):
- arg.car = self.symbolize(arg.car)
- arg = arg.cdr
-
- if isinstance(lst, W_Identifier):
- lst = lst.to_symbol()
-
- return lst
-
def eval(self, ctx, lst):
- w_obj = self.symbolize(lst.car)
- return w_obj
+ return lst.car
##
# Location()
Modified: pypy/dist/pypy/lang/scheme/ssparser.py
==============================================================================
--- pypy/dist/pypy/lang/scheme/ssparser.py (original)
+++ pypy/dist/pypy/lang/scheme/ssparser.py Thu Jul 5 18:57:24 2007
@@ -2,7 +2,7 @@
from pypy.rlib.parsing.pypackrat import PackratParser
from pypy.rlib.parsing.makepackrat import BacktrackException, Status
from pypy.lang.scheme.object import W_Pair, W_Fixnum, W_String, W_Identifier
-from pypy.lang.scheme.object import W_Nil, W_Boolean, W_Float, Literal, W_Symbol
+from pypy.lang.scheme.object import W_Nil, W_Boolean, W_Float, Literal
def unquote(s):
return s.replace('\\"', '"')
More information about the Pypy-commit
mailing list