unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Danny Milosavljevic <dannym@scratchpost.org>
To: zimoun <zimon.toutoune@gmail.com>
Cc: Guix Devel <guix-devel@gnu.org>
Subject: Re: Discoverability at the REPL level
Date: Sun, 15 Nov 2020 15:49:42 +0100	[thread overview]
Message-ID: <20201115154942.57e5f868@scratchpost.org> (raw)
In-Reply-To: <86d00evkmr.fsf@gmail.com>

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

Hi zimoun,

On Sun, 15 Nov 2020 14:02:04 +0100
zimoun <zimon.toutoune@gmail.com> wrote:

> In an ideal world, the first ’,a’ could provide hint for the module to
> ’,use’

There is no "the" module.  Any number of modules could have your searched-for
symbol--and the procedures so found could do completely unrelated things.  One
of the points of using modules in the first place is in order to group together
related things (and in order not to have unrelated things together).

What would be nice is for the module names to be easy to understand so you know
which module to import.  That's currently not great.  For example I have no
idea when something goes into (guix packages) vs (gnu packages).

Also, it would be nice and easy to implement to actually have the Guile REPL
search for all possible loadable modules that contain some symbol if it
encounters an unknown symbol, and print those, too (Guix often already does
that anyway!).

It should be easy to add such a thing to the guile repl.  In addition to
",describe" and ",apropos" there would be ",search" which would loop through
all modules, find the specified symbol and then print the docstrings of each
of those, including the module to use for each.

But since these modules can contain code that runs at module import time,
that's maybe also not what you want to actually happen (it would execute
code of random modules that are in the search path).
Then again, guile has declarative modules, too.  If those don't do that,
maybe just search in those.

Also, maybe you don't want Guile to actually IMPORT things into your namespace
when you do ",search".  You just want guile to list them.  That would be the
only complication.

... in before someone points out that this already exists in guile ;)

> and the ’,d’ should provide both signature and docstring.

I agree.  It's useless to separate those.  I mean it's nice that ",a"
exists--but then having ",d" not list the signature is just causing more work
for the developer.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2020-11-15 14:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-15 13:02 Discoverability at the REPL level zimoun
2020-11-15 14:49 ` Danny Milosavljevic [this message]
2020-11-16 11:46   ` Ludovic Courtès
2020-11-16 14:03 ` Tobias Geerinckx-Rice
2020-11-16 14:47   ` zimoun
2020-11-16 14:21 ` Bengt Richter

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://guix.gnu.org/

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

  git send-email \
    --in-reply-to=20201115154942.57e5f868@scratchpost.org \
    --to=dannym@scratchpost.org \
    --cc=guix-devel@gnu.org \
    --cc=zimon.toutoune@gmail.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

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).