comp.lang.ada
 help / color / mirror / Atom feed
From: Maciej Sobczak <see.my.homepage@gmail.com>
Subject: Re: Discriminants of tagged types
Date: Mon, 1 Nov 2010 02:41:42 -0700 (PDT)
Date: 2010-11-01T02:41:42-07:00	[thread overview]
Message-ID: <89f8408d-a998-4bec-a3a8-782af28b4268@30g2000yql.googlegroups.com> (raw)
In-Reply-To: 68c4087e-3f46-4bf8-9de1-42c8fe67794f@v20g2000yqb.googlegroups.com

On 1 Lis, 01:44, Shark8 <onewingedsh...@gmail.com> wrote:

> The assignability of PostScript objects is, IMO, a non-issue.
> Most objects are created via PostScript commands

Which makes them good candidates for being limited, as objects of
limited types can be initialized by functions.

On the other hand, limited types don't work with containers, so you
might want to consider that as a trade-off.

> > In the tutorial analogy of famous shapes, it might be perfectly
> > reasonable to duplicate an arbitrary Shape'Class (whatever it is), but
> > it will be completely unreasonable to assign Square to some existing
> > Circle.
>
> Interesting you mention that; I was working on a bit of a vector-
> graphic program for a computer graphics class and I was kicking around
> the idea of allowing such 'assignments' as being the equivalent of
> "make a shape of this new type which has the same bounding rectangle."
> I eventually decided against it because:
> 1 - The existence of an arbitrary and complex polygon would gum up the
> works,
> and
> 2) I'm lazy.

Laziness is a very good reason ;-), but in this case I think what is
more important is the fact that such assignment semantics would be
arbitrary (what about assigning colors?) and not self-explanatory at
the usage site.
Compare these two:

A := B;  -- what's going on here?

A.Resize_And_Move_For_New_Bounding_Rectangle (B);

I leave it up to you to invent a better operation name, but you get
the point.

I have never implemented any PostScript interpreter, but judging from
what you have described, I would make everything limited without much
regret.

--
Maciej Sobczak * http://www.inspirel.com



  reply	other threads:[~2010-11-01  9:41 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-27 12:16 Discriminants of tagged types Maciej Sobczak
2010-10-27 12:34 ` Ludovic Brenta
2010-10-27 13:19   ` Dmitry A. Kazakov
2010-10-27 13:52     ` Robert A Duff
2010-10-27 14:12       ` Dmitry A. Kazakov
2010-10-27 13:44 ` Robert A Duff
2010-10-27 15:06   ` Adam Beneschan
2010-10-27 15:58     ` Yannick Duchêne (Hibou57)
2010-10-27 16:35       ` Vinzent Hoefler
2010-10-27 17:58       ` J-P. Rosen
2010-10-27 20:18         ` Yannick Duchêne (Hibou57)
2010-10-27 20:26       ` Adam Beneschan
2010-10-27 22:07         ` Yannick Duchêne (Hibou57)
2010-10-27 22:42           ` Adam Beneschan
2010-10-27 15:13   ` Maciej Sobczak
2010-10-27 16:02     ` Yannick Duchêne (Hibou57)
2010-10-27 21:13       ` Maciej Sobczak
2010-10-27 21:23         ` Ludovic Brenta
2010-10-28  8:38           ` Maciej Sobczak
2010-10-27 21:25         ` Vinzent Hoefler
2010-10-28  7:53         ` Dmitry A. Kazakov
2010-10-28  8:50           ` Maciej Sobczak
2010-10-28 10:28             ` Dmitry A. Kazakov
2010-10-28 17:48             ` Yannick Duchêne (Hibou57)
2010-10-29 18:59             ` Vinzent Hoefler
2010-10-30 21:05               ` Maciej Sobczak
2010-10-30 21:21                 ` Vinzent Hoefler
2010-10-30 22:01                   ` Yannick Duchêne (Hibou57)
2010-10-31 16:20                   ` Maciej Sobczak
2010-10-31 17:04                     ` Yannick Duchêne (Hibou57)
2010-10-31 18:36                     ` Shark8
2010-10-31 21:06                       ` Maciej Sobczak
2010-11-01  0:44                         ` Shark8
2010-11-01  9:41                           ` Maciej Sobczak [this message]
2010-10-27 16:06     ` Robert A Duff
2010-10-27 16:34       ` Yannick Duchêne (Hibou57)
2010-10-27 21:05       ` Maciej Sobczak
2010-10-28  0:35         ` Robert A Duff
2010-10-28  8:55           ` Maciej Sobczak
2010-10-27 21:28       ` Simon Wright
2010-10-27 13:54 ` J-P. Rosen
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox