PunyInform: What prevents the Insert hook from firing here?

I want to check objects as they are inserted in a Cage:

Class Cage
  with
    before [;
        Insert:
            "******HELLO!********";
    ]
  has container openable open static;

However, the hook is not firing. I have changed Insert to Examine and it runs as expected. However, Insert does nothing. For example put book into blue cage does not result in the code firing. Why is that?

use RECEIVE.

see DM4 ch. 12

3 Likes

This code will in fact work—if you try to insert the cage into something. In order to distinguish between code for “put this in something” and “put something in this”, the former uses the real action Insert, and the latter uses the fake action Receive.

It’s unintuitive at first, but it’s a lot easier overall than the ZIL equivalent (where the same routines are run for both, and those routines have to check whether the object in question is noun or second).

3 Likes