guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Request for feedback on SRFI-126


From: Marko Rauhamaa
Subject: Re: Request for feedback on SRFI-126
Date: Thu, 01 Oct 2015 08:11:13 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Arne Babenhauserheide <address@hidden>:

> Making Scheme as usable as Python requires finding an elegance which
> fits Scheme and allows creating applications at least as easily as
> with Python — but not necessarily in the same style.

The main thing is to keep the S expressions' data/code duality. Python
doesn't have it. Here's a Python program:

    for i in range(10):
         print(i)

Here's the abstract syntax tree of the same program (generated by
ast.dump):

    Module(
        body=[
            For(target=Name(
                    id='i',
                    ctx=Store()),
                iter=Call(
                    func=Name(
                        id='range',
                        ctx=Load()),
                    args=[Num(n=10)],
                    keywords=[],
                    starargs=None,
                    kwargs=None),
                body=[Expr(value=Call(
                    func=Name(
                        id='print',
                        ctx=Load()),
                    args=[
                        Name(id='i',
                             ctx=Load())],
                    keywords=[],
                    starargs=None,
                    kwargs=None))],
                orelse=[])])

In Scheme, code is its own abstract syntax tree.


Marko



reply via email to

[Prev in Thread] Current Thread [Next in Thread]