[Top][All Lists]

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

wip-namespace review

From: Ludovic Courtès
Subject: wip-namespace review
Date: Sat, 24 Apr 2010 18:55:45 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)


Here’s a quick review of Andy’s ‘wip-namespace’ and related changes.
We’re rushing and I’m probably misunderstanding things, or not
understanding things at all, but it’s hard for me to keep up.

Regarding the single module/variable name space, I was convinced that it
was annoyingly constraining module names; however, as illustrated at
<> that constraint
has vanished somehow, making it less of a problem IMO.

Besides, you said at
<> that this is “not
something we can change right now.”.  :-)

So, apologize if that should be obvious to me, but can you please
re-explain why this is important?

To app or not to %app?

  commit 30ce621c5ac9b67420a9f159b2195f6cd682e237
  Author: Andy Wingo <address@hidden>
  Date:   Thu Apr 22 15:08:13 2010 +0200

      (app modules) -> (%app modules)

  commit c9904ab0406d0bf3415696f319760f67b218a638
  Author: Andy Wingo <address@hidden>
  Date:   Tue Apr 20 13:41:41 2010 +0200

      formally deprecate `app'

  commit cb67c838f5658a74793f593c342873d32e4a145c
  Author: Andy Wingo <address@hidden>
  Date:   Thu Apr 22 15:25:09 2010 +0200

      deprecate %app

  commit 635a8b36b1dbed877fb8df752600870e9e1ee625
  Author: Andy Wingo <address@hidden>
  Date:   Fri Apr 23 15:58:08 2010 +0200

      deprecated %app shims use module-define-submodule!

I have a hard time following that story.  :-)

  commit 993dae8623e0fe6195000afb81902ea466bd2dc4
  Author: Andy Wingo <address@hidden>
  Date:   Fri Apr 23 17:03:34 2010 +0200

      module-public-interface in Scheme


  diff --git a/libguile/modules.c b/libguile/modules.c
  index ccb68b7..c8a4c2a 100644
  --- a/libguile/modules.c
  +++ b/libguile/modules.c
  @@ -44,7 +44,16 @@ scm_t_bits scm_module_tag;

   static SCM the_module;

  +static SCM module_make_local_var_x_var;

Please keep comments above variables, or add one for all of them (info
"(standards) Comments").
  commit 4e48b4950ecaa10265de6709bf87597a818cf44d
  Author: Andy Wingo <address@hidden>
  Date:   Fri Apr 23 17:16:56 2010 +0200

      module-public-interface is a field in the module record


  +;; Allow code that poked %module-public-interface to keep on working.
  +(set! module-public-interface
  +      (let ((getter module-public-interface))
  +        (lambda (mod)
  +          (or (getter mod)
  +              (cond
  +               ((and=> (module-local-variable mod '%module-public-interface)
  +                       variable-ref)
  +                => (lambda (iface)
  +                     (issue-deprecation-warning 
  +"Setting a module's public interface via munging %module-public-interface is
  +deprecated. Use set-module-public-interface! instead.")
  +                     (set-module-public-interface! mod iface)
  +                     iface))
  +               (else #f))))))
  +(set! set-module-public-interface!
  +      (let ((setter set-module-public-interface!))
  +        (lambda (mod iface)
  +          (setter mod iface)
  +          (module-define! mod '%module-public-interface iface))))


There also needs to be the C counterpart:

  #define scm_module_index_import_public_interface 9

    SCM_PACK (SCM_STRUCT_DATA (module) [scm_module_index_public_interface])

and change ‘scm_module_public_interface ()’ to use that instead of
‘scm_call_1 (...)’.

Finally there needs to be ‘scm_set_module_public_interface_x ()’ as
discussed at <>.


reply via email to

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