[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bindat documentation
From: |
Stefan Monnier |
Subject: |
Re: bindat documentation |
Date: |
Sat, 03 May 2025 10:38:22 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
>> (setq data [3 -3]
>> partition_entry-spec '((bootable uint 8) (partition_type sint 8))
>> partition_entry1-spec '((bootable u8) (partition_type s8)))
>>
>> (pp (bindat-unpack partition_entry-spec data)) ;; nil
>> (pp (bindat-unpack partition_entry1-spec data)) ;; ((bootable . 3))
>>
>> Does this work for you?
What you're reading is the doc of `bindat-type` types. Your code OTOH
uses the old types that are passed as a quoted data directly to
`bindat-(un)pack`.
IOW try:
(setq data [3 -3]
partition_entry-spec (bindat-type (bootable uint 8) (partition_type
sint 8 nil))
partition_entry1-spec '((bootable u8) (partition_type s8)))
(bindat-unpack partition_entry-spec data)
=> ((bootable . 3) (partition_type . -3))
(bindat-unpack partition_entry1-spec data)
=> ((bootable . 3))
- Stefan