unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Jacob Hrbek <kreyren@rixotstudio.cz>
To: "guile-devel@gnu.org" <guile-devel@gnu.org>
Subject: Feature request: Ability to document variables like defvar in elisp
Date: Wed, 02 Nov 2022 01:08:54 +0000	[thread overview]
Message-ID: <LiTscVSM2RR0VvU5ApHzCfEF9N50feJIrnFlW7aSP-OqmMV1Nd1l-RgvzFwGsB_RrdQgHp_dCsF-sSiuAYcu4BViwNISOGGAzdMrb3rAalU=@rixotstudio.cz> (raw)

[-- Attachment #1: Type: text/plain, Size: 889 bytes --]

The ability to document variables is critical for many projects such as libfive where the variables is used to declares functional computer aided design structure and other projects where variables influence the workflow.

Thus proposing to change the 'define' behavior for variables to implement:

(define variable default-value docstring)
^^^^^^

Where docstring is optional and in case it's provided to call for example:

(set-procedure-property! variable 'documentation docstring)

So that it can be called from (help variable):

scheme@(guile-user)> (help variable)
`variable' is a procedure in the (guile) module.
expanded docstring here

This way it will also make it possible to easily implement development environment that shows the documentation on cursor hover.

---

Credit: Inspired by 'defvar' from elisp:

(defvar variable default-value docstring)

-- Jacob "Kreyren" Hrbek

[-- Attachment #2: Type: text/html, Size: 1598 bytes --]

             reply	other threads:[~2022-11-02  1:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-02  1:08 Jacob Hrbek [this message]
2022-11-02  8:28 ` Feature request: Ability to document variables like defvar in elisp Jean Abou Samra
2022-11-02 10:15   ` Mikael Djurfeldt
2022-11-04 15:10     ` Jean Abou Samra
2022-11-05  4:19   ` Jacob Hrbek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='LiTscVSM2RR0VvU5ApHzCfEF9N50feJIrnFlW7aSP-OqmMV1Nd1l-RgvzFwGsB_RrdQgHp_dCsF-sSiuAYcu4BViwNISOGGAzdMrb3rAalU=@rixotstudio.cz' \
    --to=kreyren@rixotstudio.cz \
    --cc=guile-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).