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
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
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
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
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
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
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
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
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
9 matches
Mail list logo