Article View: net.lang.mod2
Article #395Re: exceptions (really volatile variables)
From: Bob Campbell
Date: Thu, 01 May 1986 17:31
Date: Thu, 01 May 1986 17:31
74 lines
3178 bytes
3178 bytes
In article <8604240042.AA13982@uw-beaver.arpa> wyant@apollo.UUCP (Geoffrey Wyant) writes:
>
>register assignments !) Now I think that it's a
>bad idea to stick exception handling into the
>language, but the ability to specify attributes
>in a declaration, such as "volatile" seems to me
>to be usefull. Then one could write the above
>example as
>
> VAR
> fileOpened: [VOLITALE] BOOLEAN ;
> ....
>
>I think that the notion of attributes could be
>generalized to allow specifying field sizes
>for dealing with device registers:
>
> VAR
> mythicalCSR: [VOLITALE] RECORD
> [BITS] commands:
> SET OF (go, halt, catchFire) ;
> [BITS] status:
> SET OF (broken, flaming, toasting, running) ;
> END (* record *);
>
>What do other people think of this ? I think it provides usefull
>functionality without warping the language too much.
>
>
> Geoff Wyant
>-------
Well what I think is that these should be handled as compiler options
ie:
VAR
fileOpened: (*$VOLITALE*) BOOLEAN ;
....
VAR
mythicalCSR: (*$VOLITALE*) RECORD
(*$BITS*) commands:
SET OF (go, halt, catchFire) ;
(*$BITS*) status:
SET OF (broken, flaming, toasting, running) ;
END (* record *);
At this point I must admit that I don't under stand what BITS means.
Does this mean size of BITSET or is BITS to be replaced by a number
indicating the size of the element. (Is this Record to also be
packed? ie how many words it this record). To continue and expand
functionality one would add the compiler option "PACKED". Therefore a
one word of 16 bits records containing two bit fields (as above) would
become:
VAR
mythicalCSR: (*$VOLITALE*) RECORD
(*$PACKED*)
(*$BITS:3*) commands:
SET OF (go, halt, catchFire);
(*$BITS:4*) status:
SET OF (broken, flaming, toasting, running);
END (* record *);
This interpretation of the original intent feels wrong to me as the
size of the SETS (and subranges etc.) and be determined by the number
of elements (or the size of the subrange) dummy feilds can be inserted
to fill out for unused bits. (* Assuming that PACKED maximizes use of
bits in the record *)
This is my 2+ cents,
Bob Campbell
{fluke,dataio,hplsla,sunup,uw-beaver}!tikal!bobc
Technical Details
Message-ID:
<410@tikal.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!cmcl2!seismo!rochester!bullwinkle!uw-beaver!tikal!bobcReferences:
<8604240042.AA13982@uw-beaver.arpa>Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!cmcl2!seismo!rochester!bullwinkle!uw-beaver!tikal!bobc From: bobc@tikal.UUCP (Bob Campbell) Newsgroups: net.lang.mod2 Subject: Re: exceptions (really volatile variables) Message-ID: <410@tikal.UUCP> Date: Thu, 1-May-86 13:31:37 EDT Article-I.D.: tikal.410 Posted: Thu May 1 13:31:37 1986 Date-Received: Sun, 4-May-86 06:54:04 EDT References: <8604240042.AA13982@uw-beaver.arpa> Reply-To: bobc@tikal.UUCP (Bob Campbell) Organization: Teltone Corp., Kirkland, WA Lines: 74 Keywords: Compiler Options.