[racket-dev] 2htdp/image Feature Suggestion

From: Kevin Forchione (lysseus at gmail.com)
Date: Sun Jun 22 23:27:21 EDT 2014

On Jun 21, 2014, at 3:22 PM, Matthias Felleisen <matthias at ccs.neu.edu> wrote:

> 
> Thanks. We will need to figure out how to accommodate keywords in a teachpack. 
> 
> In the meantime, write frame like this: 
> 
> (define (frame-2 img 
>                 #:frame-color (frame-color 'black)
>                 #:background-color (background-color 'transparent)
>                 #:frame-offset (frame-offset 0)
>                 #:frame-x-offset (frame-x-offset frame-offset)
>                 #:frame-y-offset (frame-y-offset frame-offset))
>  (define width (+ (image-width img) frame-x-offset))
>  (define height (+ (image-height img) frame-y-offset))
>  (overlay (rectangle width height 'outline frame-color)
>           (center-crop width height img)
>           (rectangle width height 'solid background-color)))
> 
> Prefer define over let. -- Matthias
> 

Thanks! Is there any documentation or guide on which “styles” to prefer in writing Racket code? I find myself scratching my head at times in these matters!

-Kevin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/dev/archive/attachments/20140622/4d4654b3/attachment.html>

Posted on the dev mailing list.