I know that with shared source code, you can instantiate an instance of another contract and call it's functions as documented in the solidity tutorial 
However, there are situations where a contract may not have access to the source code of the contract it needs to interact with. Consider the situation of a primary contract A that represents an organization, and a secondary contract B that handles the membership of the organization. Contract A stores an update-able reference to the current address of the membership contract. As the organization evolves, the membership contract (B) may change through various iterations while the primary contract A could remain static, only having it's reference to the membership contract updated.
One useful function would be for the primary contract A to be able to query the membership status of the sender of incoming transactions in order to handle permissions. In this case, the ideal situation is for contract A to be able to instantiate contract B and just call the `checkMembership(msg.sender)` function. However this approach is not possible without access to the source code of contract B.
So what's a developer to do.
I've thought up the following scheme to enable calling another contract via the `address.call` api.https://gist.github.com/pipermerriam/3bc8c8fc9e443fccd909
In the linked gist, there is a `Master` contract and a `Sub` contract. The function `Master.delegate` offloads the function call to a known API on the `Sub` contract. The `Sub` contract knows that it should report the answer back to the calling contract using the provided `key`, and the `Master` contract knows to then look for the answer using the provided `key`.
Problem is that it doesn't work, and I'm unsure why. I've deployed these contracts and as far as I can tell, my calls to the `delegate` method on the `Master` contract don't successfully pass the call along to the `Sub` contract. Can anyone see what is wrong with this? It seems like it should work.
1 - https://github.com/ethereum/wiki/wiki/Solidity-Tutorial#interfacing-with-other-contracts