| 1 | /* |
|---|
| 2 | * Primitive.java |
|---|
| 3 | * |
|---|
| 4 | * Copyright (C) 2002-2005 Peter Graves |
|---|
| 5 | * $Id: Primitive.java 12254 2009-11-06 20:07:54Z ehuelsmann $ |
|---|
| 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, String arglist) |
|---|
| 49 | { |
|---|
| 50 | super(symbol, arglist); |
|---|
| 51 | } |
|---|
| 52 | |
|---|
| 53 | public Primitive(Symbol symbol, String arglist, String docstring) |
|---|
| 54 | { |
|---|
| 55 | super(symbol, arglist, docstring); |
|---|
| 56 | } |
|---|
| 57 | |
|---|
| 58 | public Primitive(String name, String arglist) |
|---|
| 59 | { |
|---|
| 60 | super(name, arglist); |
|---|
| 61 | } |
|---|
| 62 | |
|---|
| 63 | public Primitive(LispObject name, LispObject lambdaList) |
|---|
| 64 | { |
|---|
| 65 | super(name, lambdaList); |
|---|
| 66 | } |
|---|
| 67 | |
|---|
| 68 | public Primitive(String name, Package pkg) |
|---|
| 69 | { |
|---|
| 70 | super(name, pkg); |
|---|
| 71 | } |
|---|
| 72 | |
|---|
| 73 | public Primitive(String name, Package pkg, boolean exported) |
|---|
| 74 | { |
|---|
| 75 | super(name, pkg, exported); |
|---|
| 76 | } |
|---|
| 77 | |
|---|
| 78 | public Primitive(String name, Package pkg, boolean exported, |
|---|
| 79 | String arglist) |
|---|
| 80 | { |
|---|
| 81 | super(name, pkg, exported, arglist); |
|---|
| 82 | } |
|---|
| 83 | |
|---|
| 84 | public Primitive(String name, Package pkg, boolean exported, |
|---|
| 85 | String arglist, String docstring) |
|---|
| 86 | { |
|---|
| 87 | super(name, pkg, exported, arglist, docstring); |
|---|
| 88 | } |
|---|
| 89 | |
|---|
| 90 | @Override |
|---|
| 91 | public LispObject typeOf() |
|---|
| 92 | { |
|---|
| 93 | return Symbol.COMPILED_FUNCTION; |
|---|
| 94 | } |
|---|
| 95 | |
|---|
| 96 | @Override |
|---|
| 97 | public LispObject execute() |
|---|
| 98 | { |
|---|
| 99 | LispObject[] args = new LispObject[0]; |
|---|
| 100 | return execute(args); |
|---|
| 101 | } |
|---|
| 102 | |
|---|
| 103 | @Override |
|---|
| 104 | public LispObject execute(LispObject arg) |
|---|
| 105 | { |
|---|
| 106 | LispObject[] args = new LispObject[1]; |
|---|
| 107 | args[0] = arg; |
|---|
| 108 | return execute(args); |
|---|
| 109 | } |
|---|
| 110 | |
|---|
| 111 | @Override |
|---|
| 112 | public LispObject execute(LispObject first, LispObject second) |
|---|
| 113 | |
|---|
| 114 | { |
|---|
| 115 | LispObject[] args = new LispObject[2]; |
|---|
| 116 | args[0] = first; |
|---|
| 117 | args[1] = second; |
|---|
| 118 | return execute(args); |
|---|
| 119 | } |
|---|
| 120 | |
|---|
| 121 | @Override |
|---|
| 122 | public LispObject execute(LispObject first, LispObject second, |
|---|
| 123 | LispObject third) |
|---|
| 124 | |
|---|
| 125 | { |
|---|
| 126 | LispObject[] args = new LispObject[3]; |
|---|
| 127 | args[0] = first; |
|---|
| 128 | args[1] = second; |
|---|
| 129 | args[2] = third; |
|---|
| 130 | return execute(args); |
|---|
| 131 | } |
|---|
| 132 | |
|---|
| 133 | @Override |
|---|
| 134 | public LispObject execute(LispObject first, LispObject second, |
|---|
| 135 | LispObject third, LispObject fourth) |
|---|
| 136 | |
|---|
| 137 | { |
|---|
| 138 | LispObject[] args = new LispObject[4]; |
|---|
| 139 | args[0] = first; |
|---|
| 140 | args[1] = second; |
|---|
| 141 | args[2] = third; |
|---|
| 142 | args[3] = fourth; |
|---|
| 143 | return execute(args); |
|---|
| 144 | } |
|---|
| 145 | |
|---|
| 146 | @Override |
|---|
| 147 | public LispObject execute(LispObject first, LispObject second, |
|---|
| 148 | LispObject third, LispObject fourth, |
|---|
| 149 | LispObject fifth) |
|---|
| 150 | |
|---|
| 151 | { |
|---|
| 152 | LispObject[] args = new LispObject[5]; |
|---|
| 153 | args[0] = first; |
|---|
| 154 | args[1] = second; |
|---|
| 155 | args[2] = third; |
|---|
| 156 | args[3] = fourth; |
|---|
| 157 | args[4] = fifth; |
|---|
| 158 | return execute(args); |
|---|
| 159 | } |
|---|
| 160 | |
|---|
| 161 | @Override |
|---|
| 162 | public LispObject execute(LispObject first, LispObject second, |
|---|
| 163 | LispObject third, LispObject fourth, |
|---|
| 164 | LispObject fifth, LispObject sixth) |
|---|
| 165 | |
|---|
| 166 | { |
|---|
| 167 | LispObject[] args = new LispObject[6]; |
|---|
| 168 | args[0] = first; |
|---|
| 169 | args[1] = second; |
|---|
| 170 | args[2] = third; |
|---|
| 171 | args[3] = fourth; |
|---|
| 172 | args[4] = fifth; |
|---|
| 173 | args[5] = sixth; |
|---|
| 174 | return execute(args); |
|---|
| 175 | } |
|---|
| 176 | |
|---|
| 177 | @Override |
|---|
| 178 | public LispObject execute(LispObject first, LispObject second, |
|---|
| 179 | LispObject third, LispObject fourth, |
|---|
| 180 | LispObject fifth, LispObject sixth, |
|---|
| 181 | LispObject seventh) |
|---|
| 182 | |
|---|
| 183 | { |
|---|
| 184 | LispObject[] args = new LispObject[7]; |
|---|
| 185 | args[0] = first; |
|---|
| 186 | args[1] = second; |
|---|
| 187 | args[2] = third; |
|---|
| 188 | args[3] = fourth; |
|---|
| 189 | args[4] = fifth; |
|---|
| 190 | args[5] = sixth; |
|---|
| 191 | args[6] = seventh; |
|---|
| 192 | return execute(args); |
|---|
| 193 | } |
|---|
| 194 | |
|---|
| 195 | @Override |
|---|
| 196 | public LispObject execute(LispObject first, LispObject second, |
|---|
| 197 | LispObject third, LispObject fourth, |
|---|
| 198 | LispObject fifth, LispObject sixth, |
|---|
| 199 | LispObject seventh, LispObject eighth) |
|---|
| 200 | |
|---|
| 201 | { |
|---|
| 202 | LispObject[] args = new LispObject[8]; |
|---|
| 203 | args[0] = first; |
|---|
| 204 | args[1] = second; |
|---|
| 205 | args[2] = third; |
|---|
| 206 | args[3] = fourth; |
|---|
| 207 | args[4] = fifth; |
|---|
| 208 | args[5] = sixth; |
|---|
| 209 | args[6] = seventh; |
|---|
| 210 | args[7] = eighth; |
|---|
| 211 | return execute(args); |
|---|
| 212 | } |
|---|
| 213 | } |
|---|