workaround for "references to temporary values"...

I’m playing around with the extension Computers by Emily Short. It’s really beside the point, my question has to do with the “descriptions used as values are not allowed to contain references to temporary variables defined by ‘let’ or by loops”… problem. I’m using the Computers Extension to illustrate the issue because that’s what I was doing.

OK, I try to do something like this:

definition: a computer is idle if the list of software run by it is empty.

But I can’t, because:

Also

to decide whether (deck - a computer) is processing:
	if the list of software run by the deck is empty, no;
	yes;

Same thing:

The only way around this that I’ve figured out feels like a shady workaround. This works:

Include Computers by Emily Short.

the_deck is a computer that varies;

To decide whether (deck - a computer) is currently_processing:
	now the_deck is the deck;
	if the list of software run by the_deck is empty, no;
	yes;

Definition: a computer is processing if it is currently_processing.

After examining a switched on computer which is not processing:
	say "It is sad because it has no software installed.";
	
The office is a room. 
The mac is a laptop in the office.
Test me with "examine mac / boot mac / examine mac".

See what I’m doing there with “the_deck is a computer that varies” and “now the_deck is the deck”.
Is this… um… pretty code? Is it likely to break? Is there a better way to do this?

This seems like a more concise way of doing what you want. It compiles, but I haven’t tested it beyond that, as I’m at work.

[code]Include Computers by Emily Short.

Definition: a computer is idle unless it is running software.

The office is a room.
The mac is a laptop in the office.
Test me with “examine mac / boot mac / examine mac”.[/code]

Yes, that does work.

Silly me, I keep forgetting how these things work.

I think I was maybe making some typo at some point and then tried to use “which is not running any software”, which does not compile. I don’t need that definition at all then, it’s just “is running software” or “is running some software”.

After examining a switched on computer which is not running some software:
   say "It is sad because it has no software installed.";

Thanks.

Happy to help. :slight_smile: My first impulse was to simply do a

Definition: a computer is idle: if it is running software, no; yes.

but it wasn’t quite as descriptive, which is (thinks I) something that should matter when writing Inform 7.

To be honest I’d probably want to make a tiny addition since the current definition means a switched-off computer is considered to be idle. At the moment I can’t find a way to write that as a simple phrase though. :confused: