diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-10-29 15:49:33 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-10-29 15:49:33 -0700 |
commit | adef4143af67eb8874e7013eb2c0b40da2099e5b (patch) | |
tree | f659e252eafbb0e6c074152c077e0c3f29491a57 /txr.1 | |
parent | 8f19618313f5e1342177b8580575df5690195e8c (diff) | |
download | txr-adef4143af67eb8874e7013eb2c0b40da2099e5b.tar.gz txr-adef4143af67eb8874e7013eb2c0b40da2099e5b.tar.bz2 txr-adef4143af67eb8874e7013eb2c0b40da2099e5b.zip |
Extend symbol-function accessor to methods.
* eval.c (looup_fun): Handle (meth ...) syntax.
* share/txr/stdlib/place.tl (sys:get-fb): Function
removed.
(sys:get-fun-getter-setter): New function.
(defplace symbol-function): Rework getter and
setter using new function which works for method
as well as regular function bindings.
* txr.1: Documentation updated in several places.
The mention of symbol-function in the list of place
forms altered so it doesn't insinuate that the argument
must be a symbol. Description of symbol-function
updated. Also under the trace and untrace macros,
a note added that tracing methods is possible.
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 35 |
1 files changed, 31 insertions, 4 deletions
@@ -11395,7 +11395,7 @@ defined by \*(TX programs. .mets (dwim < obj-place < index <> [ alt ]) .mets >> [ obj-place < index <> [ alt ]] ;; equivalent to dwim .mets (symbol-value << symbol-valued-form ) -.mets (symbol-function << symbol-valued-form ) +.mets (symbol-function << function-name-valued-form ) .mets (symbol-macro << symbol-valued-form ) .mets (fun << function-name ) .mets (force << promise ) @@ -14386,7 +14386,7 @@ then the binding takes place in the global environment. .SS* Global Environment .coNP Accessors @, symbol-function @ symbol-macro and @ symbol-value .synb -.mets (symbol-function << symbol ) +.mets (symbol-function >> { symbol | << method-name } ) .mets (symbol-macro << symbol ) .mets (symbol-value << symbol ) .mets (set (symbol-function << symbol ) << new-value ) @@ -14395,7 +14395,9 @@ then the binding takes place in the global environment. .syne .desc -The +If given a +.meta symbol +argument, the .code symbol-function function retrieves the value of the global function binding of the given @@ -14406,7 +14408,20 @@ If .meta symbol has no global function binding, then .code nil -is returned. +is returned. The +.code symbol-function +function also supports method names of the form +.cblk +.meti (meth < struct << slot ) +.cble +where +.meta struct +names a struct type, and +.meta slot +a static slot. Names in this format are returned by the +.meta func-get-name +function. + The .code symbol-macro @@ -14488,6 +14503,10 @@ of the place, which doesn't exist, the macro yields the value .codn nil . +Deleting a method via +.code symbol-function +is not possible; an attempt to do so has no effect. + .TP* "Dialect note:" In ANSI Common Lisp, the @@ -46541,6 +46560,14 @@ and produces the diagnostics around it. When .code untrace is used to disable tracing, the previous definition is restored. +Methods can be traced; their names are given using +.cblk +.meti (meth < struct << slot ) +.cble +syntax: see the +.code func-get-name +function. + .SH* INTERACTIVE LISTENER .SS* Overview |