[Top][All Lists]

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

Re: How to create a restricted symbols context property

From: David Kastrup
Subject: Re: How to create a restricted symbols context property
Date: Mon, 18 Jan 2016 18:47:58 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Urs Liska <address@hidden> writes:

> Am 18.01.2016 um 11:31 schrieb Urs Liska:
>> I have created a new boolean context property by
>> - adding an entry in define-context-properties.scm
>> - setting the default in
>> - retrieving it in a class's (Beaming_option) from_context method
>> However, I would like to add another context property (and modify the
>> added one) from boolean to accepting one out of a list of symbols.
>> Skimming the source code I couldn't really find how I achieve that.
>> I assume that I have to define a custom predicate for my property that
>> throws an (which?) error the argument is not in the list of accepted
>> symbols.
>> Is that right? And if so, where should I define that?
> I have now managed to handle what I need by adding a Scheme predicate
> and a C++ enum.
> However, I am quite sure that they are not implemented at appropriate
> locations:
> The Scheme predicate at the top of define-context-properties.scm
> The C++ enum directly in the .hh file where it is used.
> Where should I put them?

Where the rest are.  I think generally they are to be found in c++.scm
and described in lily.scm.

One note: #f is always allowed as a value for properties.  It's just #t
that would require special permission from the predicate.

David Kastrup

reply via email to

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