lilypond-devel
[Top][All Lists]
Advanced

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

Re: Context.Grob considered as symbol list


From: David Kastrup
Subject: Re: Context.Grob considered as symbol list
Date: Thu, 11 Oct 2012 16:31:23 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux)

James <address@hidden> writes:

> On 10 Oct 2012, at 21:02, Werner LEMBERG <address@hidden> wrote:
>
>>>>> X-offset anyone?
>>>> 
>>>> ... should be renamed IMHO.  Regardless of our discussion, it
>>>> doesn't fit into the current naming scheme.
>>> 
>>> The corresponding axis is called X, and using x for a constant in
>>> the expectation that the user would not attempt naming a variable
>>> after it would seem rather optimistic.
>> 
>> I think a big fat bold sentence which says
>> 
>>  Variables *must* start with a lowercase letter, contexts with an
>>  uppercase letter.
>> 
>> should make everything clear.
>> 
>> What do others think?
>
> Well taking Werner's last reply at face value, I'd say 'big fat bold
> sentences' (in amongst oh so many other big fat bold sentences) is not
> helpful at all and makes nothing clear if in the end things are not
> consistent for the user. I already struggle with orders of things,
> dots or hashes or brackets and things like when I use staff vs Staff.
>
> What I think about 'x-offset' is that would using 'Left' and 'Right'
> be more in keeping with things like UP and DOWN that we use already
> for DIRECTION (slurs, cues etc.)?
>
> I don't really follow technically the conversation that lead to
> David's comment of 'X-offset anyone?' but would this be an
> alternative?

X-offset was an example for a grob property that starts with an
uppercase letter, to put a damper on the suggestion to disambiguate grob
names from grob property names in function calls by looking at
lettercase.

Now of course there is something to be said for naming consistency, but
I still don't want to make the interpretation of identifiers depend on
case other than, of course, that you need to stick with the exact
spelling of an identifier once you picked its name.

X-offset could likely be renamed into right-shift or shift-right,
accompanied by shift-up or so.  However, it would then seem "unnatural"
that there is no accompanying shift-left or shift-down.

The obvious solution of adding shift-left and shift-down as well and
calculating the offset as (shift-right - shift-left) has the
disadvantage that you'll always need to override _both_ in order to
change the offset predictably.

Werner picked up on something I mentioned as a dissatisfactory
workaround idea, so there is little surprise that I am not in favor.  I
found a quite more satisfactory solution by, uh, changing the footnote
user interface _again_, something which you likely are not all that fond
of hearing.  It turns out that independently from the _big_ consequences
of this change this would bring the footnote interface better in line
with other functions without losing functionality (thanks to \single now
being available).

So the X-offset naming question really belongs in a separate discussion.
If one wanted to bring it in line with the "properties should be lower
case" mantra, the cheapest solution would probably be renaming it to
offset-X instead.

While I am not particularly enthralled with the original naming choice,
I have my doubts that such a step would be worth the hassle.

-- 
David Kastrup



reply via email to

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