Is ":" (colon) an undocumented shortcut for aref?

I’ve seen this done in a plugin:

(setf snd (vector (snd-copy (: *track* 0)) (snd-copy (: *track* 1)))))

Is that “(:” a shortcut for “(aref”?

I doesn’t appear documented in the XLisp manual.

Ah, never mind, the “shortcut” was defined in the plugin itself:

(defmacro  : (array index) (backquote (aref ,array ,index)))

Personally I would have preferred the (very slightly) longer version using “aref” on the basis that it would be more easily readable.


Fwiw, rather than:

(defmacro  : (array index) (backquote (aref ,array ,index)))

it could have been written more succinctly as:

(setfn : aref)

I don’t think that SETFN is documented in the manual, but there are a few cases where it is used in the Nyquist source code.

The LISP syntax is:
(SETFN symbol functional-symbol)
It sets the functional value of symbol to the functional value of functional-symbol.

Probably not a good idea to use this unless really necessary as it is likely to produce less readable code.