2.24 Can anyone explain the use of "brackets" ([]) and dereferencing in CI programing?

Generally, you put brackets around CI expressions, not just variables.

For example, you could say:

:SETVAR A B+C

:ECHO The answer is !A

Or you could just directly say:

:ECHO The answer is ![B+C]

The ![...] construct allows an expression to be embedded in a command line that normally never expects an expression. For example,

:build myfile;disc=![finfo(otherfile,'eof')*2]

lets you create a new file that is twice as large as some other file. The BUILD command expects a simple integer for the size of the file, and that is what the command actually receives as an argument. Before the BUILD command is executed, the CI substitutes the result of the expression into the command line.

Note that there is a difference between !varname and ![varname]:

:setvar foo "foo!!bar"

:setvar bar "abc"

:echo !foo

fooabc

:echo ![foo]

foo!bar

This example reveals that !varname recursively (or dynamically) dereferences varname; whereas, ![varname] does not. ![varname] just retrieves the immediate value of varname, without further evaluation.