[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Fwd: Custom patterns
- To: am2q+@andrew.cmu.edu
- Subject: Re: Fwd: Custom patterns
- From: "Mark A. Tapia" <markt@dgp.toronto.edu>
- Date: Tue, 4 Jan 1994 09:32:02 -0500
- Cc: info-mcl@cambridge.apple.com
On Mon Jan 3 13:24:47 1994, Andrew Newell Mickish writes
in response to Karsten Poecks suggestion of 19 DEC to use
the variant record for pattern:
>> (defparameter *my-pattern*
>> (make-record :pattern
>> :b0 238
>> ...
>> :b7 119))
> I tried this, but I got the error
> > Error: :B0 is not a field of record :PATTERN
> > Valid fields are: (:ARRAY)
> Is the technique above supposed to work?
The short answer is it is not the MPW standard!
> It seems reasonable to want to supply the values of the fields when
> the record is created, rather than calling %put-byte afterwards.
> Does the documentation for the pattern record
> on p. 715 imply that this is possible?
It is if you only use the old record definition (included below).
This problem occurs when first using the standard quickdraw file
(require quickDraw) and then using the quickdraw interface file
(require-interface quickdraw).
On Mon, 1 Nov 1993, I asked Bill St. Clair about this problem:
>2. The pattern record definition does not contain variant structures.
Bill St. Clair responded:
> The problem that you mention with the Pattern record is NOT a bug.
> You may have become accustomed to the definition that was
> distributed with MCL 1.3.2 and earlier in the
> "ccl:library;records.lisp"
> file, but those variants were invented by somebody here. The MPW
> interfaces contain no such variants, only the array of 8 bytes as
> specified in the newer MCL interface file.
The following fragments show that the two record definitions are incompatible.
mark
;;Record definition from ccl:library:interface;quickDraw.lisp
(defrecord (Pattern :handle) (array (array :unsigned-byte 8)))
;;Record definition from ccl:library;records.lisp
(defrecord pattern
(variant ((w0 integer)
(w1 integer)
(w2 integer)
(w3 integer))
((b0 byte)
(b1 byte)
(b2 byte)
(b3 byte)
(b4 byte)
(b5 byte)
(b6 byte)
(b7 byte))
((bytes (array byte 8)))
((array (array :unsigned-byte 8)))))