root/lang/elisp/pdicv-mode/trunk/nt-macros.el @ 75

Revision 71, 1.7 kB (checked in by naoya_t, 16 years ago)
Line 
1;;; nt-macros.el --- useful (at least for NT) macros
2;;
3;; Copyright (C) 2005-2009 naoya_t. All Rights Reserved.
4;;
5;; Author: naoya_t <naoya.t@aqua.plala.or.jp>
6;; Maintainer: naoya_t <naoya.t@aqua.plala.or.jp>
7;; Primary distribution site:
8;;   http://lambdarepos.svnrepository.com/svn/share/lang/elisp/pdicv-mode/trunk
9;;
10;; Created: 16 Feb 2005 (formerly nt-utils.el)
11;; Last modified: 15 Dec 2005
12;; Version: 1.0
13;; Keywords: ++ -- ->
14
15(provide 'nt-macros)
16
17;;; Commentary:
18
19; (++ VAR)
20;   - ���R ��ͤ���
21;     (setq VAR (1+ VAR)) ï¿½Î¥Þ¥ï¿½ï¿½í¡£
22
23; (-- VAR)
24;   - ���R ��ͤ򣱸��餹��
25;     (setq VAR (1- VAR)) ï¿½Î¥Þ¥ï¿½ï¿½í¡£
26
27; (string< S1 S2)
28; (string> S1 S2)
29; (string<= S1 S2)
30; (string>= S1 S2)
31;   - (string< S1 S2) ����ؿ��
32
33
34;;; Code:
35(defmacro ++ (var)
36  "increment the specified variable"
37  `(setq ,var (1+ ,var)))
38
39(defmacro -- (var)
40  "decrement the specified variable"
41  `(setq ,var (1- ,var)))
42
43(defmacro += (var num)
44  `(setq ,var (+ ,var ,num)))
45
46(defmacro -= (var num)
47  `(setq ,var (- ,var ,num)))
48
49(defmacro *= (var num)
50  `(setq ,var (* ,var ,num)))
51
52;(defmacro /= (var num)
53;  `(setq ,var (/ ,var ,num)))
54
55(defmacro != (a b)
56  "/="
57  `(not (= ,a ,b)))
58
59(defmacro <<= (var num)
60  `(setq ,var (lsh ,var ,num)))
61
62(defmacro >>= (var num)
63  `(setq ,var (lsh ,var (- ,num))))
64
65(defmacro cdr= (list-var)
66  `(setq ,list-var (cdr ,list-var)))
67
68(defmacro concat= (str-var str)
69  `(setq ,str-var (concat ,str-var ,str)))
70
71;;
72(defmacro -> (array key)
73  ""
74  `(cdr (assoc ,key ,array)))
75
76;;
77(defmacro string> (s1 s2)
78  "string>"
79  `(string< ,s2 ,s1))
80
81(defmacro string<= (s1 s2)
82  "string<="
83  `(not (string< ,s2 ,s1)))
84
85(defmacro string>= (s1 s2)
86  "string>="
87  `(not (string< ,s1 ,s2)))
88
89;;; nt-macros.el ends here
Note: See TracBrowser for help on using the browser.