Re: [racket-dev] 2htdp/image Feature Suggestion

2014-06-22 Thread Kevin Forchione

On Jun 21, 2014, at 5:02 PM, Robby Findler ro...@eecs.northwestern.edu wrote:

 What do you think about a variant on center-crop called crop/align
 that accepts a width, a height, an image, and an x-place and a
 y-place?
 
 That would seem to fit better into the library the way it's currently
 constructed.
 
 For working around the frame issue, how about just a color-frame
 function that controls the color for now?

I agree! That’s even better in terms of use and simplicity.

-Kevin_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] 2htdp/image Feature Suggestion

2014-06-22 Thread Kevin Forchione

On Jun 21, 2014, at 3:22 PM, Matthias Felleisen matth...@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_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] 2htdp/image Feature Suggestion

2014-06-22 Thread Robby Findler
Thanks! I've added these two functions.

Robby

On Sun, Jun 22, 2014 at 12:26 PM, Kevin Forchione lyss...@gmail.com wrote:

 On Jun 21, 2014, at 5:02 PM, Robby Findler ro...@eecs.northwestern.edu
 wrote:

 What do you think about a variant on center-crop called crop/align
 that accepts a width, a height, an image, and an x-place and a
 y-place?

 That would seem to fit better into the library the way it's currently
 constructed.

 For working around the frame issue, how about just a color-frame
 function that controls the color for now?


 I agree! That’s even better in terms of use and simplicity.

 -Kevin

_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] 2htdp/image Feature Suggestion

2014-06-22 Thread Asumu Takikawa
On 2014-06-22 20:27:21 -0700, Kevin Forchione wrote:
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!

In recent Racket distributions and online docs there's now a style
manual:

  http://docs.racket-lang.org/style/index.html

Cheers,
Asumu
_
  Racket Developers list:
  http://lists.racket-lang.org/dev