Re: Help with Lisp type system
- From: wrf3@xxxxxxxxxxxxxxx (Bob Felts)
- Date: Fri, 5 Dec 2008 13:28:43 -0500
Thomas M. Hermann <tmh.public@xxxxxxxxx> wrote:
On Dec 5, 12:04 pm, w...@xxxxxxxxxxxxxxx (Bob Felts) wrote:
Given +foo+ and +bar+ (2 constants, value not really important here),
I'd like to make an unsigned-byte 8 sequence containing these two
values. The brute force way:
(let ((blob (make-array 2 :element-type '(unsigned-byte 8))))
(setf (aref blob 0) +foo+)
(setf (aref blob 1) +bar+)
blob))
But surely I ought to be able to use :initial-contents to populate the
array. I just haven't been able to find the right incantation that
makes everyone happy.
Any help appreciated.
Not sure how you are specifying the initial-contents, but this worked
for me:
(make-array 2 :element-type '(unsigned-byte 8) :initial-contents (list
+foo+ +bar+))
or
(make-array 2 :element-type '(unsigned-byte 8) :initial-contents
(vector +foo+ +bar+))
I could have sworn I tried that. Thanks for the help.
.
- References:
- Help with Lisp type system
- From: Bob Felts
- Re: Help with Lisp type system
- From: Thomas M. Hermann
- Help with Lisp type system
- Prev by Date: Re: Help with Lisp type system
- Next by Date: Re: Help with Lisp type system
- Previous by thread: Re: Help with Lisp type system
- Next by thread: Re: Help with Lisp type system
- Index(es):
Relevant Pages
|