 TUPLE: trailer byte ;
 CONSTRUCTOR: trailer ( byte -- obj ) ;
 
-CONSTANT: image-descriptor 0x2c
+CONSTANT: IMAGE-DESCRIPTOR 0x2c
 ! Extensions
-CONSTANT: extension-identifier 0x21
-CONSTANT: plain-text-extension 0x01
-CONSTANT: graphic-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
+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


: 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 ] }


: read-graphic-control-extension ( -- graphic-control-extension )
    \ graphics-control-extension new
        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= ;

: read-plain-text-extension ( -- plain-text-extension )
    \ plain-text-extension new
