Re: music-function name shadowing a Scheme keyword
> Subject: Re: music-function name shadowing a Scheme keyword > Am 27.06.2018 um 11:15 schrieb Urs Liska: > > > > > > Am 27.06.2018 um 11:09 schrieb Urs Liska: > >> Hi Jan-Peter, > >> > >> > >> Am 27.06.2018 um 10:48 schrieb Jan-Peter Voigt: > >>> Hi Urs, > >>> > >>> you might import the SRFI-1 span-function and give that a new name. > >>> The counterpart-function to span is break, which "conflicts with the > >>> break binding established by while (see while do). Applications > >>> wanting to use break from within a while loop will need to make a new > >>> define under a different name." > >>> You might provide such an alternative name for "span". > >>> > >>> Personally I'd prefer another name for your function, because > >>> srfi-1-span is "prior art" ;-) > >>> and *now* you can give it a name that does not conflict. > >>> > >> > >> Hm, I was afraid of that comment. I agree that asking users using my > >> module to change any occurence of "span" to > >> "span-saved-from-openlilylib" is no viable option ... > >> > >> However, what *would* be a suitable name, then? \span is just perfect. > >> \markup would be good, or \tag, but of course ... > > > > * \class ("\class new" as shorthand for ) (maybe > > also too generic?) > > * \tagSpan > > * \markupSpan > > > > ? > Yes, class is quite generic. I don't know, if it conflicts. > IMO \tagSpan is a viable name. > +1 Or, along the same lines, since it creates a element in the DOM (Document Object Model), and since "tag" already has an LP-specific meaning, \domSpan Elaine Alt 415 . 341 .4954 "*Confusion is highly underrated*" ela...@flaminghakama.com Producer ~ Composer ~ Instrumentalist -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: music-function name shadowing a Scheme keyword
Am 27.06.2018 um 14:51 schrieb David Kastrup: Andrew Bernard writes: Hi Urs, It's not a Scheme language keyword, but a procedure name from SRFI-1. (srfi srfi-1) is loaded and imported into the parser by default. which makes it not a real Scheme keyword but from the perspective of my question I should treat it like one ... ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: music-function name shadowing a Scheme keyword
Andrew Bernard writes: > Hi Urs, > > It's not a Scheme language keyword, but a procedure name from SRFI-1. (srfi srfi-1) is loaded and imported into the parser by default. -- David Kastrup ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: music-function name shadowing a Scheme keyword
Hi Urs, It's not a Scheme language keyword, but a procedure name from SRFI-1. I concur with the others that it is not really good practice to override this, even though Scheme allows you to do many wonderful things. That's bound to lead to hard to diagnose unpredictable behaviour for users at some point. Andrew ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: music-function name shadowing a Scheme keyword
Am 27.06.2018 um 11:15 schrieb Urs Liska: Am 27.06.2018 um 11:09 schrieb Urs Liska: Hi Jan-Peter, Am 27.06.2018 um 10:48 schrieb Jan-Peter Voigt: Hi Urs, you might import the SRFI-1 span-function and give that a new name. The counterpart-function to span is break, which "conflicts with the break binding established by while (see while do). Applications wanting to use break from within a while loop will need to make a new define under a different name." You might provide such an alternative name for "span". Personally I'd prefer another name for your function, because srfi-1-span is "prior art" ;-) and *now* you can give it a name that does not conflict. Hm, I was afraid of that comment. I agree that asking users using my module to change any occurence of "span" to "span-saved-from-openlilylib" is no viable option ... However, what *would* be a suitable name, then? \span is just perfect. \markup would be good, or \tag, but of course ... * \class ("\class new" as shorthand for ) (maybe also too generic?) * \tagSpan * \markupSpan ? Yes, class is quite generic. I don't know, if it conflicts. IMO \tagSpan is a viable name. ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: music-function name shadowing a Scheme keyword
Am 27.06.2018 um 11:09 schrieb Urs Liska: Hi Jan-Peter, Am 27.06.2018 um 10:48 schrieb Jan-Peter Voigt: Hi Urs, you might import the SRFI-1 span-function and give that a new name. The counterpart-function to span is break, which "conflicts with the break binding established by while (see while do). Applications wanting to use break from within a while loop will need to make a new define under a different name." You might provide such an alternative name for "span". Personally I'd prefer another name for your function, because srfi-1-span is "prior art" ;-) and *now* you can give it a name that does not conflict. Hm, I was afraid of that comment. I agree that asking users using my module to change any occurence of "span" to "span-saved-from-openlilylib" is no viable option ... However, what *would* be a suitable name, then? \span is just perfect. Hm, I doubt that. Not all Lilyponders are HTML-natives. So to me it seems like a function that adds style-attributes to music elements. Am I right? Then you might give it a name like applyStyleAttributes ... OK, that is of course way too long, but ... I just received your proposals and I will answer that ;-) \markup would be good, or \tag, but of course ... Urs ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: music-function name shadowing a Scheme keyword
Am 27.06.2018 um 11:09 schrieb Urs Liska: Hi Jan-Peter, Am 27.06.2018 um 10:48 schrieb Jan-Peter Voigt: Hi Urs, you might import the SRFI-1 span-function and give that a new name. The counterpart-function to span is break, which "conflicts with the break binding established by while (see while do). Applications wanting to use break from within a while loop will need to make a new define under a different name." You might provide such an alternative name for "span". Personally I'd prefer another name for your function, because srfi-1-span is "prior art" ;-) and *now* you can give it a name that does not conflict. Hm, I was afraid of that comment. I agree that asking users using my module to change any occurence of "span" to "span-saved-from-openlilylib" is no viable option ... However, what *would* be a suitable name, then? \span is just perfect. \markup would be good, or \tag, but of course ... * \class ("\class new" as shorthand for ) (maybe also too generic?) * \tagSpan * \markupSpan ? Urs Jan-Peter Am 26.06.2018 um 22:43 schrieb Urs Liska: Hi all, I've mostly completed the implementation of a "span" module that provides the \span music-function, which is roughly the same as the HTML element. Nearly everything works fine by now, and I've been very happy with the name - until I realized that a music-function \span can be invoked from Scheme with (span), and that this shadows the Scheme procedure span from SRFI-1. Am I right to assume that this *can* work - as long as no user of my package will think of using the original Scheme function? Is there any way to get around this without renaming my music function? Urs ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: music-function name shadowing a Scheme keyword
Hi Jan-Peter, Am 27.06.2018 um 10:48 schrieb Jan-Peter Voigt: Hi Urs, you might import the SRFI-1 span-function and give that a new name. The counterpart-function to span is break, which "conflicts with the break binding established by while (see while do). Applications wanting to use break from within a while loop will need to make a new define under a different name." You might provide such an alternative name for "span". Personally I'd prefer another name for your function, because srfi-1-span is "prior art" ;-) and *now* you can give it a name that does not conflict. Hm, I was afraid of that comment. I agree that asking users using my module to change any occurence of "span" to "span-saved-from-openlilylib" is no viable option ... However, what *would* be a suitable name, then? \span is just perfect. \markup would be good, or \tag, but of course ... Urs Jan-Peter Am 26.06.2018 um 22:43 schrieb Urs Liska: Hi all, I've mostly completed the implementation of a "span" module that provides the \span music-function, which is roughly the same as the HTML element. Nearly everything works fine by now, and I've been very happy with the name - until I realized that a music-function \span can be invoked from Scheme with (span), and that this shadows the Scheme procedure span from SRFI-1. Am I right to assume that this *can* work - as long as no user of my package will think of using the original Scheme function? Is there any way to get around this without renaming my music function? Urs ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: music-function name shadowing a Scheme keyword
Hi Urs, you might import the SRFI-1 span-function and give that a new name. The counterpart-function to span is break, which "conflicts with the break binding established by while (see while do). Applications wanting to use break from within a while loop will need to make a new define under a different name." You might provide such an alternative name for "span". Personally I'd prefer another name for your function, because srfi-1-span is "prior art" ;-) and *now* you can give it a name that does not conflict. Jan-Peter Am 26.06.2018 um 22:43 schrieb Urs Liska: Hi all, I've mostly completed the implementation of a "span" module that provides the \span music-function, which is roughly the same as the HTML element. Nearly everything works fine by now, and I've been very happy with the name - until I realized that a music-function \span can be invoked from Scheme with (span), and that this shadows the Scheme procedure span from SRFI-1. Am I right to assume that this *can* work - as long as no user of my package will think of using the original Scheme function? Is there any way to get around this without renaming my music function? Urs ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
music-function name shadowing a Scheme keyword
Hi all, I've mostly completed the implementation of a "span" module that provides the \span music-function, which is roughly the same as the HTML element. Nearly everything works fine by now, and I've been very happy with the name - until I realized that a music-function \span can be invoked from Scheme with (span), and that this shadows the Scheme procedure span from SRFI-1. Am I right to assume that this *can* work - as long as no user of my package will think of using the original Scheme function? Is there any way to get around this without renaming my music function? Urs ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user