Git Product home page Git Product logo

Comments (3)

etaoins avatar etaoins commented on July 24, 2024

In R7RS Section 4.2.3 there seems to be two distinct forms of (begin): body/top-level and expression. Your first example is of the top-level form because it appears in a top-level context and its result is unused. The second example is an expression form because it's being used as an expression for initialising s

I think you're completely correct that we're not handling the body form correctly and that's a bug. However, I think the expression form should introduce a new scope based on the example (begin) macro in Section 7.3:

(define-syntax begin
  (syntax-rules ()
    ((begin exp ...)
      ((lambda () exp ...)))))

This will clearly create a new scope due to the enclosing (lambda).

Does this make sense? I'll look at fixing the top-level form if you don't have any objections.

from llambda.

dram avatar dram commented on July 24, 2024

Maybe you misread something? In second example, begin wrap an internal definition, its result is unused, so I think this usage of begin still belongs to body/top-level form.

from llambda.

etaoins avatar etaoins commented on July 24, 2024

Sorry you're right. I thought the second example was a variable delcaration because I missed the lambda shorthand form

from llambda.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.