[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: Ian Hulin
Subject: Re: T1055: Avoid using deprecated %module-public-interface in guile initialisation. (issue1160044)
Date: Tue, 10 Aug 2010 19:59:58 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20100802 Thunderbird/3.1.2

Hi Neil,

On 09/08/10 22:34, address@hidden wrote:
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/


OK, you've convinced me. Changing the reg test is just nasty.

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.

Well, it seemed like a distinct and separate task and like it was
getting this patch 'off-topic'.

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.

That's because I was talking rubbish and trying to answer your review in
a hurry.  I was confusing the crash with
which I'd compiled separately as a test
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:

Errm, unless you're using an unpatched, vanilla lily.scm from git you
won't see it because the handler will already be defined in
ergonomic-simple-format.  Using the code as in the my patch certainly
stopped from barfing here. I'll poke around
further with this.

(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)))))

See above.


reply via email to

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