Newsgroups: comp.lang.lisp
From: Erik Naggum <e...@naggum.net>
Date: Sun, 25 Nov 2001 23:49:12 GMT
Local: Sun, Nov 25 2001 6:49 pm
Subject: Re: Design patterns for Lisp
* Software Scavenger
| In the recent thread about design patterns, RPG's definition of patterns | seemed to be approximately that patterns are components of a programmer's | knowledge, which differentiate between more and less experienced | programmers. Such components seem to me to include algorithms and good | usage of a programming language, along with other kinds of knowledge. If I have understood this patterns thing correctly, these would be some 1 Design algorithms to work with the highest meaningful class in the class E.g., design them for sequence rather than specifically for strings or 2 Accept start and end arguments in sequence function to avoid unnecessary Consequently, use them rather than inventing your own indexing and 3 When accepting an "end" position, it is exclusive. (The "start" position I.e., when the start and end arguments are equal, the sequence is empty. 4 If your algorithm scans a sequence in one direction one element at a Consequently, one does not need to call it with reversed arguments. 5 Use iteration rather than recursion to scan a sequence one element at a I.e., Common Lisp is not a dialect of Scheme. 6 When iterating over something to collect elements into a list, use loop (do (... or stuff new items onto the end of a list using the following template (do* (... 7 Design function interfaces so they can accept designators. I.e., study and use the designators already designed-into Common Lisp. Except for item 6, I do not think these are issues of abstraction or Now, RPG once told me that I sounded like I had not understood patterns, \\\ You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||