[Top][All Lists]

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

Re: T1055: Avoid using deprecated %module-public-interface in guile init

From: n . puttock
Subject: Re: T1055: Avoid using deprecated %module-public-interface in guile initialisation. (issue1160044)
Date: Mon, 09 Aug 2010 21:34:56 +0000

On 2010/08/09 20:01:10, Ian Hulin wrote:

Presumably this means make a parallel change to
Documentation/snippets/ OK.


then run to update snippets/


Valid point, but I'd rather do the work for clip-region as a separate
item. Raise the tracker and I'll start work on it as soon as this

Why would you want to add something to a file, only to remove it soon

If we agree it's better from the user's perspective not to require

(use-modules (scm clip-region))

in a .ly file, then it doesn't make sense to defer the change.

It was an answer from Han-Wen about how we'd got into using
%module-public-interface in the first place:

"I think %public-interface hack is to force all of the definitions
future ones to be public;  the code that executes the assignments just

       scm_module_define (mod, sym, val);  --

without doing anything to export sym."

Sure, but `mod' here is created by ly_make_module, which now uses
module-export-all!, so all defines will automatically be public.

Because it doesn't work.

I meant: leave it in lily.scm, even if you still want to use
(use-modules (scm clip-region)) in

Yes,  If we don't have this handler, scm/define-grob-properties barfs
initialization.  Procedure simple-format only handles a subset of
directives, and throws 'format if it sees one it can't handle.  It
kills the
build and the regtests if we don't handle it here. The other option is
to change
define-grob-properties to use fancy-format (a.k.a the definition from
(ice-9 format)).

I don't get any regtest failure without this code.  There's no format
call inside define-grob-properties.scm, and as I said earlier, the
handler doesn't work since there's no exception thrown specifically for
`format' (+ Patrick's comments and the incorrect args to the handler).

Try adding this to

#(define format ergonomic-simple-format)

You'll see the exception handler doesn't catch this.  If you change the
code, it gets caught:

(define (simple-format-handler dest . rest)
  (if (string? dest)
      (apply fancy-format (cons #f (cons dest rest)))
      (apply fancy-format (cons dest rest))))

(define-public (ergonomic-simple-format dest . rest)
  "Like ice-9 format, but without the memory consumption."
  (catch #t
         (lambda () (if (string? dest)
                        (apply simple-format (cons #f (cons dest rest)))
                        (apply simple-format (cons dest rest))))
         (lambda (key . args) (apply simple-format-handler (cons dest rest)))))

reply via email to

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