[racket] Suggestion: Allow above, beside etc. to accept a single image.

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Tue Oct 22 11:27:48 EDT 2013

Sure, it would be nice. FWIW, there is also the pict library.

Robby


On Tue, Oct 22, 2013 at 10:07 AM, Daniel Prager
<daniel.a.prager at gmail.com>wrote:

> Good to understand the trade-off.  In a  similar vein I see that in BSL (+
> ...), for example, requires at least two arguments vs zero or more in
> racket.
>
> I did find it a little odd that I had recourse to use a "teachpack" to
> gain access to this nice set of general-purpose drawing abstractions. Are
> the facilities provided in 2htdp/image used a fair bit in non-teaching
> contexts? If so,
> would it make sense to factor out a racket-oriented library at some stage?
>
> Dan
>
>
> On Tue, Oct 22, 2013 at 5:33 AM, Matthias Felleisen <matthias at ccs.neu.edu>wrote:
>
>>
>> This is of course a symptom of the more general problem that we fail to
>> have a mechanism that specializes a module to a particular language
>> context. In *SL, the restriction is absolutely great; in Racket, the
>> restriction is a pain. Note that units wouldn't solve the problem cleanly
>> either -- Matthias
>>
>>
>>
>>
>>
>>
>>
>> On Oct 22, 2013, at 8:14 AM, Robby Findler <robby at eecs.northwestern.edu>
>> wrote:
>>
>> > 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
>> >
>> >
>> > ____________________
>> >  Racket Users list:
>> >  http://lists.racket-lang.org/users
>>
>>
>
>
> --
> *Daniel Prager*
> Agile/Lean Coaching, Software Development and Leadership
> Twitter: @agilejitsu <https://twitter.com/agilejitsu>
> Blog: agile-jitsu.blogspot.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20131022/71ed21fc/attachment.html>

Posted on the users mailing list.