manpagez: man pages & more
info guile
Home | html | info | man
[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.6.1 Accessors

An accessor is a generic function that can also be used with the generalized set! syntax (see section Procedures with Setters). Guile will handle a call like

(set! (accessor args…) value)

by calling the most specialized method of accessor that matches the classes of args and value. define-accessor is used to bind an identifier to an accessor.

syntax: define-accessor symbol

Create an accessor with name symbol and bind it to the variable symbol. If symbol was previously bound to a Scheme procedure (or procedure-with-setter), the old procedure (and setter) is incorporated into the new accessor as its default procedure (and setter). Any other previous value, including an existing generic function or accessor, is discarded and replaced by a new, empty accessor.


This document was generated on February 3, 2012 using texi2html 5.0.

© manpagez.com 2000-2024
Individual documents may contain additional copyright information.