From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vs1-f41.google.com (mail-vs1-f41.google.com [209.85.217.41]) by sourceware.org (Postfix) with ESMTPS id 6FCA63851C33 for ; Wed, 2 Dec 2020 14:58:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6FCA63851C33 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=alum.mit.edu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=j.r.hope@gmail.com Received: by mail-vs1-f41.google.com with SMTP id u7so1053637vsq.11 for ; Wed, 02 Dec 2020 06:58:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=NTBbSeOAEcPehgaQtq2IyN3LUpZwzMBoCfuopGuny90=; b=pdqK2uOI5D7QQfl0oRHBCS/b910qM70NQlEMyOUEVvGZfkfZBnjh8DcNpo0K5etoPT h5cXliKJ8dS8HUgW93yCDOo8EGaZpoTO8It2Wm7uNEprS4H5kVBVFalik1xDeiR3Klt5 YOKm7oOV8VVFEckoxHKcVC+Yp36efD2+XeOsoZrEqfD0ZMSo0X1JWaRXPoNobCyyRIqA hhms9J3OYPGxbJxjvqtlzdTJXWpvg7TixQtDFU37wzypTSFF4c3f/HajOhTiAVtj/BC9 g6ykxnwltwLooDT6ofesCzk4Lun5OxLk1hB63kS7E0bUMSnnQe5sg3xFN9uZ4haiqaKm LGdw== X-Gm-Message-State: AOAM530b+6HERMTM7EK+iHfz52u8a6xolb06v1Sd6KXJMwZebl/IyKAI hoJUI+KhFQp6j+JPgEjb45UxS2AhQRoWwvC6diT23rKB X-Google-Smtp-Source: ABdhPJy1OG0rgC/wJACX9OMhfbVG4+RK8JZJfFezMyW6pVe59yxJ0iZndYhCce1ijY41jKLDEJXowYgZiet+5v8fcs8= X-Received: by 2002:a67:fc51:: with SMTP id p17mr1912374vsq.38.1606921121736; Wed, 02 Dec 2020 06:58:41 -0800 (PST) MIME-Version: 1.0 References: <3c4fc600-110f-e1fe-4421-aeb91c8fab22@oca.eu> <60e9b887-73ef-76f8-87e1-a8158802beef@bothner.com> <350b87e4-498f-8108-c2f5-f5397356b10f@oca.eu> In-Reply-To: <350b87e4-498f-8108-c2f5-f5397356b10f@oca.eu> From: Jamison Hope Date: Wed, 2 Dec 2020 09:58:30 -0500 Message-ID: Subject: Re: Using eval with environments and R7RS modules To: kawa@sourceware.org X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, HTML_MESSAGE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: kawa@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Kawa mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Dec 2020 14:58:43 -0000 On Mon, Nov 30, 2020 at 1:09 PM Damien MATTEI wrote: > > strange that the SICP cover book put the couple EVAL / APPLY as > important notion, APPLY seems more usefull, FWIW, I would point out that SICP is *not* a book on how to program in Scheme. It uses Scheme, yes, but much like the pseudo code in CLRS, it=E2= =80=99s just as an easy-to-understand syntax for presenting concepts about programming. We did have to write and run some programs in 6.001 on actual computers for homework, but most of the work was done on paper or a chalkboard. (There were no computers in the room for the final exam.) The pair of EVAL/APPLY presented the two stages of *Interpreting* a Computer Program using the environment model: after parsing the Structure (which for Lisp just means turning text with parentheses into a list of atoms and lists =E2=80=94 I don=E2=80=99t recall SICP mentioning vector lit= erals, but it=E2=80=99s been a while), the two steps to interpret the program =E2=80=94 to decide w= hat the program=E2=80=99s result is =E2=80=94 are to evaluate the car of the list t= o see what function it represents, then evaluate each function argument, and then to apply the function to its arguments (each of those EVAL steps might entail recursively EVAL/APPLYing an inner function application). There=E2=80=99s a= little more to it to handle special forms like IF which don=E2=80=99t evaluate eve= ry argument first, but that=E2=80=99s the essence of the model. This was really a mental exercise, not a description of how a real physical computer does or should work. The chapter on register machines and compilation addresses the fact that in reality we don=E2=80=99t need to use= EVAL to look up each variable at runtime, because we can precompute where that variable resides in the stack based on where it was defined (see the section called =E2=80=9CLexical Addressing=E2=80=9D). > > > Damien > > -JH --=20 Jamison Hope