[gambit-list] Reading binary files
Bob McIsaac
bobmc at fcibroadband.com
Wed Dec 19 00:31:55 EST 2007
Bradley Lucier wrote:
>
> On Dec 18, 2007, at 10:31 PM, Bob McIsaac wrote:
>
>> (define (integer-in )
>> (set! *filesize* (- *filesize* 4))
>> (bitwise-ior
>> (bitwise-and (arithmetic-shift (read-u8 INP) 24) #xff000000)
>> (bitwise-and (arithmetic-shift (read-u8 INP) 16) #xff0000)
>> (bitwise-and (arithmetic-shift (read-u8 INP) 8) #xff00)
>> (bitwise-and (read-u8 INP) #xff)))
>
> This code assumes that arguments to functions are evaluated
> left-to-right.
>
> Do
>
> (let* ((byte-1 (read-u8 INP))
> (byte-2 (read-u8 INP))
>
> etc.
>
>
>
>
Well, it's a ponderous solution that needs refactoring but I don't
understand how order of evalution comes into play. Since LISP is said
not to need parsing, there is no tree of values and operations to
prioritize. Instead, there are only linked lists to follow. That's my
primitive understanding so far.
More information about the Gambit-list
mailing list