[Top][All Lists]

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

Re: Creates pure closures (issue 4894052)

From: n . puttock
Subject: Re: Creates pure closures (issue 4894052)
Date: Thu, 18 Aug 2011 12:31:29 +0000

Hi Mike,

I have reservations about the naming, since you're basically creating a
smob which acts as a container for a pair of callbacks; it doesn't work
like a simple-closure in that you can evaluate the closure and get
something useful back.

File lily/ (right):
lily/ 2, 0, 0, (SCM pc),
1, 0, 0,

(there's only one arg; looks like you've been cut'n'pasting from :)
lily/ 2, 0, 0, (SCM pc),
1, 0, 0,
lily/ scm_display (scm_cdr (s), port);
this only displays the unpure part, and if you change it to show both,
there seems to be a garbage collection problem (probably to do with
using scm_markcdr in init_pure_closure ()); the pure part has been swept

\relative c' {
  \override Stem #'Y-extent =
    #(ly:make-pure-closure ly:stem::height '(-3 . 10))

\layout {
  \context {
    \override Stem #'after-line-breaking =
    #(lambda (grob)
       (let ((data (ly:grob-property-data grob 'Y-extent)))
         (and (ly:pure-closure? data)
              (display data))))

-> #<pure-closure #<primitive-procedure ly:stem::height> #<freed cell
0x7f4148a3f960; GC missed a reference> >

(the wrapper you posted fails even for a \once \override, and would be
bad for documentation purposes since the pure part would show as an
anonymous lambda)

reply via email to

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