2.5 Systems with Generic Operations

Printer-friendly versionPrinter-friendly version

In the previous section, we saw how to design systems in which data objects can be represented in more than one way. The key idea is to link the code that specifies the data operations to the several representations by means of generic interface procedures. Now we will see how to use this same idea not only to define operations that are generic over different representations but also to define operations that are generic over different kinds of arguments. We have already seen several different packages of arithmetic operations: the primitive arithmetic (+, -, *, /) built into our language, the rational-number arithmetic (add-rat, sub-rat, mul-rat, div-rat) of section 2.1.1, and the complex-number arithmetic that we implemented in section 2.4.3. We will now use data-directed techniques to construct a package of arithmetic operations that incorporates all the arithmetic packages we have already constructed.

Figure 2.23 shows the structure of the system we shall build. Notice the abstraction barriers. From the perspective of someone using “numbers,” there is a single procedure add that operates on whatever numbers are supplied. Add is part of a generic interface that allows the separate ordinary-arithmetic, rational-arithmetic, and complex-arithmetic packages to be accessed uniformly by programs that use numbers. Any individual arithmetic package (such as the complex package) may itself be accessed through generic procedures (such as add-complex) that combine packages designed for different representations (such as rectangular and polar). Moreover, the structure of the system is additive, so that one can design the individual arithmetic packages separately and combine them to produce a generic arithmetic system.

Comments

WViuMUVyyBmY

This was so helpful and easy! Do you have any arctiles on rehab?

RCCkhatrydtDsEnnbo

Oh yeah, fbauolus stuff there you!

http://www.birkenstockstore2013.com

Birkenstock over 200birkenstock outlet

Choose the one with Chaussures Birkenstockthick sole birkenstock pas cherto provide discount birkenstock sandals,birkenstock clogs cheap,birki clogs,shoe clogs,men s birkenstocks, even BMX cyclistsarmani watches are using eh same kind of shoes, since it sticks well in the pedals andarmani watches uk its thick flat shoes is utilized as a brake. Furthermore, the shoes are popular because of its strength. These kinds of shoes are very expensive because of having high quality materialbirkenstock outlet used and the additional features which provide the shoes the advantages as compared to other brands. Also these shoes should be manufactured and designed Unisex Birkenstockaccording to the safety features associated with the sports. The price of these shoes will be according on the features which the shoes have.

http://www.birkenstockstore2013.com

Birkenstock over 200birkenstock outlet

Choose the one with Chaussures Birkenstockthick sole birkenstock pas cherto provide discount birkenstock sandals,birkenstock clogs cheap,birki clogs,shoe clogs,men s birkenstocks, even BMX cyclistsarmani watches are using eh same kind of shoes, since it sticks well in the pedals andarmani watches uk its thick flat shoes is utilized as a brake. Furthermore, the shoes are popular because of its strength. These kinds of shoes are very expensive because of having high quality materialbirkenstock outlet used and the additional features which provide the shoes the advantages as compared to other brands. Also these shoes should be manufactured and designed Unisex Birkenstockaccording to the safety features associated with the sports. The price of these shoes will be according on the features which the shoes have.

2.5 Systems with Generic Operations | SICP in Clojure

Heya! I just wanted to ask if you ever have any trouble with hackers?
My last blog (wordpress) was hacked and I ended up losing months of hard work
due to no backup. Do you have any solutions to stop hackers?

my web page; Call of Duty Ghosts Hack

2.5 Systems with Generic Operations | SICP in Clojure

If you desire to get much from this article then you
have to apply such methods to your won website.

My blog … http://o-filmach.pl/

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