lilypond-devel
[Top][All Lists]
Advanced

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

Re: Use define-syntax for define-session[-public] (issue 553480044 by ad


From: hanwenn
Subject: Re: Use define-syntax for define-session[-public] (issue 553480044 by address@hidden)
Date: Mon, 03 Feb 2020 01:49:31 -0800

On 2020/02/02 15:28:44, dak wrote:
> On 2020/02/02 14:01:33, hanwenn wrote:
> > https://codereview.appspot.com/553480044/diff/557280043/scm/lily.scm
> > File scm/lily.scm (right):
> > 
> >
>
https://codereview.appspot.com/553480044/diff/557280043/scm/lily.scm#newcode111
> > scm/lily.scm:111: "This defines a variable @var{name} with the
starting value
> > On 2020/02/01 21:37:50, dak wrote:
> > > An interesting DOC string method...  define-syntax doesn't have
anything
> like
> > > that?
> > 
> > 
> > no, doesn't look like it.
> > 
> > I added all the GUILE repos I could find to cs.bazel.build, none of
the
> > define-syntax uses seem to have doc strings. See
> > 
> > https://cs.bazel.build/search?q=define-syntax%20f%3ascm%20&num=450
> > 
> >
>
https://codereview.appspot.com/553480044/diff/557280043/scm/lily.scm#newcode123
> > scm/lily.scm:123: (define-syntax define-session
> > On 2020/02/01 21:37:50, dak wrote:
> > > The problem with define-syntax is that in Guile-1.8, it doesn't
work
> properly
> > > because of some symbol changing behavior when defined, a bug that
will not
> get
> > > fixed any more.  I wish I'd remember what it was.  It was
something short
> like
> > > \once or \temporary or so.  One could use it in the LilyPond core,
but it
> > failed
> > > in user documents.  Ah right: pretty sure it was \void (namely the
symbol
> > 'void
> > > being bound to something).
> > > 
> > > That makes it hard for people to get acquainted with it and
maintain it in
> > > consequence.  So let's see whether we manage to muddle through in
a
> different
> > > manner.  Do you have a useful test case?  Should I just draw out
the
> > > define-session thing and try to convince Guile-2.0 with the right
> incantations
> > > to byte compile it?  I assume this is the same in Guile-2.2 (for
which I
> have
> > an
> > > Ubuntu package I don't need to compile)?
> > > 
> > > Would this give us a chance to get somewhere?
> > 
> > Please see Taylan's reply to the guile-devel list, which gives a
succinct
> > explanation of why inner functions in macros can never work in the
Guile 2.x
> > compiler. So we either forego compilation (at a 1.5 sec startup
cost) or we
> > rewrite the macros to stop using inner functions.
> 
> That's what I am trying right now, but you cannot quote outer
functions as a
> value either (the problem is the value, not the innerness) so you need
to do it
> by name and I would like not to have to export it, so I try with (@@
guile-user
> define-session-internal) but haven't found the right incantation yet. 
Still
> fiddling.  If it cannot be avoided, it will end up as an exported
> define-session-internal .

I don't get it. define-session is not a public macro either. 
What is wrong with the code I propose in this change?

> > What is the problem precisely with void ? I assume that is not about
> > define-session but for define-music-function, which looks like it
has a very
> > complex macro expansion.
> > 
> > Can you provide a repro scenario?

> But basically the symptom was just that using define-syntax in a
typical manner
> from inside of a LilyPond document crashed with some error completely
unrelated
> to the actual input.

would be good to have an actual patch along with the failing .ly to
examine more closely.


https://codereview.appspot.com/553480044/



reply via email to

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