[racket] TR memory optimization: 240 Bytes of garbage for calling TR?
On Nov 11, 2012, at 2:48 PM, John Clements wrote:
>>
>> I'm not sure why this would be. Is the code students write unrestricted?
>
> Pretty much, yes. So, for instance, a student might write:
>
> (signal-play
> (network ()
> [s ((looper song2))]
> [ctr ((loop-ctr 0 1))]
> [on? (toggle ctr)]
> [out (reverb s)]))
>
> where the signals take on float, boolean, or any kind of value. This expands into something containing this "inner loop" procedure:
>
> (lambda ()
> (define s (n1))
> (define ctr (n2))
> (define on? (toggle ctr))
> (define out (reverb s))
> (set! saved-s s)
> (set! saved-ctr ctr)
> (set! saved-on? on?)
> (set! saved-out out)
> out)
>
> It would be pretty hard to assign types any tighter than "any" to these rhs expressions.
John, are the students really writing code w/o constraints? Would it be much of an imposition to ask for base types?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4373 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20121111/faf898ee/attachment.p7s>