[plt-scheme] image-snip initialization

From: David Richards (vottamusic at verizon.net)
Date: Thu Aug 3 19:02:24 EDT 2006

Well it helps a little, thanks.  But using the PLT object system makes 
me feel like I'm collecting idioms like a philatelist collects stamps.  
  Shouldn't object systems should be designed not by piling feature on 
top of feature, but by removing the weaknesses and restrictions that 
make additional features appear necessary?

On Aug 3, 2006, at 6:26 PM, Robby Findler wrote:

> In order to make the (old style) positional arguments work with the
> (new style) by name arguments, there are some confusing interactions
> (and error messages).
>
> In this case, you have to propagate the arguments from the initializer
> to Image-Snip% to the arguments to image-snip% via super-make-object,
> which means you need to grab onto and re-send the arguments along.
>
> Maybe this example helps?
>
> (define Image-Snip%
>   (class* image-snip% ()
>
do i do augments and overrides here?

>     (init a b c d)

or here?

>     (super-make-object a b c d)

  or here?

> ))
>
> (define Image (make-object Image-Snip% "/Users/dr/test.jpg" 'jpeg #f 
> #t))
>
> I believe that the reason image-snip% hasn't been converted to use the
> by-name arguments is the "case-lambda"-like initialization it has
> already. In particular, the two argument case is completely different
> from the 4 argument case, and that isn't handled well by `new'.

I wondered about that.

http://www.fotosearch.com/comp/CRT/CRT388/15455-50dg.jpg

- dr
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 1546 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20060803/166f8767/attachment.bin>

Posted on the users mailing list.