Revision of 2.5.1 Generic Arithmetic Operations from 30 June 2009 - 8:43pm

The revisions let you track differences between multiple versions of a post.

Printer-friendly versionPrinter-friendly version


Exercise 2.77

Louis Reasoner tries to evaluate the expression (magnitude z) where z is the object shown in figure 2.24. To his surprise, instead of the answer 5 he gets an error message from apply-generic, saying there is no method for the operation magnitude on the types (complex). He shows this interaction to Alyssa P. Hacker, who says “The problem is that the complex-number selectors were never defined for complex numbers, just for polar and rectangular numbers. All you have to do to make this work is add the following to the complex package:”

(put 'real-part '(complex) real-part)
(put 'imag-part '(complex) imag-part)
(put 'magnitude '(complex) magnitude)
(put 'angle '(complex) angle)

Describe in detail why this works. As an example, trace through all the procedures called in evaluating the expression (magnitude z) where z is the object shown in figure 2.24. In particular, how many times is apply-generic invoked? What procedure is dispatched to in each case?

Exercise 2.78

The internal procedures in the scheme-number package are essentially nothing more than calls to the primitive procedures +, -, etc. It was not possible to use the primitives of the language directly because our type-tag system requires that each data object have a type attached to it. In fact, however, all Lisp implementations do have a type system, which they use internally. Primitive predicates such as symbol? and number? determine whether data objects have particular types. Modify the definitions of type-tag, contents, and attach-tag from section 2.4.2 so that our generic system takes advantage of Scheme’s internal type system. That is to say, the system should work as before except that ordinary numbers should be represented simply as Scheme numbers rather than as pairs whose car is the symbol scheme-number.

Exercise 2.79

Define a generic equality predicate equ? that tests the equality of two numbers, and install it in the generic arithmetic package. This operation should work for ordinary numbers, rational numbers, and complex numbers.

Exercise 2.80

Define a generic predicate =zero? that tests if its argument is zero, and install it in the generic arithmetic package. This operation should work for ordinary numbers, rational numbers, and complex numbers.


hermes outlet

I am sure you will love [URL=— - hermes outlet[/URL - online shopping SNswjdyF [URL=— -— [/URL -


What’s the exchange rate for euros? “>lexapro weight gain  Include the age in years and months (in words) if the patient is under 12 years.

2.5.1 Generic Arithmetic Operations | SICP in Clojure

This post really initiated a thorough discussion.

Also visit my blog post: SM-110 Oximeter

beats by dre clearance

cheap monster beats Before I tell you about my experience, cheap monster beats let me tell you a bit more about these headphones. beats by dre solo According to the information I’ve read, Dr. beats by dre solo Dre worked with Monster Cable and Robert Brunner, dre beats an industrial designer, dre beats for more than two years to perfect these headphones. beats by dre clearance In Dr. Dre’s words,People aren’t hearing all the music beats by dre clearance.

Louis Vuitton Outlet……
Louis Vuitton Outlet

Louis Vuitton Outlet……………………
Louis Vuitton Outlet

Louis Vuitton Outlet………………………………]………….…………………….
Louis Vuitton Outlet

Louis Vuitton Outlet……………
Louis Vuitton Outlet

UGG Outlet
UGG Outlet

discount louis vuitton outlet………
discount louis vuitton outlet

Louis Vuitton Outlet sunglasses……
Louis Vuitton Outlet sunglasses

Louis Vuitton Outlet sunglasses……………………………………
Louis Vuitton Outlet sunglasses

2.5.1 Generic Arithmetic Operations | SICP in Clojure

Aside from singing, she is also fond of dancing,
fashion, sports, make-up and acting  the epitome
of the total performer in the eyes of those who
follow her achievements closely. History - The sensible history of cutting diamonds dated
back at the Center Ages, before which time diamonds were loved in their normal octahedral state.
Whitney Houston took part in the following tours in her career:
Greatest Love Tour (1986), Moment of Truth World tour (1987-1988), I’m
Your Baby Tonight World Tour (1991), The Bodyguard World Tour (1993-1994), The Pacific Rim Tour
(1997), The European Tour (1998), My Love Is Your Love World Tour (1999), followed by Soul Divas Tour (2004).

Feel free to visit my web site … [Whitney Houston Songs|whitney houston lyrics|whitney houston greatest hits]

2.5.1 Generic Arithmetic Operations | SICP in Clojure

” All these search queries will be directed at what they’re most close to: “Manhattan Mall,” “Prospect Park,” “George Washington Bridge.
What exactly comes to your mind when you think about SEO Forum Posting.
These sites would then spam search engines with their copied content.

ujqcmoe hisvjh

syzkecue wqcvhgpt[url=]ugg nice corse[/url]
[url=]isabelle marant shop[/url]
[url=]ugg ny habitat[/url]
[url=]air jordan jaune uccello[/url]
[url=]air jordan image religieuse[/url]
[url=]sneakers isabelle marant[/url]
[url=]air jordan image 972[/url]
[url=]ou acheter des sneakers isabel marant[/url]
[url=]air jordan ix 40[/url]
[url=]basket isabel marant pas cher[/url]
[url=]isabel marant dicker[/url]
[url=]ugg nyc unemployment[/url]
[url=]ugg occasion 207[/url]
[url=]air jordan homme zodiacal[/url]
[url=]air jordan junior tshaka[/url]
[url=]air jordan image chef[/url]
[url=]ugg occasion 4008[/url]
[url=]air jordan iv charbonneau[/url]
[url=]ugg ny gazetiko[/url]
[url=]vente privee isabel marant[/url]
leepqxps tusqsamg yabevopf qvytylra fttpcxye

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