AnssiR66 / AlanStdLib

The Standard Library for ALAN Interactive Fiction Language
Other
5 stars 2 forks source link

Artificial Light Sources: Missing CHECKs for EXTINGUISH #123

Closed tajmone closed 3 years ago

tajmone commented 3 years ago

Fix the current lack of CHECKs for which verbs can be used with natural and artificial light source:


@AnssiR66, while working on lib_classes.i I realized that there might be some CHECKs missing for NOT natural and natural light sources.

Currently, only the verbs turn_on, turn_off and switch carry out CHECKs to ensure that they can be used only with NOT natural light sources.

I'm going ahead and applying the fixes mentioned above, because I'm convinced that this is how it should be; but I'd like to have your confirmation that this is OK.

The current documentation (§12.5. LIGHTSOURCE), is a bit obscure on the topic:

LIGHTSOURCE is natural or NOT natural (a natural LIGHTSOURCE is for example a match or a torch). It can be turned on and off, lighted and extinguished (= put out) if it is not broken. A natural LIGHTSOURCE cannot be turned on or off, it can only be lighted and extinguished (= put out). When examined, a LIGHTSOURCE is by default supplied with a description of whether it is providing light or not.

It doesn't mention explicitly which verbs are allowed on artificial light sources (only for natural ones).

I believe that this how they should work (the * indicates current lacks of CHECKs):

type turn ON/OFF light extinguish
natural NO YES YES
artificial YES YES NO *

Some practical examples:

Natural light sources: a candle, a campfire. They can be lighted and extinguished/put out, but not switched/turned on/off.

Artificial light sources: a flashlight, a table lamp, a light bulb. They can be switched/turned on/off, and even lighted, but not extinguished/put out.

Right now, you can 'extinguish' and 'put off' a flashlight, or other artificial (electrical) light sources, which doesn't seem linguistically correct.

AnssiR66 commented 3 years ago

Yes, it is ok to make this change, it makes sense the way you suggested.

tajmone commented 3 years ago

New Test Available

Now the status of these verbs on light sources can be see in the transcript from the new dedicated integrity test: