CISC108 Lecture Notes - Lecture 3: Complex Instruction Set Computing, Cross Product

28 views7 pages

Document Summary

Templates are the core structure that we know a function must have, independent of the details of its de nition. In many cases the template for a function is determined by the type of data the function consumes. We refer to these as data driven templates. The recipe below can be used to produce a data driven template for any type comment. For a given type typename the data driven template is: (define-(fn. for. type. name-x)- Where x is an appropriately chosen parameter name (often the initials of the type name) and the body is determined according to the table below. To use the table, start with the type of the parameter, i. e. typename, and select the row of the table that matches that type. The rst row matches only primitive types, the later rows match parts of type comments. (note that when designing functions that consume additional atomic parameters, the name of that parameter gets added after every in the template.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents