Thanks for all your replies RonBee.
I normally use the sentences without commas, but I wanted to see if they could work with commas. The bit after the comma is supposed to give extra information, more or less added as an after-thought. it is supposed to work like a non-restrictive relative clause, a bit like: "the basket, which was for ...) [In contrast to: the basket which was for...]
Do you think that my original sentences are wrong without the commas?
The fourth one seems wrong to me.
It makes a difference whether you use a basket or the basket.
[list]1-A basket, for carrying bricks, was beside the door.
2-The basket, for carrying bricks, was beside the door. (For: The basket, which was for carrying bricks ...)
3-A basket, to carry bricks in, was beside the door.
4-The basket, to carry bricks in, was beside the door.[list]
If you use a basket for carrying bricks or a basket to carry bricks in there is no suggestion that other baskets are involved. If you say the basket for carrying bricks or the basket to carry bricks in there is the suggestion that there are other baskets nearby or other baskets involved in the discussion. In sentences two and four, if you use the commas, the appositional phrase ("for carrying bricks" or "to carry bricks in") modifies basket, explaining what it is for. In that case, there is no suggestion that there are or might be other baskets involved.