lilypond-devel
[Top][All Lists]
Advanced

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

Re: scheme night-mare...


From: Neil Puttock
Subject: Re: scheme night-mare...
Date: Sun, 11 Jul 2010 19:08:10 +0100

On 11 July 2010 15:52, Arno Waschk <address@hidden> wrote:

> How do i use this in a c line?

Look up the procedure:

SCM proc = ly_lily_module_constant ("map-alist-keys");

Call the procedure, using scm_call_2:

SCM result = scm_call_2 (proc, arg1, arg2);

>> Your question isn't really about converting from scheme to c++, it's
>> really
>> about getting all of the keys and/or properties from an alist.  That's not
>> built into scheme.
>
> No, it is about easily accessing information buried into some scheme
> structures by some little c code.
> As long this is not possible, this information is next to encrypted for me.

Why do you need to do this in C/C++ though?

If you're running a .ly file, this information's easily available via
ly:grob-alist-chain:

\relative c' {
  \override Staff.KeySignature #'after-line-breaking =
  #(lambda (grob)
     (for-each (lambda (lst title)
                 (display (format #f "~a:\n" title))
                 (for-each (lambda (entry)
                             (display (format #f " ~a\n" (car entry))))
                           lst)
                  (newline))
      (ly:grob-alist-chain grob '()) '("mutable" "immutable")))
  \key a \major
  a1
}

Cheers,
Neil



reply via email to

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