1 | /* |
---|
2 | * Primitive.java |
---|
3 | * |
---|
4 | * Copyright (C) 2002-2005 Peter Graves |
---|
5 | * $Id: Primitive.java 12826 2010-07-25 19:09:13Z vvoutilainen $ |
---|
6 | * |
---|
7 | * This program is free software; you can redistribute it and/or |
---|
8 | * modify it under the terms of the GNU General Public License |
---|
9 | * as published by the Free Software Foundation; either version 2 |
---|
10 | * of the License, or (at your option) any later version. |
---|
11 | * |
---|
12 | * This program is distributed in the hope that it will be useful, |
---|
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
15 | * GNU General Public License for more details. |
---|
16 | * |
---|
17 | * You should have received a copy of the GNU General Public License |
---|
18 | * along with this program; if not, write to the Free Software |
---|
19 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
---|
20 | * |
---|
21 | * As a special exception, the copyright holders of this library give you |
---|
22 | * permission to link this library with independent modules to produce an |
---|
23 | * executable, regardless of the license terms of these independent |
---|
24 | * modules, and to copy and distribute the resulting executable under |
---|
25 | * terms of your choice, provided that you also meet, for each linked |
---|
26 | * independent module, the terms and conditions of the license of that |
---|
27 | * module. An independent module is a module which is not derived from |
---|
28 | * or based on this library. If you modify this library, you may extend |
---|
29 | * this exception to your version of the library, but you are not |
---|
30 | * obligated to do so. If you do not wish to do so, delete this |
---|
31 | * exception statement from your version. |
---|
32 | */ |
---|
33 | |
---|
34 | package org.armedbear.lisp; |
---|
35 | |
---|
36 | public class Primitive extends Function |
---|
37 | { |
---|
38 | public Primitive(LispObject name) |
---|
39 | { |
---|
40 | super(name); |
---|
41 | } |
---|
42 | |
---|
43 | public Primitive(String name) |
---|
44 | { |
---|
45 | super(name); |
---|
46 | } |
---|
47 | |
---|
48 | public Primitive(Symbol symbol) |
---|
49 | { |
---|
50 | super(symbol); |
---|
51 | } |
---|
52 | |
---|
53 | public Primitive(Symbol symbol, String arglist) |
---|
54 | { |
---|
55 | super(symbol, arglist); |
---|
56 | } |
---|
57 | |
---|
58 | public Primitive(Symbol symbol, String arglist, String docstring) |
---|
59 | { |
---|
60 | super(symbol, arglist, docstring); |
---|
61 | } |
---|
62 | |
---|
63 | public Primitive(String name, String arglist) |
---|
64 | { |
---|
65 | super(name, arglist); |
---|
66 | } |
---|
67 | |
---|
68 | public Primitive(LispObject name, LispObject lambdaList) |
---|
69 | { |
---|
70 | super(name, lambdaList); |
---|
71 | } |
---|
72 | |
---|
73 | public Primitive(String name, Package pkg) |
---|
74 | { |
---|
75 | super(name, pkg); |
---|
76 | } |
---|
77 | |
---|
78 | public Primitive(String name, Package pkg, boolean exported) |
---|
79 | { |
---|
80 | super(name, pkg, exported); |
---|
81 | } |
---|
82 | |
---|
83 | public Primitive(String name, Package pkg, boolean exported, |
---|
84 | String arglist) |
---|
85 | { |
---|
86 | super(name, pkg, exported, arglist); |
---|
87 | } |
---|
88 | |
---|
89 | public Primitive(String name, Package pkg, boolean exported, |
---|
90 | String arglist, String docstring) |
---|
91 | { |
---|
92 | super(name, pkg, exported, arglist, docstring); |
---|
93 | } |
---|
94 | |
---|
95 | @Override |
---|
96 | public LispObject typeOf() |
---|
97 | { |
---|
98 | return Symbol.COMPILED_FUNCTION; |
---|
99 | } |
---|
100 | |
---|
101 | @Override |
---|
102 | public LispObject execute() |
---|
103 | { |
---|
104 | LispObject[] args = new LispObject[0]; |
---|
105 | return execute(args); |
---|
106 | } |
---|
107 | |
---|
108 | @Override |
---|
109 | public LispObject execute(LispObject arg) |
---|
110 | { |
---|
111 | LispObject[] args = new LispObject[1]; |
---|
112 | args[0] = arg; |
---|
113 | return execute(args); |
---|
114 | } |
---|
115 | |
---|
116 | @Override |
---|
117 | public LispObject execute(LispObject first, LispObject second) |
---|
118 | |
---|
119 | { |
---|
120 | LispObject[] args = new LispObject[2]; |
---|
121 | args[0] = first; |
---|
122 | args[1] = second; |
---|
123 | return execute(args); |
---|
124 | } |
---|
125 | |
---|
126 | @Override |
---|
127 | public LispObject execute(LispObject first, LispObject second, |
---|
128 | LispObject third) |
---|
129 | |
---|
130 | { |
---|
131 | LispObject[] args = new LispObject[3]; |
---|
132 | args[0] = first; |
---|
133 | args[1] = second; |
---|
134 | args[2] = third; |
---|
135 | return execute(args); |
---|
136 | } |
---|
137 | |
---|
138 | @Override |
---|
139 | public LispObject execute(LispObject first, LispObject second, |
---|
140 | LispObject third, LispObject fourth) |
---|
141 | |
---|
142 | { |
---|
143 | LispObject[] args = new LispObject[4]; |
---|
144 | args[0] = first; |
---|
145 | args[1] = second; |
---|
146 | args[2] = third; |
---|
147 | args[3] = fourth; |
---|
148 | return execute(args); |
---|
149 | } |
---|
150 | |
---|
151 | @Override |
---|
152 | public LispObject execute(LispObject first, LispObject second, |
---|
153 | LispObject third, LispObject fourth, |
---|
154 | LispObject fifth) |
---|
155 | |
---|
156 | { |
---|
157 | LispObject[] args = new LispObject[5]; |
---|
158 | args[0] = first; |
---|
159 | args[1] = second; |
---|
160 | args[2] = third; |
---|
161 | args[3] = fourth; |
---|
162 | args[4] = fifth; |
---|
163 | return execute(args); |
---|
164 | } |
---|
165 | |
---|
166 | @Override |
---|
167 | public LispObject execute(LispObject first, LispObject second, |
---|
168 | LispObject third, LispObject fourth, |
---|
169 | LispObject fifth, LispObject sixth) |
---|
170 | |
---|
171 | { |
---|
172 | LispObject[] args = new LispObject[6]; |
---|
173 | args[0] = first; |
---|
174 | args[1] = second; |
---|
175 | args[2] = third; |
---|
176 | args[3] = fourth; |
---|
177 | args[4] = fifth; |
---|
178 | args[5] = sixth; |
---|
179 | return execute(args); |
---|
180 | } |
---|
181 | |
---|
182 | @Override |
---|
183 | public LispObject execute(LispObject first, LispObject second, |
---|
184 | LispObject third, LispObject fourth, |
---|
185 | LispObject fifth, LispObject sixth, |
---|
186 | LispObject seventh) |
---|
187 | |
---|
188 | { |
---|
189 | LispObject[] args = new LispObject[7]; |
---|
190 | args[0] = first; |
---|
191 | args[1] = second; |
---|
192 | args[2] = third; |
---|
193 | args[3] = fourth; |
---|
194 | args[4] = fifth; |
---|
195 | args[5] = sixth; |
---|
196 | args[6] = seventh; |
---|
197 | return execute(args); |
---|
198 | } |
---|
199 | |
---|
200 | @Override |
---|
201 | public LispObject execute(LispObject first, LispObject second, |
---|
202 | LispObject third, LispObject fourth, |
---|
203 | LispObject fifth, LispObject sixth, |
---|
204 | LispObject seventh, LispObject eighth) |
---|
205 | |
---|
206 | { |
---|
207 | LispObject[] args = new LispObject[8]; |
---|
208 | args[0] = first; |
---|
209 | args[1] = second; |
---|
210 | args[2] = third; |
---|
211 | args[3] = fourth; |
---|
212 | args[4] = fifth; |
---|
213 | args[5] = sixth; |
---|
214 | args[6] = seventh; |
---|
215 | args[7] = eighth; |
---|
216 | return execute(args); |
---|
217 | } |
---|
218 | } |
---|