Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Changing data within bytes...
#5
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).)
Reply


Messages In This Thread
Changing data within bytes... - by Nikkey - 2009-07-17, 02:29 AM
Changing data within bytes... - by Fiel - 2009-07-17, 02:43 AM
Changing data within bytes... - by Nikkey - 2009-07-17, 03:03 AM
Changing data within bytes... - by AngelSL - 2009-07-17, 04:03 AM
Changing data within bytes... - by Nikkey - 2009-07-17, 04:43 AM
Changing data within bytes... - by Spaz - 2009-07-17, 04:11 PM
Changing data within bytes... - by Dusk - 2009-07-17, 04:35 PM
Changing data within bytes... - by Kortestanov - 2009-07-17, 05:20 PM
Changing data within bytes... - by Nikkey - 2009-07-17, 06:51 PM
Changing data within bytes... - by Spaz - 2009-07-17, 07:36 PM
Changing data within bytes... - by Fiel - 2009-07-17, 07:42 PM
Changing data within bytes... - by Nikkey - 2009-07-17, 08:37 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)