assignments:a2
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
assignments:a2 [2009/04/02 03:12] – jonathan | assignments:a2 [2009/04/05 02:11] (current) – removed jonathan | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Assignment 2 ====== | ||
- | |||
- | |||
- | Download the file a2-money.zip in '' | ||
- | |||
- | Since your code will be executed and checked with a script, you must follow the instructions precisely. Your work is in a directory '' | ||
- | |||
- | Before submitting, eclean and do a fresh compile and execute to make sure that you get a green bar. Then eclean the directory '' | ||
- | |||
- | | ||
- | |||
- | Don't forget to also hand in your written report at the 3311 drop box in the CSE building. | ||
- | |||
- | ---- | ||
- | ---- | ||
- | |||
- | ===== void safety and HASH_TABLE [?G, ?K]===== | ||
- | |||
- | * We would like to use HASH_TABLE[G, | ||
- | * Eiffelstudio 6.3 is in transition to implementing void safety (which means that the compiler will always catch errors of the type '' | ||
- | * The latest version of HASH_TABLE inherits from TABLE [?G, ?K], i.e. the generic parameters are allowed to be attached to Void. So, to use HASH_TABLE in HASHABLE_MAP, | ||
- | |||
- | <code eiffel> | ||
- | class HASHABLE_MAP [KEY -> {HASHABLE, | ||
- | | ||
- | create | ||
- | make | ||
- | feature | ||
- | has (k: ? | ||
- | |||
- | item alias " | ||
- | |||
- | | ||
- | |||
- | feature{NONE} | ||
- | | ||
- | end | ||
- | </ | ||
- | |||
- | The question mark will ensure that the keys and values can be Void. you may sometimes have to do the following to obtain the correct types: | ||
- | |||
- | <code eiffel> | ||
- | t: TUPLE[KEY, | ||
- | |||
- | t ?= [map_imp.key_for_iteration, | ||
- | |||
- | </ | ||
- | |||
- | "? | ||
assignments/a2.1238641936.txt.gz · Last modified: 2009/04/02 03:12 by jonathan