From: | pardo@cs.washington.edu (David Keppel) |
Newsgroups: | comp.compilers |
Date: | 22 Mar 1996 00:43:57 -0500 |
Organization: | Computer Science & Engineering, U of Washington, Seattle |
References: | 96-03-096 96-03-112 96-03-123 |
Keywords: | standards |
jgj@ssd.hcsc.com (Jeff Jackson) writes:
>[Standards should be an implementation, so it is never ambiguous
> what is the intended implementation.]
There is at least one issue here:
Some parts of the specification of languages are meant to be
ambiguous. (We have debated here the lunacy of doing so; it
stands that some specifications are menat to be ambiguous.)
It is thus necessary to ensure the standard implementation
can immplement each ambiguous construct at least two ways
and that users of the standard exercise both implementations.
This is not necessarily a technical difficulty, but it needs to be
kept in mind.
As a historical footnote, the following is legal C partly because
"the Compiler accepted it":
switch (n & 3) {
do {
case 3: *dst = *src++;
case 2: *dst = *src++;
case 1: *dst = *src++;
case 0: *dst = *src++;
} while ((n -= 4) > 0);
}
It's called "Duff's device" after Tom Duff, the inventor
(discoverer?); it implements an unrolled "copy to device register"
loop.
;-D on ( Gone loopy ) Pardo
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.