View Single Post
Old 02-16-2011, 08:06 AM   #151
bblue
Human being with feelings
 
Join Date: Mar 2010
Location: El Cajon, CA (San Diego)
Posts: 593
Default Updated WALTER doc

Hi WT,

I've been reading over your comparison operators addition to the Themeing Guide of 2/15 and have a couple of suggestions.

1. In the AND section, it would be most helpful to explain the difference between a bitwise comparison, versus a value comparison (logical). Most general ANDing is not bitwise, it's valuewise (ie does var1 have a value AND does var2 have a value). So a 1 and a 2 ANDed would be TRUE in a valuewise AND, whereas the results would be FALSE in a bitwise AND.

2. In the example

set fish w<300 [1] [0]
set chips h<100 [1] [0]
set tcp.solo fish{0}&chips{0} [numbers true] [numbers false]

It's important to note that you are bitwise ANDing a 1 to a 1, that not any positive number can be used, but nothing but a zero should be used in the second set field. It is mentioned later, sort of.

What else will work?

set fish w<300 1
set chips h<100 1
set tcp.solo fish{0}&chips{0} [numbers true] [numbers false]

What won't work?

set fish w<300 1
set chips h<100 100

because it's not a valuewise AND. Bitwise there are no bits in common.

set tcp.solo w<300&h<100 [numbers true] etc.

because WALTER cannot use the results of tests as inputs to another test.

set fish w<300 or set fish (w<300)

same reason, even though when w is below 300 w<300 is TRUE, or 1, it can't be assigned to a variable. Parenthesis are not understood.


For future discussion in the documentation, something I'd like to fully understand is when and with what syntax can variables be added (or subtracted) and later tested? Likewise with a variable and a constant? I've found what seems to be a workaround for the variable + constant issue, but NAC how to work with two variables. It would be great to get an overview from the devs as to each type of value (user variable, system variable, array{0}, constant), adding system variables to user variables, adding system or user variables and constants, and how they relate and interact. It seems (to me) that it should be a whole lot simpler than it is.

--Bill
bblue is offline   Reply With Quote