 
 : read-graphic-control-extension ( -- graphic-control-extension )
     \ graphics-control-extension new
-        1 read le> graphic-control-extension-block-size assert=
+        1 read le> GRAPHIC-CONTROL-EXTENSION-BLOCK-SIZE assert=
         1 read le> >>flags
         2 read le> >>delay-time
         1 read le> >>transparent-color-index
-        1 read le> block-terminator assert= ;
+        1 read le> BLOCK-TERMINATOR assert= ;
 
 : read-plain-text-extension ( -- plain-text-extension )
     \ plain-text-extension new


: read-extension ( loading-gif -- loading-gif )
    read1 {
        { plain-text-extension [
            read-plain-text-extension over plain-text-extensions>> push
        ] }

        { graphic-control-extension [
            read-graphic-control-extension
            over graphic-control-extensions>> push
        ] }
        { comment-extension [
            read-comment-extension over comment-extensions>> push
        ] }
        { application-extension [
            read-application-extension over application-extensions>> push
        ] }
        { f [ gif-unexpected-eof ] }

TUPLE: trailer byte ;
CONSTRUCTOR: trailer ( byte -- obj ) ;

CONSTANT: IMAGE-DESCRIPTOR 0x2c
! Extensions
CONSTANT: EXTENSION-IDENTIFIER 0x21
CONSTANT: PLAIN-TEXT-EXTENSION 0x01
CONSTANT: GRAPHICS-CONTROL-EXTENSION 0xf9
CONSTANT: COMMENT-EXTENSION 0xfe
CONSTANT: APPLICATION-EXTENSION 0xff
CONSTANT: TRAILER 0x3b
CONSTANT: GRAPHIC-CONTROL-EXTENSION-BLOCK-SIZE 0x04
CONSTANT: BLOCK-TERMINATOR 0x00

: <loading-gif> ( -- loading-gif )
    \ loading-gif new
