Changeset 4815


Ignore:
Timestamp:
11/17/03 19:12:24 (18 years ago)
Author:
piso
Message:

EQL compiler macro.

File:
1 edited

Legend:

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

    r4797 r4815  
    22;;;
    33;;; Copyright (C) 2003 Peter Graves
    4 ;;; $Id: precompiler.lisp,v 1.8 2003-11-17 01:44:50 piso Exp $
     4;;; $Id: precompiler.lisp,v 1.9 2003-11-17 19:12:24 piso Exp $
    55;;;
    66;;; This program is free software; you can redistribute it and/or
     
    4747      `(progn ,(car args))
    4848      form))
     49
     50(defun quoted-form-p (form)
     51  (and (consp form) (eq (car form) 'quote) (= (length form) 2)))
     52
     53(define-compiler-macro eql (&whole form &rest args)
     54  (let ((first (car args))
     55        (second (cadr args)))
     56    (if (or (and (sys::quoted-form-p first) (symbolp (cadr first)))
     57            (and (sys::quoted-form-p second) (symbolp (cadr second))))
     58        `(eq ,(car args) ,(cadr args))
     59        form)))
    4960
    5061(in-package "EXTENSIONS")
Note: See TracChangeset for help on using the changeset viewer.