RosettaCodeData/Task/Parametric-polymorphism/Inform-7/parametric-polymorphism-1.inf

14 lines
352 B
INI

Polymorphism is a room.
To find (V - K) in (L - list of values of kind K):
repeat with N running from 1 to the number of entries in L:
if entry N in L is V:
say "Found [V] at entry [N] in [L].";
stop;
say "Did not find [V] in [L]."
When play begins:
find "needle" in {"parrot", "needle", "rutabaga"};
find 6 in {2, 3, 4};
end the story.