guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Some issues with guile


From: Luis Felipe
Subject: Re: Some issues with guile
Date: Sat, 27 Apr 2024 20:24:13 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.0

Hi Linas,

El 27/04/24 a las 17:35, Linas Vepstas escribió:
On Sat, Apr 27, 2024 at 2:47 AM Nikolaos Chatzikonstantinou <
nchatz314@gmail.com> wrote:

On Fri, Apr 26, 2024 at 4:39 PM Tomas Volf <~@wolfsden.cz> wrote:
What you want is:

     (set-object-property! foo 'documentation "Contains a @code{'bar}.")
Okay, so this can document objects. I propose that a good-enough
solution is to document symbols.

  (define foo 42)
(set-object-property! foo 'documentation "my foo thing")
,a foo
(guile-user): foo
,d foo
my foo thing
(define (bar) (list 'a))
(set-object-property! bar 'documentation "this bar does stuff")
,a bar
(guile-user): bar #<procedure bar ()>
(guile): module-obarray-ref #<procedure module-obarray-ref (ob key)>
...
,d bar
this bar does stuff

where ,a is short for ,apropos and ,d is short for ,describe

If I understand correctly, though, the "set-object-property!" procedure is part of a legacy interface. The manual recommends using object properties as shown in the Object Properties section instead (https://www.gnu.org/software/guile/manual/html_node/Object-Properties.html).


Attachment: OpenPGP_0x0AB0D067012F08C3.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]