Changeset 7439

Show
Ignore:
Timestamp:
03/04/08 01:19:31 (5 years ago)
Author:
miyamuko
Message:

lang/xyzzy/xyscope/site-lisp/xyscope.l: 関数の並びを変更。

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/xyzzy/xyscope/site-lisp/xyscope.l

    r7438 r7439  
    103103 
    104104 
    105 (defun builtin-function-p (sym) 
    106   (not (null (member 'si::builtin-function-argument (symbol-plist sym))))) 
    107  
    108 (defun systemp (sym) 
    109   (string-equal "system" (package-name (symbol-package sym)))) 
    110  
    111 (defun make-c-name (prefix sym) 
    112   (let ((str (or (cdr (assoc sym *lisp->c-mapping*)) 
    113                  (string sym)))) 
    114     (concat prefix (remove #\* (substitute #\_ #\- str))))) 
    115  
    116  
    117 (defun xyzzy-lisp-symbol->c-name (sym) 
    118   (funcall (cond ((member sym '(t nil)) 'make-c-name-from-symbol) 
    119                  ((subtypep sym 'condition) 'make-c-name-from-condition) 
    120                  ((keywordp sym) 'make-c-name-from-keyword) 
    121                  ((fboundp sym) 'make-c-name-from-function) 
    122                  ((boundp sym) 'make-c-name-from-variable) 
    123                  (t 'make-c-name-from-symbol)) 
    124            sym)) 
    125  
    126 (defun make-c-name-from-symbol (sym) 
    127   (values (make-c-name "Q" sym) 
    128           :symbol)) 
    129  
    130 (defun make-c-name-from-keyword (sym) 
    131   (values (make-c-name "K" sym) 
    132           :keyword)) 
    133  
    134 (defun make-c-name-from-condition (sym) 
    135   (values (make-c-name "FE" sym) 
    136           :condition)) 
    137  
    138 (defun make-c-name-from-function (sym) 
    139   (unless (builtin-function-p sym) 
    140     (plain-error "~S は builtin function ではありません" sym)) 
    141   (values (make-c-name (if (systemp sym) "Fsi_" "F") sym) 
    142           :function)) 
    143  
    144 (defun make-c-name-from-variable (sym) 
    145   (values (make-c-name (if (systemp sym) "Vsi_" "V") sym) 
    146           :variable)) 
    147  
    148105(defun xyscope-jump-to-xyzzy-source (sym) 
    149106  (interactive "SBuild-in symbol: ") 
     
    171128        (xyscope-jump-to-xyzzy-source 
    172129         (read-from-string (buffer-substring s e))))))) 
    173  
    174130(global-set-key #\C-F4 'xyscope-jump-to-xyzzy-source-current-word) 
     131 
     132 
     133(defun xyzzy-lisp-symbol->c-name (sym) 
     134  (funcall (cond ((member sym '(t nil)) 'make-c-name-from-symbol) 
     135                 ((subtypep sym 'condition) 'make-c-name-from-condition) 
     136                 ((keywordp sym) 'make-c-name-from-keyword) 
     137                 ((fboundp sym) 'make-c-name-from-function) 
     138                 ((boundp sym) 'make-c-name-from-variable) 
     139                 (t 'make-c-name-from-symbol)) 
     140           sym)) 
     141 
     142(defun make-c-name-from-symbol (sym) 
     143  (values (make-c-name "Q" sym) 
     144          :symbol)) 
     145 
     146(defun make-c-name-from-keyword (sym) 
     147  (values (make-c-name "K" sym) 
     148          :keyword)) 
     149 
     150(defun make-c-name-from-condition (sym) 
     151  (values (make-c-name "FE" sym) 
     152          :condition)) 
     153 
     154(defun make-c-name-from-function (sym) 
     155  (unless (builtin-function-p sym) 
     156    (plain-error "~S は builtin function ではありません" sym)) 
     157  (values (make-c-name (if (systemp sym) "Fsi_" "F") sym) 
     158          :function)) 
     159 
     160(defun make-c-name-from-variable (sym) 
     161  (values (make-c-name (if (systemp sym) "Vsi_" "V") sym) 
     162          :variable)) 
     163 
     164(defun make-c-name (prefix sym) 
     165  (let ((str (or (cdr (assoc sym *lisp->c-mapping*)) 
     166                 (string sym)))) 
     167    (concat prefix (remove #\* (substitute #\_ #\- str))))) 
     168 
     169 
     170(defun builtin-function-p (sym) 
     171  (not (null (member 'si::builtin-function-argument (symbol-plist sym))))) 
     172 
     173(defun systemp (sym) 
     174  (string-equal "system" (package-name (symbol-package sym)))) 
    175175 
    176176