comp.lang.ada
 help / color / mirror / Atom feed
From: drw@cullvax.UUCP
Subject: single valued variables
Date: Tue, 7-Apr-87 00:26:19 EST	[thread overview]
Date: Tue Apr  7 00:26:19 1987
Message-ID: <1042@cullvax.UUCP> (raw)

"SVDSD::PETCHER@ti-eg.CSNET" writes:
> I am not an Ada expert, so correct me if I'm wrong, but...
> When one declares a variable range to be (true..true) is that not in itself a 
> contradiction?  A variable that can have only one value is, by definition, not 
> a variable, but a constant.  In that context, it seems a compiler should 
> create a constant, issue a diagnostic for any subsequent code that attempts to 
> change the constant, and generate no executeable code for same.  I realize the 
> most likely place for a single-valued variable to occur would be in 
> instantiation of a generic, but if a generic so instantiated does not treat 
> single-valued variables as constants then the program is basically in error.

I'm not well-versed in Ada, but methinks that such a variable is
inherently different from a constant in that one can/should be able to
assign to it--although there is only one value that can be assigned,
so it doesn't do very much!  Anything else leads to serious
nonuniformity.

Dale
-- 
Dale Worley		Cullinet Software
UUCP: ...!seismo!harvard!mit-eddie!cullvax!drw
ARPA: cullvax!drw@eddie.mit.edu
Un*x (a generic name for a class of OS's) != Unix (AT&T's brand of such)

             reply	other threads:[~1987-04-07  5:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1987-04-07  5:26 drw [this message]
  -- strict thread matches above, loose matches on Subject: below --
1987-04-03 12:14 single valued variables SVDSD::PETCHER@ti-eg.CSNET
1987-04-06 13:44 ` firth
1987-04-08 19:29 ` gore
replies disabled

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