Re: Code style question
- From: "Tobias C. Rittweiler" <tcr@xxxxxxxxxxxxxxxxxxx>
- Date: Sun, 01 Mar 2009 12:33:09 +0100
Duane Rettig writes:
On Feb 28, 8:31 am, "Tobias C. Rittweiler" <...> wrote:
[2] It does matter a whole lot more with environment access as DEFTYPE
definitions can access the current compilation environment. Any
environment proposal should probably address that matter. I do not
know whether Duane Rettig's env-access proposal tackles this issue.
(Duane, if you happen to read this footnote, did you deal with this
problem?)
I don't see it as a problem, and so I never dealt with it. I don't
know why a compiler would consider these two declarations as applying
to anything but the same variable, with the same scope.
I thought I could construct an example where it were ambiguous. But I
now I can't. Meh! :-)
I recall that the standard says that consequences are undefined if two
declaration specifiers contradict each other, but I cannot find any
reference. In the absence of such a paragraph, the behaviour of the
following is not totally clear:
(declare (inline foo) (notinline foo))
vs.
(declare (notinline foo) (inline foo))
or even
(declare (optimize (speed 1)))
(declare (optimize (speed 3)))
vs.
(declare (optimize (speed 3)))
(declare (optimize (speed 1)))
There's nothing that says that the later comming declaration should
prevail.
And environment access complicates the issue. Let's consider something
on the line of
(deftype quux (&environment env)
(if (declaration-information 'ENABLE-FROBBAGE env)
'%unsafe-quux
'%safe-quux))
What is the type specifier QUUX supposed to expand in the following
snippets:
(declare (enable-frobbage t) (type quux *foo*))
vs.
(declare (type quux *foo*) (enable-frobbage t))
or
(declare (enable-frobbage t))
(declare (type quux *foo*))
vs.
(declare (enable-frobbage t))
(declare (type quux *foo*))
A more ambiguous question is: what variable does the following
declaration affect (which is of course a bouund declaration)?
(let* ((x (foo))
(y (bar x))
(x (bas y)))
(declare (fixnum x))
...)
I'd be inclined to say both. :-) How did the Franz people decide to deal
with this?
-T.
.
- Prev by Date: Cheap Wholesale UGG Chanel Gucci Women's Boots & Handbgs
- Next by Date: Re: please review my code
- Previous by thread: Cheap Wholesale UGG Chanel Gucci Women's Boots & Handbgs
- Next by thread: Re: Creating setf expanders on methods
- Index(es):
Relevant Pages
|