XLISP address-of

Nyquist / XLISP 2.0 - Contents | Tutorials | Examples | Reference

# address-of

Type: | - | function (subr)
Source: | - | xlmath.c

## Syntax

(address-of expr)
  expr - an expression
  returns - the memory address of the expression as an integer

## Description

The 'address-of' function returns the internal memory address of the XLISP node that corresponds to 'expr'. The value returned is an integer.

## Examples

    (setq var 0)                    => 0   ; set up VAR with 0
    (address-of var)                => 123224
    (address-of 'var)               => 182638
    (peek (address-of var))         => 83951616
    (peek (1+ (address-of var)))    => 16777216
    (peek (+ 2 (address-of var)))   => 0   ; value of VAR
    (setq var 14)                   => 14  ; change the value to 14
    (peek (+ 2 (address-of var)))   => 14
    (setq var 99)                   => 99  ; change the value to 99
    (peek (+ 2 (address-of var)))   => 99

See + , 1+, peek, setq.

Nyquist: The 'address-of' function is internally disabled, but the code still exists. Look out for PEEK_AND_POKE in the Nyquist source code.

Caution: Be careful when modifying the internal state of XLISP. If you have modified it, it would be a good idea to exit XLISP and re-enter before doing any work you really want to retain.

See also:

- Contents → System Functions

Back to Top

Nyquist / XLISP 2.0 - Contents | Tutorials | Examples | Reference