guix-devel
[Top][All Lists]
Advanced

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

Re: Discoverability at the REPL level


From: Bengt Richter
Subject: Re: Discoverability at the REPL level
Date: Mon, 16 Nov 2020 15:21:16 +0100
User-agent: Mutt/1.10.1 (2018-07-13)

Hi Simon,

On +2020-11-15 14:02:04 +0100, zimoun wrote:
> Dear,
> 
> Preparing the online Guix Days, maybe this discussion is worth.  It
> echoes first with the talks “Guix compared to Nix” then with the recent
> discussion about Emacs-Guix [1].
> 
> 
> The topic is discoverability at the REPL level.
> 
> 
> Well, I have a proposal draft «“guix repl” and beyond» that I never
> sent, where the ideas was to discuss ’~/.guile’ and how to extend Guix
> ending with these questions:
> 
>  1. Does Guix want a system of aliases?  For example, let the script
>  “~/.config/guix/scripts/foo.scm“ and then ‘guix foo’.
> 
>  2. How could the API be more discoverable?
>

I find this bash script useful:
--8<---------------cut here---------------start------------->8---
#!/usr/bin/bash
echo "----from apropos:"
guile <<EOF | grep ": ${1:-help}"
,a ${1:-help}
EOF
guile <<EOF | tail -n +9
(display "----describe:\n")
,d  ${1:-help}
(display "----\n")
EOF
--8<---------------cut here---------------end--------------->8---
Just name it, e.g., guap (for GU.ile AP.ropos :)
chmod 755 guap

then try e.g.
guap string=
--8<---------------cut here---------------start------------->8---
----from apropos:
(guile): string=        #<procedure string= (_ _ #:optional _ _ _ _)>
(guile): string=?       #<procedure string=? (#:optional _ _ . _)>
----describe:
- Scheme Procedure: string= s1 s2 [start1 [end1 [start2 [end2]]]]
     Return `#f' if S1 and S2 are not equal, a true value otherwise.
----
--8<---------------cut here---------------end--------------->8---

Have fun tailoring to suit yourself.
Maybe some variations on restricting
the apropos output better than my grep :)
Or add some other ,xxx stuff or guile code to taste.

Note that you can of course invoke guap from emacs
like inserting the output of any bash command, as I did
for the above snip (writing this in emacs as mutt's editor choice).

>  3. Is the experimental ‘guix repl --gui’ reasonable?
> 
> 
> The #1 popup’ed up in #38529 [2,3] and it is not related to
> discoverablity but not orthogonal either.
> 
> The #3 means open Guile-Studio or any other front-end and echoes the
> recent discussion about GUI front-end [4].
> 
> 
> Therefore, here materials about the point #2. :-)
> 
> 
> (The attentive reader is waiting for parametrized package PoC :-) and a
> first discussion and arguments are this long thread [5].)
> 
> 
> Feed back and ideas welcome.  Especially about:
> 
>         There are probably several ways to address it, including the
>         unbound-variable hints and documentation.
> 
> 
> All the best,
> simon
> 
> 
> 1: 87tuttci4z.fsf_-_@gnu.org">https://yhetil.org/guix-devel/87tuttci4z.fsf_-_@gnu.org
> 2: https://yhetil.org/guix-bugs/87y2jie1aj.fsf@gmail.com/
> 3: http://issues.guix.gnu.org/issue/38529#60
> 4: 
> https://yhetil.org/guix-devel/CAF-xJgsynM3KSzuM__f9dSPUC0epJ2QKdFwDftiLhTTuMfaTxw@mail.gmail.com
> 5: https://yhetil.org/guix-devel/87woitz1xx.fsf@gnu.org/
> 
[...]
-- 
Regards,
Bengt Richter



reply via email to

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