Fungibility

I don’t know if I am right, but it seems like the fungibility mechanics are broken. I tried to compile a simple example (in english) copied from the chapter 11 in the manual

(current player #player)
(#player is #in #room)
(room #room)
(fungibility enabled)

#bowl
(name *) bowl
(item *)
(container *)
(* is #in #room)
(* is handled)

(generate 5 (marble $))
(name (marble $))
    marble
(plural name (marble $))
    marbles
((marble $) is #in #bowl)
((marble $) is handled)
(item (marble $))
(fungible (marble $) (marble $))

but all I get is “You see a marble in the bowl.”
Has anybody some guessing what is wrong?

Well, in the example you posted, you forgot the asterisks in the bowl definition, but I’m guessing that was just a typo since you wouldn’t have gotten that response. When I compile this code:

Oops, my code only works for version 0h (sorry about that)
(current player #player)
(#player is #in #room)
(room #room) 
(fungibility enabled)

#bowl
(name *) bowl
(item *)
(container *)
(* is #in #room)
(* is handled)

(generate 5 (marble $))
(name (marble $))	marble
(plural name (marble $))	marbles
((marble $) is #in #bowl)
((marble $) is handled)
(item (marble $))
(fungible (marble $) (marble $))

I get this output:

Location
You are here.

You see a bowl here.

> look in bowl
In the bowl you see five marbles.

> get marble
You take the marble out of the bowl.

> look in bowl
In the bowl you see four marbles.

See the real answer from Linus below.

Should be:

(*(marble $) is #in #bowl)
(*(marble $) is handled)
(item *(marble $))

In particular, the first line, (*(marble $) is #in #bowl) needs the asterisk starting with language version 0i. The example in the manual needs to be updated. Thanks for reporting!

2 Likes

It’s my logic fault. Without the asterisk the predicate succeeds only for the first “found” item which is exactly one marble. Thanks for the clarification.