Next in thread → Next in month →

RE: [xri] Bug in pseudocode?

From
Drummond Reed <>
Date
2008-02-25T21:53:09+00:00
ID
009e01c877f8$c5ddeeb0$0800a8c0@ELROND
Thread
RE: [xri] Bug in pseudocode?
Yes, that’s right. For that reason we
should probably define what “x” means up front, before the pseudocode starts,
and then we can use “For Each X”.

 

=Drummond 

 

From:
 [mailto:] On
Behalf Of Gabe Wachob

Sent: Monday, February 25, 2008
1:35 PM

To: Drummond Reed

Cc: XRI TC

Subject: Re: [xri] Bug in
pseudocode?

 

I think you are saying
that you need a Foreach X in Type, MediaType, Path, right? 

    - Gabe

On Sun, Feb 24, 2008 at 10:39 PM, Drummond Reed <>
wrote:

From:  [mailto:] On
Behalf Of Gabe Wachob

Sent: Sunday, February 24, 2008
4:46 PM

To: XRI TC

Subject: [xri] Bug in pseudocode?

 

Can't
quite figure out the pseudocode here (in sec 13.6):

 IF Present.x=FALSE     ;see 12.3.3 

2668   IF nodefault_x != TRUE   ;see 10.3.2 

2669    SET Default.x=TRUE 

2670   ENDIF 

2671  ENDIF 

It looks like maybe this stuff should be INSIDE the initial FOR loop? Otherwise
x is not defined? 

I'm trying to implement this stuff...

   -Gabe

[=Drummond] Gabe, good catch – nobody noticed that since we
added section 7 right at the end of the CD02 cycle, we needed to update all the
section references in the pseudocode (they are hand-coded references and not
bookmarks).

 

Below is an update to the pseudocode text with all the
references updated.

 

RE the Present.x and nodefault_x references you cite above,
the "x" just stands for "Type, Path, or Mediatype" as was defined
above – nobody thought we needed to redefine it. Maybe we need to take that
definition out of the previous FOR loop and put it at the very start so it's
clear it's a global definition? We just used "x" because it made the
code much more compact than calling out three separate loops, one for Type, one
for Path, and one for Mediatype.

 

I'm wide open to your suggestions for how best to improve
this.

 

=Drummond 

 

FOR
EACH SEP

  CREATE set of SEL match flags

  SET all flags to FALSE

  FOR EACH SEL of category x (where x=Type, Path, or
Mediatype)

         SET
Present.x=TRUE

         IF match on
this SEL is POSITIVE

              
IF
select="true"                 
;see 13.4.2

                     
ADD SEP TO SELECTED SET

                     
NEXT SEP

              
ELSE

                     
SET Positive.x=TRUE

              
ENDIF

         ELSEIF match on
this SEL is DEFAULT      ;see 13.3.2

              
IF Positive.x != TRUE AND

              
nodefault !=
x                   
;see 13.3.5

                     
SET Default.x=TRUE

              
ENDIF

         ENDIF

  ENDFOR

  IF
Present.x=FALSE                      
       ;see 13.3.3

         IF nodefault_x
!=
TRUE                  
;see 13.3.2

              
SET Default.x=TRUE

         ENDIF

  ENDIF

  IF Positive.Type=TRUE AND

     Positive.Path=TRUE AND

    
Positive.Mediatype=TRUE                     
;see 13.4.3

         ADD SEP TO
SELECTED SET

         NEXT SEP

  ELSEIF SELECTED SET !=
EMPTY                   
;see 13.5.1

         NEXT SEP

  ELSEIF (Positive.Type=TRUE OR Default.Type=TRUE) AND

         (Positive.Path=TRUE
OR Default.Path=TRUE) AND

        
(Positive.MediaType=TRUE OR Default.MediaType=TRUE)

         ADD SEP TO
DEFAULT
SET                  
;see 13.4.4

  ENDIF

ENDFOR

IF SELECTED SET =
EMPTY                          
;see 13.5.1

  FOR EACH SEP IN DEFAULT
SET             
;see 13.5.2

         IF
(Positive.Type=TRUE AND Positive.Path=TRUE) OR

         (Positive.Type=TRUE AND
Positive.MediaType=TRUE) OR

         (Positive.Path=TRUE AND
Positive.MediaType=TRUE)

              
ADD SEP TO SELECTED SET

         ENDIF

  ENDFOR

  IF SELECTED SET = EMPTY

         FOR EACH SEP IN
DEFAULT SET       ;see 13.5.2

              
IF Positive.Type=TRUE OR

    
           Positive.Path=TRUE
OR

           
    Positive.MediaType=TRUE

                     
ADD SEP TO SELECTED SET

              
ENDIF

         ENDFOR

  ENDIF

ENDIF

IF SELECTED SET != EMPTY

  RETURN SELECTED SET

ELSE

  RETURN DEFAULT SET

ENDIF

 

-- 

Gabe Wachob /  \ http://blog.wachob.com
Next in thread → Next in month →