axiom-developer
[Top][All Lists]
Advanced

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

[Axiom-developer] Re: Returned mail: see transcript for details


From: root
Subject: [Axiom-developer] Re: Returned mail: see transcript for details
Date: Mon, 10 Jan 2005 23:21:06 -0500

Bill, Steve,

I mis-typed...

=====================================================================
This is the function that gets executed when "Character" gets instantiated.
This function has the effect, if memory serves, of PUTTING THE FUNCTION
                                                   ^^^^^^^^^^^^^^^^^^^^
                                                   wrong, wrong, wrong

"Character;" into the |$ConstructorCache|. The |$ConstructorCache| is a
hash table used for fast lookup and function dispatch. The call to 
|Character| will call |Character;| (see below).

(DEFUN |Character| NIL 
=====================================================================



is slightly wrong. It does NOT put the function |Character;| in the
|$ConstructorCache|, it puts the RESULT of calling (|Character;|)
in the cache, which is a fully initialized |infovec| object. 


You'll also find the function call

          (|stuffDomainSlots| |$|) 

in |Character;| interesting. The function is actually defined in
src/interp/nrunopt.boot.pamphlet. From that function you can
reverse-engineer the contents of the initial slots (which are just
  #(NIL NIL NIL NIL NIL NIL ....
at compile time.

Clearly documenting stuffDomainSlots would help as would documenting
all of the rest of it.

Also, for your amusement, try the following:

axiom
(1)-> )lisp (setq $DALYMODE t)
(1)-> )set message autoload on
(1)-> (maphash #'(lambda (key val) (format t "key=~a val=~a~%~%" key val)) 
|$ConstructorCache|)
(1)-> 1
(1)-> (maphash #'(lambda (key val) (format t "key=~a val=~a~%~%" key val)) 
|$ConstructorCache|)

The first maphash returns NIL

The second maphash returns the loaded domains. The messages that get
printed (from loadlib in src/interp/lisplib.boot.pamphlet) turn out 
to be the same domains you'll see in the constructor cache. Loading
the domain causes it to be "instantiated" which means that the 
infovec for the domain gets filled in and stuck in the constructorcache.

If a domain is already in the constructor cache it will not be loaded.
Thus domain loading occurs on demand and only once.

Tim




reply via email to

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