Changeset 18703 for lang/commonlisp

Show
Ignore:
Timestamp:
09/03/08 10:09:43 (4 months ago)
Author:
g000001
Message:

lang/commonlisp/xyzzy-compat: defconstantだと再定義となった場合不便なので、defconstant*を定義して再定義を回避

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/commonlisp/xyzzy-compat/timestamp.lisp

    r18164 r18703  
    5959(in-package :xyzzy) 
    6060 
    61 (defconstant +abbreviated-weekday-names+ 
     61(defmacro defconstant* (sym value &optional doc) 
     62  `(defconstant ,sym (if (boundp ',sym) 
     63                         (symbol-value ',sym) 
     64                         ,value) 
     65     ,@(when doc (list doc)))) 
     66 
     67(defconstant* +abbreviated-weekday-names+ 
    6268  #("Mon" "Tue" "Wed" "Thu" "Fri" "Sat" "Sun")) 
    6369 
    64 (defconstant +full-weekday-names+ 
     70(defconstant* +full-weekday-names+ 
    6571  #("Monday" "Tuesday" "Wednesday" "Thursday" "Friday" "Saturday" "Sunday")) 
    6672 
    67 (defconstant +japanese-weekday-names+ "月火水木金土日") 
    68  
    69 (defconstant +abbreviated-month-names+ 
     73(defconstant* +japanese-weekday-names+ "月火水木金土日") 
     74 
     75(defconstant* +abbreviated-month-names+ 
    7076  #("Jan" "Feb" "Mar" "Apr" "May" "Jun" "Jul" "Aug" "Sep" "Oct" "Nov" "Dec")) 
    7177 
    72 (defconstant +full-month-names+ 
     78(defconstant* +full-month-names+ 
    7379  #("January" "February" "March" "April" "May" "June" 
    7480    "July" "August" "September" "October" "November" "December")) 
     
    7783 
    7884;; 元号と西暦の対応表(たぶん合ってる) 
    79 (defconstant +japanese-era-list+ 
     85(defconstant* +japanese-era-list+ 
    8086  '(("平成" "H" 1989 1 8) 
    8187    ("昭和" "S" 1926 12 25) 
     
    8591   )) 
    8692 
    87 (defconstant +japanese-era+ 
     93(defconstant* +japanese-era+ 
    8894  (mapcar #'(lambda (x) 
    8995              (list (encode-universal-time