[racket] Suggestion: Allow above, beside etc. to accept a single image.
I did this explicitly because (I believe) it helps with parenthesis errors
when beginning students make simple mistakes using the library. For more
advanced programmers, it seems straightforward to define things like:
(define (above* . is) (cond [(null? is) (blank)][(null? (cdr is)) (car
is)][else (apply above is)])
and you can even abstract that as a function that takes something like
above and builds an above* from it.
Robby
On Mon, Oct 21, 2013 at 10:58 PM, Daniel Prager
<daniel.a.prager at gmail.com>wrote:
> Currently *above* from 2htdp/image requires at least two arguments. I.e.
>
> procedure
>
> (above i1 i2 is ...) → image?
>
>
> Recently I have been using an idiom where I stack a list of one or more
> images.
> I.e.
>
> (apply above list-of-images)
>
> I have a workaround, but it seems to me that a more tolerant "above" --
> which acts as an identity when passed a single image -- would be an
> improvement to the
> library.
>
> Similarly for beside, etc.
>
>
> Dan
>
> ____________________
> Racket Users list:
> http://lists.racket-lang.org/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20131022/bebb8eed/attachment.html>