gcl-devel
[Top][All Lists]
Advanced

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

Re: [Gcl-devel] eval-when 'defaults'


From: Camm Maguire
Subject: Re: [Gcl-devel] eval-when 'defaults'
Date: 07 Jul 2004 18:30:18 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Greetings!

Further on this, to be more concrete, in the following should def-op
be run at compile-time?

(defvar *acursor*  nil)
(import 'sloop:sloop)

(defmacro def-op (name type op &optional return-type)
            `(setf (macro-function ',name) (make-operation ',type ',op
                                                           ',return-type)))
;;make very sure .type .op and .return are not special!!
(defun make-operation (.type .op .return)
  (or .return (setf .return .type))
  #'(lambda (bod env) env
      (sloop for v in (cdr bod)
             when (eq t .type) collect v into body
             else
             collect `(the , .type ,v) into body
             finally (setq body `(, .op ,@ body))
             (return
             (if (eq t .return) body
               `(the , .return ,body))))))

(def-op f+ fixnum +)
(def-op f- fixnum -)


Take care,

Camm Maguire <address@hidden> writes:

> Greetings!  Paul, from my brief reading of the spec, it would appear
> that the default behavior for top level forms in a file being
> compiled would be as if they were surrounded by an (eval-when
> (:compile-toplevel :load-toplevel :execute)...).  Is this right? 
> 
> Witness the following comment in gcl_cmptop.lsp:
> 
> ;; this default will be as close to the the decision of the x3j13 committee
> ;; as I can make it.   Valid values of *eval-when-defaults* are
> ;; a sublist of '(compile eval load)
> (defvar *eval-when-defaults* :defaults)
> 
> And in cmpnew/gcl_cmpinit.lsp:
> 
> (setq compiler::*eval-when-defaults* '(compile eval load))
> 
> Take care,
> -- 
> Camm Maguire                                          address@hidden
> ==========================================================================
> "The earth is but one country, and mankind its citizens."  --  Baha'u'llah
> 
> 
> _______________________________________________
> Gcl-devel mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/gcl-devel
> 
> 
> 

-- 
Camm Maguire                                            address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah




reply via email to

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