Re: [racket] How do you convert an image made with 2htdp/image to a bitmap% object?

2013-12-13 Thread Robby Findler
FWIW, you should use make-bitmap, not the make-object variant (well, unless you pass different arguments, but make-bitmap is better). You could also use the file/convertible and maybe we should add a short function there that would convert to a bitmap directly (altho I'm not sure if that introduce

Re: [racket] How do you convert an image made with 2htdp/image to a bitmap% object?

2013-12-13 Thread Daniel Prager
Maybe one for the standard library? (define (image->bitmap image) (let* ([width (image-width image)] [height (image-height image)] [bm (make-object bitmap% width height)] [dc (make-object bitmap-dc% bm)]) (send dc clear) (send image draw dc 0 0 0 0 width height

[racket] How do you convert an image made with 2htdp/image to a bitmap% object?

2013-12-13 Thread Alexander D. Knauth
I wanted to have a button that was an image, and the button% documentation says that the label can be a bitmap, but the image that I want to use was created using the functions in 2htdp/image, and I don't know how to convert it to a bitmap. I tried (send img get- bitmap), but it didn't work

Re: [racket] Learning Scribble

2013-12-13 Thread Ryan Davis
On Nov 23, 2013, at 8:21, Matthias Felleisen wrote: > > On Nov 23, 2013, at 10:45 AM, Laurent wrote: > >> On Sat, Nov 23, 2013 at 4:04 PM, Greg Hendershott >> wrote: >> >> Let me see if I can find time to review the current docs for Planet >> and the new package system, and see where more

[racket] strange interference with prompt, correcture

2013-12-13 Thread 1
Thanks, Jan is right: changing to (require (except-in racket/control set)) is dispensing with the problem. Still this is a Racket pitfall close to be a bug imho. Btw. there were more slips in my hastily reduction. In fact, '·indices should search indices, but therefore the last argument to 'fi

Re: [racket] strange interference with prompt, correcture

2013-12-13 Thread J. Ian Johnson
After you also change your list-ref usage, since that's also erroneous. Perhaps you meant (lambda (ix) (set-member? x ix)) -Ian - Original Message - From: "Sam Tobin-Hochstadt" To: 1...@depikt.net Cc: "users" Sent: Friday, December 13, 2013 10:51:31 AM GMT -05:00 US/Canada Eastern Subjec

Re: [racket] strange interference with prompt, correcture

2013-12-13 Thread Sam Tobin-Hochstadt
I'm pretty sure the problem is that `racket/control` exports a binding named `set`, which is shadowing the regular binding of `set`. If you hide that binding, I think things will work better. Sam On Fri, Dec 13, 2013 at 10:29 AM, <1...@depikt.net> wrote: > > Hello, > > reducing the original cod

[racket] strange interference with prompt, correcture

2013-12-13 Thread 1
Hello, reducing the original code to the example for containing the problem, i've committed a slip. The example code should be: (define (·first occurrences x L) (define R (filter (λ(ix) (set-member? (list-ref L ix) x)) L)) (take R (min (length R) occurrences))) (print (·first 5 (set

[racket] strange interference with prompt/abort

2013-12-13 Thread 1
Hello, learning usage of prompt/abort i've met this strange behavior (code reduced for this example, thus not really sensy): (define (·first occurrences x L) (define R (filter (λ(ix) (set-member? (list-ref L ix) x)) L)) (take R (min (length R) occurrences))) (print (·first 5 (set #\q