lilypond-devel
[Top][All Lists]
Advanced

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

Re: GOP2-4 - C++ and scheme indentation


From: Graham Percival
Subject: Re: GOP2-4 - C++ and scheme indentation
Date: Thu, 9 Aug 2012 12:23:34 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Thu, Aug 09, 2012 at 01:08:42PM +0200, David Kastrup wrote:
> Graham Percival <address@hidden> writes:
> 
> > Do you want to tell me (and them) that we shouldn't be editing
> > .scm files in lilypond?
> 
> This is not satisfactorily solved by first writing everything and
> running an indenter afterwards.  You'll mess up the nesting levels and
> your program will not work.

Yeah, but I find it way easier to write scheme code with matching
parentheses.  I wrote ly/event-listener.ly like this:

#(define (format-note engraver event)
   (let* ((origin (ly:input-file-line-char-column
                   (ly:event-property event 'origin)
                  )
         ))
     (print-line engraver
                 "note"
                 ;; get a MIDI pitch value.
                 (+ 60 (ly:pitch-semitones
                        (ly:event-property event 'pitch)
                       )
                 )
                 (ly:duration->string
                  (ly:event-property event 'duration))
                 (format-moment (ly:duration-length
                                 (ly:event-property event
'duration)
                                )
                 )
                 ;; point and click info
                 (ly:format "point-and-click ~a ~a"
                            (caddr origin)
                            (cadr origin)
                 )
      )
   )
 )


and then installed emacs just to format it before submitting the
patch.  It was solved pretty satisfactorily as far as I could
tell.  (although there was at least one bracket that was wrong:
http://codereview.appspot.com/4373046/#msg3
)

> It does not matter whether your Scheme-aware editor is called Emacs.
> Emacs has the advantage of also being LilyPond-aware, and being
> Texinfo-aware, and C++-aware and navigating LilyPond documentation
> including graphics about 10 times faster than any HTML browser.

And yet it's still about 10 times slower than vi.

> Finding a good replacement for all those tasks is a challenge.

I'm not trying to find a replacement for all those tasks.  I
already have replacements.  I have vi for texinfo, vi for C++, and
firefox for HTML.

Don't try to change my life.  Maybe my reasons for not using emacs
are stupid.  I don't care; they're *my* reasons.


> > I really don't see the objection.  Scheme is pretty easy to
> > indent.  We almost have a working scheme file which indents
> > scheme.  This will completely elminate one of the known stumbling
> > blocks facing new contributors.  What's not to love?
> 
> The stumbling block is _writing_ the Scheme code, not submitting it.
> When is the last time a code review complained about Scheme code
> formatting?

I gave URLs in the proposal, but here you go:
http://codereview.appspot.com/5343050/#msg1
http://codereview.appspot.com/5343050/#msg5
(note that there were 3 or 4 different rietveld issues discussing
that particular patchset, so previous discussion is not on that
page)

That's not necessarily the last time, but it was within the past
year, and it royally screwed over a new contributor.

- Graham



reply via email to

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