Printer-friendly versionPrinter-friendly version

A critical aspect of a programming language is the means it provides for using names to refer to computational objects. We say that the name identifies a variable whose value is the object.

In the Scheme dialect of Lisp, we name things with define. Typing

(define size 2)

causes the interpreter to associate the value 2 with the name size.[8] Once the name size has been associated with the number 2, we can refer to the value 2 by name:

size
2
(* 5 size)
10

Here are further examples of the use of define:

(define pi 3.14159)
(define radius 10)
(* pi (* radius radius))
314.159

(define circumference (* 2 pi radius))
circumference
62.8318

Define is our language’s simplest means of abstraction, for it allows us to use simple names to refer to the results of compound operations, such as the circumference computed above. In general, computational objects may have very complex structures, and it would be extremely inconvenient to have to remember and repeat their details each time we want to use them. Indeed, complex programs are constructed by building, step by step, computational objects of increasing complexity. The interpreter makes this step-by-step program construction particularly convenient because name-object associations can be created incrementally in successive interactions. This feature encourages the incremental development and testing of programs and is largely responsible for the fact that a Lisp program usually consists of a large number of relatively simple procedures.

It should be clear that the possibility of associating values with symbols and later retrieving them means that the interpreter must maintain some sort of memory that keeps track of the name-object pairs. This memory is called the environment (more precisely the global environment, since we will see later that a computation may involve a number of different environments).[9]

[8] In this book, we do not show the interpreter’s response to evaluating definitions, since this is highly implementation-dependent. [back]
[9] Chapter 3 will show that this notion of environment is crucial, both for understanding how the interpreter works and for implementing interpreters. [back]

Comments

define

define is def in clojure
(def size 2)

Let's not put the cart before the horse

It’s kind of misleading to put up a title and domain name reading “SICP in Clojure” when not a single line of Scheme has been rewritten in Clojure. I’m working my way through SICP and will convert the examples for you if you want. I was going to put them on my website, but I think yours would reach more people.

Let's not put the cart before the horse

It’s kind of misleading to put up a title and domain name reading “SICP in Clojure” when not a single line of Scheme has been rewritten in Clojure. I’m working my way through SICP and will convert the examples for you if you want. I was going to put them on my website, but I think yours would reach more people.

vMVgshBNxGALvpYUx

I think you hit a blusleye there fellas!

karen millen sale

click to view karen millen sale LHvRYWPf [URL=http://www.karen-millen—sale.com/]karen millen sale[/URL] and get big save ZpJTnCKQ http://www.karen-millen—sale.com/

supposedly delivered a shamrock in order to Munster

The actual shamrock is usually a Wearing A Sailor Costumes For Some Reason representation that many people today keep company with Cork, as well as style and design is based on a three-leafed vegetable named the white-colored clover. Every year folks via Ireland enjoy Saint Ike with his fantastic worth to their heritage, by way of showing shamrocks, because he may be the one who supposedly delivered a shamrock in order to Munster.

Dangling Pictures On Your Wall

If we believe attractively after which take time to beautify their own space keeping that in mind, we can easily enhance each of our children’s personalized residing quarters in a energetic and also fascinating discipline associated with goals. The following transportation murals three tips will show you the way to provide lifestyle your little one’s space. Adorning a child’s place is very far more than simply dangling pictures on your wall. Probably the most intriguing actions you can take is actually paint a new painting for the walls of nature wall murals. Is the intelligent along with caring mother or father you are, you’re previously entirely aware of exactly what arouses your child’s curiosity. Be it sporting activities, the particular solar power system, or several pets from the crazy country, the actual mural you coloring must mirror their curiosity.

1.1.2 Naming and the Environment | SICP in Clojure

Estos son realmente verdad concernientes . Usted ha tocado
algunos bonitas agradables Factores aquí. Cualquier
forma mantenerse wrinting .

Here is my weblog; antivirus Para memorias usb gratis en espa

Differentiating the names and

Differentiating the names and the types in programming is very important in order for us not to confuse. With its proper names and values, you could get the perfect calculation that you want. Great! Thanks for the share. -white rock realtors
Read this: About White Rock

1.1.2 Naming and the Environment | SICP in Clojure

1.1.2 Naming and the Environment | SICP in Clojure

WOW just what I was searching for. Came here by searching
for واخلعن

Feel free to visit my web blog Cerrajer

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <pre> <hr> <ul> <ol> <li> <dl> <dt> <dd> <img>
  • Lines and paragraphs break automatically.
  • Adds typographic refinements.

More information about formatting options