Name

attr

Usage

special-form/function

Syntax

(attr obj attr-name)

Description

Returns the value of attribute or property attr-name of obj. The compiler generates efficient code if attr-name is a compile-time constant, otherwise the compiler uses a call to the function attr.

user > (attr "hello" :length)
it: 5
user > (let s "length")
it: s
user > (attr "hello" s)
it: 5