htdp icon indicating copy to clipboard operation
htdp copied to clipboard

Why is 2htdp/planetcute so complicated?

Open lexi-lambda opened this issue 10 years ago • 5 comments

For whatever reason, 2htdp/planetcute exports everything as set! transformers. I'm honestly not sure why it does this in the first place, but furthermore, this doesn't play nice with require/typed in Typed Racket (trying to require these seems to trigger an infinite loop in TR).

This itself might be a bug in Typed Racket, but even so, the implementation of planetcute.rkt seems much too complicated for a relatively simple task. Why exactly is it implemented the way it is?

lexi-lambda avatar Feb 28 '15 05:02 lexi-lambda

To cooperate with the teaching languages and to cooperate with executable building.

On Fri, Feb 27, 2015 at 11:54 PM, Alexis King [email protected] wrote:

For whatever reason, 2htdp/planetcute exports everything as set! transformers. I'm honestly not sure why it does this in the first place, but furthermore, this doesn't play nice with require/typed in Typed Racket (trying to require these seems to trigger an infinite loop in TR).

This itself might be a bug in Typed Racket, but even so, the implementation of planetcute.rkt seems much too complicated for a relatively simple task. Why exactly is it implemented the way it is?

— Reply to this email directly or view it on GitHub https://github.com/racket/htdp/issues/2.

rfindler avatar Feb 28 '15 06:02 rfindler

Could you elaborate on that? I understand the intent behind executable building (though I thought Racket had more elegant ways to deal with that), but why are set! transformers necessary to properly cooperate with the teaching languages?

lexi-lambda avatar Feb 28 '15 06:02 lexi-lambda

I don't recall the details.

On Sat, Feb 28, 2015 at 12:03 AM, Alexis King [email protected] wrote:

Could you elaborate on that? I understand the intent behind executable building (though I thought Racket had more elegant ways to deal with that), but why are set! transformers necessary to properly cooperate with the teaching languages?

— Reply to this email directly or view it on GitHub https://github.com/racket/htdp/issues/2#issuecomment-76512870.

rfindler avatar Feb 28 '15 06:02 rfindler

I haven't worked with that code much, but IIRC, student language bindings are macros to provide better error messages, e.g., when accidentally used in a higher-order fashion.

stamourv avatar Feb 28 '15 19:02 stamourv

Sorry for the recalcitrant tone: I'm just saying that I can't really recall what's going on there, but that if you want to change it feel free as long as you make sure that it still works properly with the teaching languages and when you create an executable from the teaching languages. I have some vague memory of doing something so that if you use only a few images you don't get all the images into your executable, but I'm not sure about that.

rfindler avatar Feb 28 '15 20:02 rfindler