gcl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gcl-devel] ansi-tests on a thinkpad & cetera


From: Paul F. Dietz
Subject: Re: [Gcl-devel] ansi-tests on a thinkpad & cetera
Date: Thu, 29 Jan 2004 05:46:52 -0600
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031210

Camm Maguire wrote:

I'd greatly appreciate elucidation of the meaning of the
safety levels, as well as ideas on a conceptual decomposition of the
process of compilation into items which can be fully optimized once
the code and its subcalls has been determined to be correct and items
which might possibly depend on unreviewed user input.  Apparently, the
assumption was made that macro expansion functions would only be
called by GCL itself during macro expansion.

Safety *level* are easy to understand: (safety 3) is 'safe', everything
else can be unsafe.  Code processed at safety level 3 is called 'safe code'
(see section 1.4.2).

What's more important here is understanding the notion of a 'safe call'
(section 3.5.1.1).  When a function call is a safe call, the implementation
is required to perform argument checking as described in section 3.5.1 and
subsections.  A safe call is where each of the following is in safe code
or system code:

(1) The call
(2) The function definition
(3) The point of functional evaluation (for example, where #'foo is evaluated).
    In ordinary (foo ...) calls this is the same as the location of the call.

'System code' there means down in the guts of some builtin function, like
mapcar.  That means that if FOO is defined in with safety 3 and the call

   (mapcar #'foo bar)

is in safe code, then the calls to foo are safe calls.  I have some tests
checking this.  Point (2) means that builtin functions are automatically
assumed to be compiled safely, so any call to them in which (1) and (3)
are in safe code is also considered a safe call.  Of course, you are allowed
to have a version of the builtin function that doesn't check arguments,
intended to be called when (1) or (3) aren't in safe code.

The function returned by MACRO-FUNCTION for builtin macros is system code.

There are some other cases for generic functions, etc. that may not yet be
fully tested.  See section 3.5.1.1 for gory details.

        Paul




reply via email to

[Prev in Thread] Current Thread [Next in Thread]