[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Ideas for making Guile easier to approach
From: |
Olivier Dion |
Subject: |
Re: Ideas for making Guile easier to approach |
Date: |
Wed, 09 Feb 2022 16:05:40 -0500 |
On Wed, 09 Feb 2022, Christine Lemmer-Webber <cwebber@dustycloud.org> wrote:
> Module names
> ============
>
> ice-9 -> guile
> --------------
> I think that ice-9 is a weird namespace for "guile's standard library"
> but it's what we have for historical reasons. Still I would have
> preferred that namespace simply be "guile", so we have (guile match) and
> (guile format) instead of (ice-9 ...). It would be clearer what ice-9
> *is* to have it be called "guile" instead. But maybe it's too late for
> that. How much work would it be to do an alias like this?
This is so true. (guile) should have be the name of that module. It
can be very confusing for newcomers.
> Named SRFIs
> -----------
>
> If it's possible to do such aliases, I'd also say that making sense of
> what SRFI module is what is a real mess for me. (srfi srfi-9) doesn't
> tell me what that SRFI *is*. However, if we supported "named" versions
> of SRFIs, that would help me. Which of these would be easier to read?
I too find this very weird. I don't have a cheat sheet for SRFI name
mapping on my desk and it's very awkward. Image if python was doing
this ..
import srfi.srfi-1
import srfi.srfi-26
import srfi.srfi-64
now very much human friendly.
> We had:
>
> (define-module (my-module)
> #:use-module (guile match)
> #:use-module (guile format)
> #:use-module (srfi list-utils)
> #:use-module (srfi records)
> #:use-module (srfi args-fold)
> #:use-module (srfi streams)
> #:use-module (srfi tests))
>
> Much easier to follow, no?
Yes! For the aliases I think something like this could work for now:
(define-syntax-rule (alias-module module-name)
(let ((mod (current-module)))
(module-for-each (lambda (sym var) (module-define! mod sym var))
(module-public-interface
(resolve-module (quote module-name))))
(module-export-all! mod)
#f))
then in srfi/tests.scm:
(define-module (srfi tests))
(alias-module (srfi srfi-64))
Ideally, something like this should be supported instead:
(define-module (srfi srfi-64)
#:alias (srfi tests))
--
Olivier Dion
Polymtl
- Re: Newbie thoughts on Guile Hall + Guix, (continued)
- Re: Newbie thoughts on Guile Hall + Guix, dsmich, 2022/02/06
- Re: Newbie thoughts on Guile Hall + Guix, Blake Shaw, 2022/02/08
- Re: Newbie thoughts on Guile Hall + Guix, Chris Vine, 2022/02/08
- Re: Ideas for making Guile easier to approach,
Olivier Dion <=
- Re: Ideas for making Guile easier to approach, Maxime Devos, 2022/02/09
- Re: Ideas for making Guile easier to approach, Chris Vine, 2022/02/09
- Re: Ideas for making Guile easier to approach, Timothy Sample, 2022/02/09
- Re: Ideas for making Guile easier to approach, Ricardo Wurmus, 2022/02/10
- Re: Ideas for making Guile easier to approach, Blake Shaw, 2022/02/09
- Re: Ideas for making Guile easier to approach, paul, 2022/02/09
- Re: Ideas for making Guile easier to approach, Mikael Djurfeldt, 2022/02/10
- Re: Ideas for making Guile easier to approach, Leo Butler, 2022/02/10
- Re: Ideas for making Guile easier to approach, Mikael Djurfeldt, 2022/02/10
- Re: Ideas for making Guile easier to approach, Olivier Dion, 2022/02/10