Changeset 4909


Ignore:
Timestamp:
11/29/03 00:51:03 (18 years ago)
Author:
piso
Message:

Work in progress.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/lisp/precompiler.lisp

    r4889 r4909  
    22;;;
    33;;; Copyright (C) 2003 Peter Graves
    4 ;;; $Id: precompiler.lisp,v 1.14 2003-11-24 21:25:01 piso Exp $
     4;;; $Id: precompiler.lisp,v 1.15 2003-11-29 00:51:03 piso Exp $
    55;;;
    66;;; This program is free software; you can redistribute it and/or
     
    6565        `(eq ,(car args) ,(cadr args))
    6666        form)))
     67
     68(define-compiler-macro not (&whole form &rest args)
     69  (if (and (= (length args) 1) (consp (car args)))
     70      (let ((op (caar args)))
     71        (cond ((eq op '>=)
     72               (cons '< (cdr (car args))))
     73              ((eq op '<)
     74               (cons '>= (cdr (car args))))
     75              (t
     76               form)))
     77      form))
    6778
    6879(in-package "EXTENSIONS")
     
    129140
    130141(defun precompile-do-symbols (form)
    131    (list* (car form) (cadr form) (mapcar #'precompile1 (cddr form))))
     142  (list* (car form) (cadr form) (mapcar #'precompile1 (cddr form))))
     143
     144(defun precompile-load-time-value (form)
     145  form)
    132146
    133147(defun precompile-progn (form)
     
    399413                ((compiler-macro-function op)
    400414                 (let ((result (compiler-macroexpand form)))
    401                    (if (equal result form)
    402                        (return-from precompile1 result)
    403                        (return-from precompile1 (precompile1 result)))))
     415                   ;; Fall through if no change...
     416                   (unless (equal result form)
     417                     (return-from precompile1 (precompile1 result)))))
    404418                ((and (not (eq op 'LAMBDA))
    405419                      (macro-function op))
     
    470484(install-handler 'let                  'precompile-let/let*)
    471485(install-handler 'let*                 'precompile-let/let*)
     486
     487(install-handler 'load-time-value      'precompile-load-time-value)
    472488
    473489(install-handler 'catch                'precompile-identity)
Note: See TracChangeset for help on using the changeset viewer.