From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,80435549e92d4e0c X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.vmunix.org!peer-uk.news.demon.net!kibo.news.demon.net!mutlu.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Charles container library usage examples Date: Sat, 03 Sep 2005 10:45:09 +0100 Organization: Pushface Message-ID: References: NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1125740705 26035 62.49.19.209 (3 Sep 2005 09:45:05 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Sat, 3 Sep 2005 09:45:05 +0000 (UTC) Cancel-Lock: sha1:RU4NpcFeSCqjQE/TJSp6EjYMcIs= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (darwin) Xref: g2news1.google.com comp.lang.ada:4417 Date: 2005-09-03T10:45:09+01:00 List-Id: Matthew Heaney writes: > David Trudgett writes: >> The first thing I had in mind to do was to create a simple map, for >> example, to translate the following Common Lisp: >> >> (defvar *side-corners* >> '((2 (1 3)) >> (4 (1 7)) >> (6 (3 9)) >> (8 (7 9)))) > > You can use a map, instantiated with type Integer as the key and an > instantiation of a list as the element. Either the hashed map or the > ordered map would suffice. I would have used (for example) type Axis is (X, Y); type Coordinate is range 1 .. 8; type Position is array (Axis) of Coordinate; as the element type (making some assumptions about the problem!). No need to have a list as the element if the problem doesn't call for it (though good to be able to if needed, of course).