lilypond-devel
[Top][All Lists]
Advanced

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

Re: Work on Issue 1320


From: Marc Hohl
Subject: Re: Work on Issue 1320
Date: Sat, 07 Apr 2012 15:54:22 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.28) Gecko/20120313 Thunderbird/3.1.20

Am 06.04.2012 23:04, schrieb Carl Sorensen:
On 4/5/12 12:51 PM, "Marc Hohl"<address@hidden>  wrote:


Does it make sense to replace the definitions in bar-line.cc/span-bar.cc
with the scheme equivalents? If yes, I'd draw a patch and would include
one example for integrating user-defined bar lines with the new approach
as a snippet (once I get the dashed bar line right in place ...)
It seems to me that it makes sense to put the stencil building functions
in Guile instead of in c++.  No sense adding the extra interface layer for
scheme calls from c++.

I would suggest that you make custom-bar-print-alist and
custom-bar-glyph-alist context properties, so they will be documented and
available for modification.

Whenever I see Scheme code that says something like

(do ((
     ...
      (set!  foo bar)))

I cringe a bit. This looks like a direct statement-by-statement
translation from c++, rather than an implementation in native Scheme
idioms.
Well, that's what I did, more or less. I saw a do-loop in Nicolas' code,
and I am pretty sure he knows *a lot more* scheme than I do, and
at least I am glad that the code works (well, most of it). It surely can be
improved ...

   set! creates a side effect for the procedure, and the Scheme
gurus like to avoid side effects as much as possible (at least they did 25
years ago ... am I really that old?).  I haven't looked carefully at your
code to write an alternative, but it's likely that this code can be
rewritten either as a recursive function or as a map, fold, or apply
function, all of which are more native Scheme idioms.

Anyway, overall this looks like great work, and I think we ought to get it
into the code base.

Sounds good - thanks for your kind words!

Regards,

Marc
Thanks,

Carl






reply via email to

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