guile-user
[Top][All Lists]
Advanced

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

Re: Higher order modules: a first stab


From: Ludovic Courtès
Subject: Re: Higher order modules: a first stab
Date: Wed, 21 Mar 2012 20:16:38 +0100
User-agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.93 (gnu/linux)

Hello,

Sorry for the delay.

This looks nice.

Ian Price <address@hidden> skribis:

> Currently, parameterized modules are functions that return a
> module, and functions are retrieved by module-ref. This is fine for a
> proof of concept, but hopefully I'll have something better integrated
> soon.

Would be cool to see how higher-order module support could be added to
our module system.

Something like:

  (define-module (seq-utils)
    #:require (kar kdr)
    #:export (take drop))

  ...

and:

  (define-module (srfi srfi-1)
    #:use-module ((seq-utils) #:with (car cdr)))

  ...

  (define-module (ice-9 vlist)
    #:use-module ((seq-utils) #:with (vlist-head vlist-tail)))

  ...

  (resolve-module '(seq-utils) #:with (list car cdr))
  => fresh module

  (resolve-module '(seq-utils))
  =| error

WDYT?

Thanks,
Ludo’.




reply via email to

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