Python syntax in Lisp and Scheme

Oren Tirosh oren-py-l at hishome.net
Fri Oct 3 03:26:55 EDT 2003


On Thu, Oct 02, 2003 at 10:23:16PM -0700, mike420 at ziplip.com wrote:
> I think everyone who used Python will agree that its syntax is
> the best thing going for it. It is very readable and easy
> for everyone to learn. But, Python does not a have very good
> macro capabilities, unfortunately. I'd like to know if it may
> be possible to add a powerful macro system to Python, while 
> keeping its amazing syntax, and if it could be possible to
> add Pythonistic syntax to Lisp or Scheme, while keeping all
> of the functionality and convenience. If the answer is yes,
> would many Python programmers switch to Lisp or Scheme if
> they were offered identation-based syntax?

Search the comp.lang.python archives for the word "macros" and you will 
find lots and lots of threads discussing this issue over the years. The
concensus seems to be that macros are neither compatible with the Python
Way nor necessary for the vast majority of everyday programming tasks.

Implementing Python-like syntax in LISP or even a full Python 
implementation in LISP would be a worthwhile goal (LPython?). BTW, this 
kind of implementation is one of the relatively few programming tasks 
that can benefit greatly from macros. The Python semantics can be mostly
done using macros and a preprocessor would translated Python syntax to
s-expression code that uses those macros.

    Oren





More information about the Python-list mailing list