Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7688465
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:55:36+00:00 2026-05-31T19:55:36+00:00

#lang eopl (define-datatype env env? (empty-env) (extended-env (var symbol?) (val scheme-val?) (envi env?))) (define

  • 0
#lang eopl

(define-datatype env env?
  (empty-env)
  (extended-env (var symbol?)
                (val scheme-val?)
                (envi env?)))

(define (scheme-val? x) #t)

; examples
(define e-env (empty-env))
(define e1 (extended-env 'x 1 (extended-env 'y #f e-env)))

I don’t get how scheme-val? is used. Why is there an x, and why are we returning #t?
Environment is a function associating a variable with a value.

So in the example, we are associating x = 1, and y = #f, right?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T19:55:38+00:00Added an answer on May 31, 2026 at 7:55 pm

    In scheme, #t is means boolean true, #f being false. I don’t fully understand the rest, but I suggest DrRacket’s debugger to see what’s going on.

    (define e-env (empty-env))
    

    assigns e-env to be an empty-env

    (define (scheme-val? x) #t)
    

    defines an anonymous function that takes a parameter x, and if it is a scheme-val (in this case, anything), returns #t.

    The result of e1 after this code runs is:

    #(struct:extended-env x 1 #(struct:extended-env y #f #(struct:empty-env)))
    

    so e1 is an extended-env with var='x, val=1, envi=(extended-env with var='y, val=#f, envi=e-env)

    (I think)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

#lang eopl (define (vectorSum V b e) ; b is starting index, and e
I get a java.lang.outOfMemoryError exception, while writing a big file to the servletOutputStream. Every
java.lang.reflect.InvocationTargetException SecurityConfiguration class (org.owasp.esapi.reference.DefaultSecurityConfiguration) CTOR threw exception. I get the above error when I
I get a java.lang.NoClassDefFoundError: com/hp/hpl/jena/shared/BadURIException when running a very simple servlet. The error points
I always get java.lang.OutOfMemoryError: Java heap space error when I try to run any
java.lang.NoClassDefFoundError: javax/servlet/jsp/el/ELException from using <c:set var=testVar value=testVal /> All other JSTL tags work. jsp
java.lang.IllegalMonitorStateException is what I get with a nasty stack trace. final Condition[] threads =
I get a java.lang.NumberFormatException, while parsing a xml file with commons-digester. Not sure what
I get java.lang.IndexOutOfBoundsException , when I call replaceAll() with replacement text containing $1 :
The java.lang.RuntimeException is Don't call setOnClickListener for an AdapterView. You probably want setOnItemClickListener instead,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.