[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Syntax of make-record :pattern



At 8:24 AM 4/26/95, Karsten Poeck wrote:
>Could somebody give an example of the use of
>
>(make-record :pattern)

The following code is adapated from some MCL 3.0 code that is
used to initialize its italic cursor. I like this style as
you can get a feel for what the pattern looks like on the screen
just by looking at the code. It also illustrates the proper
way to ensure that a pattern is initialized when a saved application
starts up.

(defvar *my-pattern*)

(ccl::def-load-pointers *my-pattern* ()
  (let ((pat (make-record (:pattern :storage :pointer)))
        (data #(#b10001000
                #b00000000
                #b00100010
                #b00000000
                #b10001000
                #b00000000
                #b00100010
                #b00000000)))
      (dotimes (i 8)
        (setf (pref pat (:pattern.array i)) (svref data i)))
      (setq *my-pattern* pat)))