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

  • Home
  • SEARCH
  • 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 730203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T06:53:05+00:00 2026-05-14T06:53:05+00:00

My problem isn’t with the built-in eval procedure but how to create a simplistic

  • 0

My problem isn’t with the built-in eval procedure but how to create a simplistic version of it. Just for starters I would like to be able to take this in ‘(+ 1 2) and have it evaluate the expression + where the quote usually takes off the evaluation.

I have been thinking about this and found a couple things that might be useful:
Unquote: ,
(quasiquote)
(apply)

My main problem is regaining the value of + as a procedure and not a symbol. Once I get that I think I should just be able to use it with the other contents of the list.

Any tips or guidance would be much appreciated.

  • 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-14T06:53:06+00:00Added an answer on May 14, 2026 at 6:53 am

    Firstly, if you’re doing what you’re doing, you can’t go wrong reading at least the first chapter of the Metalinguistic Abstraction section of Structure and Interpretation of Computer Programs.


    Now for a few suggestions from myself.

    The usual thing to do with a symbol for a Scheme (or, indeed, any Lisp) interpreter is to look it up in some sort of “environment”. If you’re going to write your own eval, you will likely want to provide your own environment structures to go with it. The one thing for which you could fall back to the Scheme system you’re building your eval on top of is the initial environment containing bindings for things like +, cons etc.; this can’t be achieved in a 100% portable way, as far as I know, due to various Scheme systems providing different means of getting at the initial environment (including the-environment special form in MIT Scheme and interaction-environment in (Petite) Chez Scheme… and don’t ask me why this is so), but the basic idea stays the same:

    (define (my-eval form env)
      (cond ((self-evaluating? form) form)
            ((symbol? form)
             ;; note the following calls PCS's built-in eval
             (if (my-kind-of-env? env)
                 (my-lookup form env)
                 ;; apparently we're dealing with an environment
                 ;; from the underlying Scheme system, so fall back to that
                 ;; (note we call the built-in eval here)
                 (eval form env)))
            ;; "applicative forms" follow
            ;; -- special forms, macro / function calls
            ...))
    

    Note that you will certainly want to check whether the symbol names a special form (lambda and if are necessary — or you could use cond in place of if — but you’re likely to want more and possibly allow for extentions to the basic set, i.e. macros). With the above skeleton eval, this would have to take place in what I called the “applicative form” handlers, but you could also handle this where you deal with symbols, or maybe put special form handlers first, followed by regular symbol lookup and function application.

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

Sidebar

Ask A Question

Stats

  • Questions 366k
  • Answers 366k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer There is some strangeness with the way setFillColor is interpreting… May 14, 2026 at 4:33 pm
  • Editorial Team
    Editorial Team added an answer The problem is reusing cell's identifier. In your case, the… May 14, 2026 at 4:33 pm
  • Editorial Team
    Editorial Team added an answer So c.Range("A1:D1") has its own relative range. One solution is… May 14, 2026 at 4:33 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.