Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Re: Antwort: Re: (No subject)Date: Wed, 22 Nov 2000 00:30:29 +1100

From: brett:codeconscious at: 22-Nov-2000 10:22

> Haven't seen one like that outside C or assembler though :)
How about Cobol? ;)
>A lot of people > prefer to do a modulo 2 on the loop counter and use a different colour > depending n whether the result is 0 or 1
If it were rotating through 3 or more colours or the number of bands was a parameter then modulo is the way to go. Then again it would probably look hideous :) For this flexibility you pay the cost of a calculation plus a test and an assignment. Whereas the simple flag costs the test and an assignment. Since it is a simple flag I should probably have used a logic rather than a word like this highlight-flag: true for row 1 10 1 [ print highlight-flag highlight-flag: not highlight-flag ]
> (I failed a job test once > because > I used this sort of flip rather than a modulo, seems some people > consider > it a bit "dirty"..))
Sounds like the employer failed :) Flags have always been valid state variables - they've just been given a bad name when used as examples of what not to do in object oriented programming. They still have their uses. Brett.