From: "Jeffrey R. Carter" <spam@spam.com>
Subject: Re: Range constraints on subprogram parameters?
Date: Fri, 30 Sep 2005 05:46:06 GMT
Date: 2005-09-30T05:46:06+00:00 [thread overview]
Message-ID: <yi4%e.5290$oc.213@newsread2.news.pas.earthlink.net> (raw)
In-Reply-To: <dhi7iq$aj4$1@geraldo.cc.utexas.edu>
Bobby D. Bryant wrote:
> Yes, that's what I was wanting.
>
> It occurs to me in retrospect that it would be problematic from a
> language design perspective, since it would be impossible to enforce
> at compile time.
It doesn't have to be enforceable at compile time, since subtype constraints
don't have to be static:
procedure Outer (Max : in Positive) is
subtype Num is Positive range 1 .. Max;
procedure Inner (X : in Num) is
is perfectly legal.
It mostly depends on where the subprogram is declared compared to where the
constraints are known.
--
Jeff Carter
"There's no messiah here. There's a mess all right, but no messiah."
Monty Python's Life of Brian
84
next prev parent reply other threads:[~2005-09-30 5:46 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-28 20:00 Range constraints on subprogram parameters? Bobby D. Bryant
2005-09-29 5:39 ` Jeffrey R. Carter
2005-09-29 8:30 ` Peter Hermann
2005-09-29 9:06 ` Martin Dowie
2005-09-29 18:16 ` Jeffrey R. Carter
2005-09-30 2:23 ` Bobby D. Bryant
2005-09-30 5:46 ` Jeffrey R. Carter [this message]
2005-10-01 1:07 ` Randy Brukardt
2005-10-01 3:50 ` Jeffrey R. Carter
2005-10-01 14:36 ` Robert A Duff
2005-10-01 14:41 ` Robert A Duff
2005-09-30 2:24 ` Bobby D. Bryant
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox