On holidays one is forbidden to do work, as one is forbidden to do work on the Sabbath. But on holidays (Rosh Hashanah, Sukkot, Passover, and Shavuot) one is permitted to do work which is needed for the holiday itself, like cooking and baking for consumption on the holiday. One who bakes on the holiday for consumption during the week does prohibited labor. The sages were divided on the case of one who bakes on the holiday for use during the week. According to the sage Rabah he is not liable to the punishment of lashes (39 lashes with a leather strap made from the hide of a donkey, with the sinner bound by his wrists around a pole). This sage explained his opinion and said that though one is forbidden to bake on the holiday in preparation for the week, theoretically visitors many suddenly appear on the holiday and the baker would need the baked goods, so the baked goods were actually for use on the holiday. According to another sage the baker is punished with lashes, for to his mind one does not use theoretical excuses; he baked on the holiday for use during the week, did something prohibited, and must receive lashes.
The sages above bring proofs of their opinions and refutations of the other side’s. The sage who exempts the baker from lashes asked the sage who demands the lashes how one may, in practical Halacha, bake on the holiday for use on the Sabbath. Answer: One may bake on the holiday for use on the Sabbath; the prohibition is only about use during the week. The sage above then asked about a dying cow, which one is permitted to slaughter on the holiday so that it does not die on its own and its flesh become forbidden for us. How did the sages permit this slaughter though one does not intend to eat of the cow over the holiday? You must argue that theoretically visitors could come, requiring that one serve them the flesh of this cow. Answer: Since not slaughtering the animal would cause a substantial loss of money, one may slaughter the animal to eat of its flesh on the holiday.
The sage who demands lashes asked the sage who exempts the baker: The early sages (Tanaaim) ruled that one who plows on a holiday is punished with lashes. The plower could argue that theoretically one might need the plowing on the holiday itself, as one who needs to cover blood of a slaughtered chicken using the plowed dirt. Answer: The early sages made this demand of one who plows hard dirt, dirt which cannot be used to cover the blood of a slaughtered chicken. The scholars then asked: One could pound clods of hardened earth and then one could use them to cover the blood of the slaughtered chicken. Answer: Crushing is forbidden on a holiday. The scholars then asked: One could pound the clods of dirt with one’s elbow, not the usual way of crushing, and so the pounding would be permitted on the holiday. Answer: The early sages demanded punishment of one who plows particularly hard dirt, dirt which cannot be crushed. The scholars then asked: If we speak of particularly hard dirt, why plow it in advance of planting, since the ground is not suitable for planting? Answer: The ground of this field is hard on top and suitable for planting deep down, where the ground is less hard. Thus, after plowing the clods cannot be crushed, but the field can be sowed. The scholars then asked: If the field is deep down suitable for planting, is it not also suitable for covering the blood of the slaughtered chicken? If so, there is no prohibition against plowing. Due to this question the scholar Mar son of Rav Ashi stated that the early sages demanded punishment for one who plows a field whose dirt is moist and muddied, and so not suitable for use in covering the blood of a slaughtered chicken. The scholar asked: But a moist and muddied field is also not suitable for sowing. Answer: The field is just moist enough to be suitable for sowing but not for covering the blood of a slaughtered chicken, for it sticks like dough.
The scholar Abaye asked the sage who thought one should rely upon the theoretical need: The early sages (Tanaaim) ruled that one who lights a fire on a holiday to cook meat which he is forbidden to eat (e.g., meat cooked in milk) is given lashes for burning a fire. If we rely upon some theoretical need, it is possible that he would need the fire for other, permitted uses for the holiday. Because they demanded the man be punished with lashes, we can imply that we should not use a theoretical argument. Answer: We should change the version which is brought in the name of the early sages. Instead of demanding punishment for lighting a fire, we should state that they demanded the punishment of lashes for the consumption of forbidden meat. The scholars asked: From the words of the early sages we find no basis for changing the text so. Answer: The new version should read that instead of punishing the person for lighting a fire, he is punished with lashes for violating the prohibition on using trees which are prohibited from use on the holiday and are therefore muktzeh. the scholars asked: Use of prohibited wood is not a Torah prohibition which requires lashes. Answer: Change the new version to read that instead of being punished for lighting a fire, the person is punished with lashes for using wood which was used for idolatrous rituals. The scholars asked: If the person used wood which had previously been used for idolatrous rituals, there should be an additional punishment for violating “You shall not bring abominations into your home.” Answer: Instead of demanding punishment for lighting a fire, we should read it as demanding lashes for using wood which previously had seen use in the Holy Temple.
(Babylonian Talmud, Tractate Pesachim 46b-48a)