2009-07-17, 04:43 AM
AngelSL Wrote:Umm.. what?!
Well I don't do LISP or Python so..
In lisp you can make your own macros and symbol-macros, which can ease your work by a lot. For example, lisp does not have for-loops or while-loops (and interestingly enough, I've never had the need to make a for-macro either). You can, however, make a while loop by simply writing this:
Code:
(defmacro while (test &body body)
`(do ()
((not ,test))
,@body))(This is the easiest macro I know of really, I don't know if I'm able to make an easier.)
The lisp macros I defined above makes me able to avoid long expressions which regards arrays, bits, characters and hash-tables, and focus on the main work instead. For example, if I have a hash-table, which has a key which points towards an array, and that array is filled with strings, and I want to either change a character or a string, I will be able to do so easily through this macro (The expression would be equal to #[ht key strnum charnum], instead of the long and big (char (aref (gethash key ht) strnum) charnum).)

