PSC Code Manual

util/symbol.lsp [src]

Symbol-handling functions

Functions

Function signature Description
(#! expr-lst) Alias for macro-expand
(chkargs chkargs-func-name chkargs-args) Validates arguments in the current function.
(cornerkey key) Returns the value of the symbol named [CORNER]_[KEY].
(defined x) Returns nil if X is null.
(fbkey key) Returns the value of the symbol named [FB]_[KEY].
(lrkey key) Returns the value of the symbol named [LR]_[KEY].
(macro-expand expr-lst) Return quoted list EXPR-LST with certain elements evaluated.
(propagate var-sym value) Sets VAR-SYM to VALUE and calls vl-propagate
(sidekey key) Returns the value of the symbol named [SIDE]-[KEY].
(sidekey-rail key) Returns the value of the symbol named [SIDE]-rail_[KEY].
(swap! v1 v2) Swaps two variables.
(sym-lst-p sym) Returns nil if SYM is not a symbol or if its value is not a list
(symcat str-lst) Concatenates strings in STR-LST and returns the value of the resulting symbol.
(tbkey key) Returns the value of the symbol named [TB]_[KEY].

(#! expr-lst)

Alias for macro-expand

(chkargs chkargs-func-name chkargs-args)

Validates arguments in the current function.

See defun-r--process-declare-vars for a simplified way to invoke this function.

CHKARGS-FUNC-NAME should be the current function's name as a string. It is used for
reporting errors.

CHKARGS-ARGS should be an argument spec. Its length should be equal to the number of
arguments this function takes. At minimum, CHKARGS-ARGS should be a list of argument names
as symbols.

For each item in CHKARGS-ARGS:
[car] is the argument name as a symbol.
[cadr] is the expected type, which may be a symbol or a list of symbols
[caddr] is an optional list. Each item is a validator to be run against [car]. This may be
a symbol pointing to a function which takes one argument or a list to eval. If a validator
returns nil, throw an error.

(cornerkey key)

Returns the value of the symbol named [CORNER]_[KEY].

VARS:
(CORNER STR)
(KEY STR)

(defined x)

Returns nil if X is null.

(fbkey key)

Returns the value of the symbol named [FB]_[KEY].

VARS:
(FB STR)
(KEY STR)

(lrkey key)

Returns the value of the symbol named [LR]_[KEY].

VARS:
(LR STR)
(KEY STR)

(macro-expand expr-lst)

Return quoted list EXPR-LST with certain elements evaluated.

Macro-expand will evaluate elements of EXPR-LST which are prefaced by a #. Example:

(setq foo 4
      bar 7)
(macro-expand '(+ 1 #foo #(+ bar foo 3)))

will return the list '(+ 1 4 14).

(propagate var-sym value)

Sets VAR-SYM to VALUE and calls vl-propagate

(sidekey key)

Returns the value of the symbol named [SIDE]-[KEY].

VARS:
(SIDE STR)
(KEY STR)

(sidekey-rail key)

Returns the value of the symbol named [SIDE]-rail_[KEY].

VARS:
(SIDE STR)
(KEY STR)

(swap! v1 v2)

Swaps two variables.

(sym-lst-p sym)

Returns nil if SYM is not a symbol or if its value is not a list

(symcat str-lst)

Concatenates strings in STR-LST and returns the value of the resulting symbol.

(tbkey key)

Returns the value of the symbol named [TB]_[KEY].

VARS:
(TB STR)
(KEY STR)