This topic is for discussions related to Plugs and Sockets by Sean Turner
Hi, does anybody Sean Turner? Is he around?
I believe I have found a bug (with a fix).
This example illustrates the problem:
"Charge your laptop"
Include Plugs and Sockets by Sean Turner.
A high power plug is a kind of PS-plug. The PS-type of a high power plug is "high-power".
An high power socket is a kind of PS-socket. The PS-type of a high power socket is "high-power".
A low power plug is a kind of PS-plug. The PS-type of a low power plug is "12 V".
A low power socket is a kind of PS-socket. The PS-type of a low power socket is "12 V".
The lab is a room.
The macbook is a thing in the lab. It incorporates a low power socket.
A charger is a kind of thing.
Incorporated by every charger is one low power plug and one high power plug.
The laptop charger is a charger in the lab.
A wall point is here. It is fixed in place. Incorporated by it is a high power socket.
test me with "plug charger into wall / plug charger into macbook / unplug charger from wall / unplug charger from macbook / plug charger into macbook / plug charger into wall";
The last test command will fail, with the response
The fix or this is to add one line after line 260:
Check an actor plugging something into something (this is the plug-unknown-socket-unknown rule):
if the candidate plug is nothing, and the candidate socket is nothing:
let matching connection type be "";
repeat with test-plug running through the PS-plugs which are part of the candidate inserter:
if the actual plug is not nothing and the actual socket is not nothing, break;
if the attachment of the test-plug is nothing:
The fix is just adding the “if the actual plug is not nothing and the actual socket is not nothing, break;” line.
I added this a pull request at github i7/extensions. I’m not sure what the protocol is, is it considered a friendly thing to do to add extensions made by somebody else to github?