OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

xri message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: RE: [xri] Pseudocode compacting


Wil,

At the time you brought this up, I said the test was to see if your
"compaction" would be as readable or more readable.

Congrats. To my eyes, I think your version is at least as readable, if not
more readable simply because it's shorter.

Being as close to closing the spec as we are, I'm going to go for the close
on this: if anyone does NOT agree and thinks we should stick with the
current pseudocode in ED07, please post to the list before Saturday.

Otherwise, this weekend I'll roll Wil's compacted version into ED08.
 
Thanks,

=Drummond 

> -----Original Message-----
> From: Tan, William [mailto:William.Tan@neustar.biz]
> Sent: Thursday, November 01, 2007 3:50 PM
> To: XRI TC
> Subject: [xri] Pseudocode compacting
> 
> This was just an exercise I did to compact the pseudocode in XRI
> Resolution 2.0 WD11-ED06, section 12.6.
> By assuming the semantics of looping constructs in "modern procedural
> languages", I was able to save 13 lines.
> 
> The new pseudocode is attached, and I'm listing the diff here:
> 
> 
> --- sel.old     2007-10-22 22:15:15.000000000 +0000
> +++ sel.new     2007-10-22 22:34:30.000000000 +0000
> @@ -9,19 +9,11 @@
>                                 NEXT SEP
>                         ELSE
>                                 SET Positive.x=TRUE
> -                               NEXT SEL
>                         ENDIF
>                 ELSEIF match on this SEL is DEFAULT     ;see 10.3.2 &
> 12.3.4
> -                       IF Positive.x=TRUE                      ;see
> 12.3.5
> -                               NEXT SEL
> -                       ELSEIF nodefault="x"            ;see 10.3.2
> -                               NEXT SEL
> -                       ELSE
> +                       IF Positive.x != TRUE AND nodefault != x
> ;see 12.3.5
>                                 SET Default.x=TRUE
> -                               NEXT SEL
>                         ENDIF
> -               ELSEIF match on this SEL is NEGATIVE    ;see 12.3.1
> -                       NEXT SEL
>                 ENDIF
>         ENDFOR
>         IF Matched.x=FALSE                                      ;see
> 12.3.3
> @@ -42,10 +34,7 @@
>                 ADD SEP TO DEFAULT SET                  ;see 12.4.4
>         ENDIF
>  ENDFOR
> -IF SELECTED SET != EMPTY                               ;see 12.5.1
> -       RETURN SELECTED SET
> -ENDIF
> -IF DEFAULT SET != EMPTY                                ;see 12.5.2
> +IF SELECTED SET = EMPTY                                ;see 12.5.1
>         FOR EACH SEP IN DEFAULT SET
>                 IF (Positive.Type=TRUE AND Positive.Path=TRUE) OR
>                 (Positive.Type=TRUE AND Positive.MediaType=TRUE) OR
> @@ -53,20 +42,18 @@
>                         ADD SEP TO SELECTED SET
>                 ENDIF
>         ENDFOR
> -       IF SELECTED SET != EMPTY
> -               RETURN SELECTED SET
> -       ENDIF
> -       FOR EACH SEP IN DEFAULT SET
> -               IF Positive.Type=TRUE OR
> -               Positive.Path=TRUE OR
> -               Positive.MediaType=TRUE
> -                       ADD SEP TO SELECTED SET
> -               ENDIF
> -       ENDFOR
> -       IF SELECTED SET != EMPTY
> -               RETURN SELECTED SET
> -       ELSE
> -               RETURN DEFAULT SET
> +       IF SELECTED SET = EMPTY
> +               FOR EACH SEP IN DEFAULT SET
> +                       IF Positive.Type=TRUE OR
> +                       Positive.Path=TRUE OR
> +                       Positive.MediaType=TRUE
> +                               ADD SEP TO SELECTED SET
> +                       ENDIF
> +               ENDFOR
>         ENDIF
>  ENDIF
> -RETURN EMPTY SET
> +IF SELECTED SET != EMPTY
> +       RETURN SELECTED SET
> +ELSE
> +       RETURN DEFAULT SET
> +ENDIF
> 
> 
> 
> =wil



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]