[ < ] [ > ]   [ << ] [Plus haut] [ >> ]         [Top] [Table des matières] [Index] [ ? ]

8.4.2 Property List Functions for Symbols

Function: symbol-plist symbole

This function returns the property list of symbol.

Function: setplist symbol plist

This function sets symbol's property list to plist. Normally, plist should be a well-formed property list, but this is not enforced. The return value is plist.

 
(setplist 'foo '(a 1 b (2 3) c nil))
     ⇒ (a 1 b (2 3) c nil)
(symbol-plist 'foo)
     ⇒ (a 1 b (2 3) c nil)

For symbols in special obarrays, which are not used for ordinary purposes, it may make sense to use the property list cell in a nonstandard fashion; in fact, the abbrev mechanism does so (voir la section Abbrevs et expansion d'abbrev).

Function: get symbole propriété

This function finds the value of the property named property in symbol's property list. If there is no such property, nil is returned. Thus, there is no distinction between a value of nil and the absence of the property.

The name property is compared with the existing property names using eq, so any object is a legitimate property.

Consultez put pour un exemple.

Function: put symbole propriété valeur

This function puts value onto symbol's property list under the property name property, replacing any previous property value. The put function returns value.

 
(put 'fly 'verb 'transitive)
     ⇒'transitive
(put 'fly 'noun '(a buzzing little bug))
     ⇒ (a buzzing little bug)
(get 'fly 'verb)
     ⇒ transitive
(symbol-plist 'fly)
     ⇒ (verb transitive noun (a buzzing little bug))

Ce document a été généré par Eric Reinbold le 13 Octobre 2007 en utilisant texi2html 1.78.