From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,4ce5890331a5b529 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!30g2000yql.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: Discriminants of tagged types Date: Mon, 1 Nov 2010 02:41:42 -0700 (PDT) Organization: http://groups.google.com Message-ID: <89f8408d-a998-4bec-a3a8-782af28b4268@30g2000yql.googlegroups.com> References: <14314714-e92c-4036-9cbb-da8e72489261@h7g2000yqn.googlegroups.com> <3243de1d-c6b4-4845-ab5f-28ea4e9f5738@c20g2000yqj.googlegroups.com> <14f33f04-40f5-4a72-a18b-d511dd2eb3b3@w21g2000vby.googlegroups.com> <3c44f6d7-7ff0-4362-8902-fbcfe0eee788@a37g2000yqi.googlegroups.com> <4b0e9629-5a2b-446f-a1bc-d3432db74f13@d8g2000yqf.googlegroups.com> <68c4087e-3f46-4bf8-9de1-42c8fe67794f@v20g2000yqb.googlegroups.com> NNTP-Posting-Host: 137.138.182.236 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1288604502 32392 127.0.0.1 (1 Nov 2010 09:41:42 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 1 Nov 2010 09:41:42 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: 30g2000yql.googlegroups.com; posting-host=137.138.182.236; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8,gzip(gfe) Xref: g2news1.google.com comp.lang.ada:15093 Date: 2010-11-01T02:41:42-07:00 List-Id: On 1 Lis, 01:44, Shark8 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