[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Scheme code for extracting LilyPond header properties?
From: |
Erik Sandberg |
Subject: |
Re: Scheme code for extracting LilyPond header properties? |
Date: |
Sun, 4 Nov 2007 17:50:44 +0100 |
User-agent: |
KMail/1.9.6 (enterprise 0.20070907.709405) |
On Tuesday 09 October 2007, John Zaitseff wrote:
> Dear Nicolas / LilyPonders,
>
> I store a field in the header, lastupdated, in the form "09-Oct-2007";
> the \parsed-date function converts that to something like "9 October,
> 2007":
>
> % \parsed-date DATE - convert a DD-MMM-YYYY property to a fully printed
> date #(define-markup-command (parsed-date layout props date) (symbol?)
> "Convert the property @var{date} containing a date in the
> form DD-MMM-YYYY into a nicely formatted stencil output D MMMM,
> YYYY."
> (let* ((datestr (chain-assoc-get date props)))
> (interpret-markup layout props
> (if (string? datestr)
> (markup #:simple
> (strftime "%e %B, %Y" (car (strptime "%d-%b-%Y"
> datestr)))) datestr))))
>
> (Of course, I should rewrite that to make it somewhat more robust.
> It works for me, however).
You may want to use SRFI-19 for this,
http://www.gnu.org/software/guile/manual/html_node/SRFI_002d19.html#SRFI_002d19
Erik
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: Scheme code for extracting LilyPond header properties?,
Erik Sandberg <=