[SOLVED] decide on a list of text produced by rulebook?

Is is possible “to decide” on a value produced by a rulebook?

And is it possible to have a rulebook producing a list of text?

I’m doing something a lot like example 423, Oyster Wide Shut. In that, we have

The property-aggregation rules are an object-based rulebook. 
The property-aggregation rulebook has a list of text called the tagline.

and then rules like

A property-aggregation rule for a lit thing (this is the mention lit objects rule): 
    add "providing light" to the tagline.

My first naive approach was to do this:

to decide what list of text is the aggregated properties of (item - a thing):
    follow the property-aggregation rules for the item;
    decide on the tagline of the property-aggregation rulebook. 

But that won’t work, because rulebook variables - if I am getting this right - are only shared between rules in the rulebook and scoped to live and die over a single traversal of the rulebook.

I’m guessing my best bet is to have a “last” rule which takes the tagline and copies it to another list of texts somewhere. Or is there a better way to do this?

Can you do this?

[code]The property-aggregation rules are an object-based rulebook producing a list of text.

The property-aggregation rulebook has a list of text called the tagline.

Last property-aggregation rule: rule succeeds with result the tagline.

To decide what list of text is the aggregated properties of (item - a thing): decide on the list of text produced by the property-aggregation rules for the item.[/code]

See §19.13 of Writing with Inform. I think rulebook outcomes are the way for the rulebook to pass results to the rest of the code, whereas rulebook variables are ways for the rulebook to talk to itself.

This may be unnecessarily circuitous; I’m not sure.

Oh, “the X produced by the Y rules for the Z”, is that how you do it? That makes sense.

I did manage to do it by copying it to a global list, but that’s even more circuitous, and you need to clear that list first.

Thanks, I’ll try this!

…except that rulebooks can not produce lists, apparently, and saying “The property-aggregation rules are an object-based rulebook producing a list of text” is like saying Clark Kent is Lex Luthor, or that chalk is cheese. (Ha - I never realized you get different error messages all the time - that’s weird but brilliant!)

So… hm. I guess I’m stuck using a global text list object for this. Or I could wrap the list of text in an Object and produce that same object (or one from a pool of objects) from the rulebook… not sure whether that helps.

It works when you make the name of the kind plural:

The property-aggregation rules are an object-based rulebook producing lists of texts. I think this could be considered a bug, since for other kinds singular works fine (e.g. “producing an object”). If you’d like to report this on the bug tracker go ahead; otherwise I can.

Aha! Ok. Nice, that works. Thank you, both of you. Now I’m happy.

I have reported it.