When I first read about Duff's Device, I had the immediate knee-jerk "NO! That is Bad and Wrong!" reaction. Then I read it while thinking of the original K&R language design and realized that it was a completely valid approach. The committe agrees with this.
Tom Duff, himself, showed an example of the device and wrote:
Disgusting, no?
I think he also appreciates the same quality in it that you do. And yet, he makes a good case for using it, when appropriate. That's what makes this sort of gem so... delightful. 8-)
A few iterations back, the consensus turned out to be that gotos were not the problem, LABELs were the bad thing. Then again, us Intercal programmers trump it utterly with the "come from" instruction, which totally hampers understanding!
Duff's Device
http://www.lysator.liu.se/c/duffs-device.html (http://www.lysator.liu.se/c/duffs-device.html)
Enjoy
Adrian
Re: Duff's Device
reaction. Then I read it while thinking of the original K&R language design and realized that it
was a completely valid approach. The committe agrees with this.
Re: Duff's Device
Disgusting, no?
I think he also appreciates the same quality in it that you do. And yet, he makes a good case for using it, when appropriate. That's what makes this sort of gem so... delightful. 8-)
Adrian
no subject
no subject
no subject
the problem, LABELs were the bad thing. Then again, us Intercal programmers
trump it utterly with the "come from" instruction, which totally hampers
understanding!