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 |
---|