Re: Looking for new language features

Laurent Guerby <guerby@acm.org>
9 Sep 2000 13:25:56 -0400

          From comp.compilers

Related articles
Looking for new language features lingolanguage@hotmail.com (William Rayer) (2000-08-27)
Re: Looking for new language features etoffi@bigfoot.com (2000-09-08)
Re: Looking for new language features joachim_d@gmx.de (Joachim Durchholz) (2000-09-08)
Re: Looking for new language features rhyde@cs.ucr.edu (Randall Hyde) (2000-09-09)
Re: Looking for new language features guerby@acm.org (Laurent Guerby) (2000-09-09)
Re: Looking for new language features mq@maq.org (2000-09-11)
Re: Looking for new language features rosing@peakfive.com (Matt Rosing) (2000-09-11)
Re: Looking for new language features rhyde@cs.ucr.edu (Randall Hyde) (2000-09-13)
Re: Looking for new language features viczh@uic.edu (Victor Joukov) (2000-09-15)
Re: Looking for new language features adrian@dcs.rhbnc.ac.uk (2000-09-17)
Re: Looking for new language features mr@peakSPAMLESSfive.com (Matt) (2000-09-21)
[7 later articles]
| List of all articles for this month |
From: Laurent Guerby <guerby@acm.org>
Newsgroups: comp.compilers
Date: 9 Sep 2000 13:25:56 -0400
Organization: Club-Internet (France)
References: 00-08-130 00-09-063
Keywords: design, PL/I

> [The problem with PL/I is that each feature by itself is fine, but they
> don't fit together. Classic example:
>
> DECLARE (A, B, C) CHAR(3);
> B = "123"; C = "456"; A = B + C;
>
> What's in A? Well, PL/I automatically coerces strings to numbers in
> an arithmetic context, so it turns B and C into 123 and 456, then it
> adds them to get 579. It also converts numbers back to strings, using
> a default width, so that's coverted to " 579". Then the string is
> truncated to fit, so A gets " ". Oops. -John]


Looks like to me that only one "bad" feature does all the job here:
automatic type conversion (or coercion as you put it). I don't know
PL/I so I can't say if it's an acceptable language once you remove
this one known "misfeature" ;-).
--
Laurent Guerby <guerby@acm.org>
[Well, gee, you could equally well say that the "bad" feature was
automatic string truncation. Coercion among arithmetic types is
useful and leads to relatively few problems, but when PL/I extended it
to every possible type, chaos ensued. Indeed, I'd claim that
automatic truncation is a terrible feature, because whether to trim
from the left or right depends on the application and either default
will be wrong half the time. -John]





Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.