Am 22.11.2010 um 19:31 schrieb William H. Fite:
> ((((((((((((((((((LISP)))is))sort))))of))cool))))
>
> Perhaps a trifle tedious.
No - because the parentheses allow for structuring code.
Sample code from the VITA-49.0 packet handling:
(defmd vrl-frame ()
(:documentation "Cells Model for VRL Frame")
(faw-word (c-in (make-vrl-faw-word)))
(payload-word-array (c-in nil))
(frame-size (c_? (+ 3 (length (^payload-word-array)))))
(frame-count (c-in 0))
(count-and-size-word (c_? (make-vrl-frame-count-and-size-word
(^frame-count) (^frame-size))))
(frame-w/o-crc (c_? (make-array (- (^frame-size) 1)
:element-type '(unsigned-byte 32)
:initial-contents (cons (^faw-word)
(cons
(^count-and-size-word)
(^payload-word-array))))))
(crc-word (c_? (frame-crc (^frame-w/o-crc)))))
(defun make-vrl-frame ()
"Generates empty/minial VRL frame."
(make-instance 'vrl-frame))
(defun write-vrt-word (word stream)
"Writes VRT word to stream MSB first."
(write-byte (ldb (byte 8 24) word) stream)
(write-byte (ldb (byte 8 16) word) stream)
(write-byte (ldb (byte 8 8) word) stream)
(write-byte (ldb (byte 8 0) word) stream))
(defmethod write-vrl-frame ((self vrl-frame) stream)
"Writes VRL frame word by word to stream."
(dotimes (n (- (frame-size self) 1))
(write-vrt-word (aref (frame-w/o-crc self) n) stream))
(write-vrt-word (crc-word self) stream))
I even don't see them anymore. With a decent editor you don't even have to type
them anymore (at least the closing ones) - e.g. as soon as I type
(
the editor does
()
with the cursor being placed in between them. Ah, yes, the editor is Emacs. But
there are several out that do that.
;-)
Cheers
Frank
P.S. It *is* fun to code in Lisp - believe me. See here for some comments:
http://wiki.alu.org/The_Road_To_Lisp_Survey and click on some of the Road to
Lisp links.
_______________________________________________
Flexedge mailing list
[email protected]
http://mail.flex-radio.biz/mailman/listinfo/flexedge_flex-radio.biz
This is the FlexRadio Systems e-mail Reflector called FlexEdge. It is used for
posting topics related to SDR software development and experimentalist who are
using beta versions of the software.