![]() |
![]() |
|
home—info—lectures—exams—archive
Test cases for 120 -- refactoring is often a functional task:
v1
v2
v3
v4
v5
Even the regular program:
v1
v2
v3
UtilIan.max(Collection<T>), UtilIan.max(T...)
compare to Scheme:
advantages? disadvantages?
tree-processing code: xml processing
interface XTagHandler {
XTag handle( XTag x );
}
HashMap<String,TagHandler> processors = new HashMap<String,function>();
processors.add( "list", new TagHandler() { XTag handle( XTag x ) { ... } } );
(processors.get(x.tagName())).handle(x)
live example: handle a tag "linkAllFiles".
-----
scope: static, dynamic(perl)
let vs let*; glitches depending on scope being entire block.
variables in scheme: set!; begin
A passwd object
home—info—lectures—exams—archive
| ©2008, Ian Barland, Radford University Last modified 2008.Oct.20 (Mon) |
Please mail any suggestions (incl. typos, broken links) to ibarland |
![]() |