std-defconstant


Synopsis

(std-defconstant '<sym> <value>)

Description

STD-DEFCONSTANT is used to initialize a global variable to a single static value and mark the variable as conatnt which is supported by Visual and Vital Lisp.

Any subsequent assignment to this symbol may either print a warning or an error. It is visually marked in blue.

It sets sym to the return value of the argument value, which may be any expression.

It is comparable to the Common Lisp macro DEFCONSTANT.

Note

There's no reliable way yet to check for a symbol if it's a constant, so there's no STD-CONSTANTP predicate yet. This might arise problems in complicated and dynamic application loading schemes, but BOUNDP on a non nil value should be sufficient.

Example

(std-defconstant 'my:length 10.0)

Arguments

sym: a quoted symbol, which evaluates to a symbol which needs not to be bound.

value: any valid lisp expression

Return Value

The return value of value.

Side Effects

This function is only called because of its side effect.

It changes the value of sym.

The argument <value> is always evaluated.

Module

(std-require 'STDLISP)

Defined in STDLISP