1 /* primes.h - table of primitives
3 Copyright (C) 2008 Lutz Mueller
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
21 PRIMITIVE primitive
[] =
23 /* --------- core ------------------ */
25 {"dump-symbol", p_dumpSymbol
, 0},
27 {"while", p_while
, 2},
28 {"until", p_until
, 2},
29 {"do-while", p_doWhile
, 2},
30 {"do-until", p_doUntil
, 2},
31 {"dotimes", p_dotimes
, 2},
33 {"sequence", p_sequence
, 0},
34 {"series", p_series
, 0},
35 {"doargs", p_doargs
, 2},
36 {"dolist", p_dolist
, 2},
37 {"dostring", p_dostring
, 2},
38 {"dotree", p_dotree
, 2},
40 {"cond", p_condition
,1},
41 {"begin", p_evalBlock
,1},
45 {"unless", p_unless
, 2},
47 {"quote", p_quote
, 0},
48 {"silent", p_silent
, 0},
51 {"catch", p_catch
, 0},
52 {"throw", p_throw
, 0},
53 {"apply", p_apply
, 0},
54 {"curry", p_curry
, 0},
58 {"filter", p_filter
, 0},
59 {"clean", p_clean
, 0},
60 {"index", p_index
, 0},
61 {"define", p_define
, 2},
62 {"define-macro", p_defineMacro
, 2},
63 {"expand", p_expand
, 0},
64 {"constant", p_constant
, 0},
65 {"global", p_global
, 0},
69 {"local", p_local
, 2},
71 {"letex", p_letExpand
,3},
72 {"first", p_first
, 0},
77 {"append", p_append
, 0},
80 {"nth-set", p_nthSet
, 0},
82 {"set-ref", p_setRef
, 0},
83 {"ref-set", p_refSet
, 0},
84 {"ref-all", p_refAll
, 0},
85 {"set-ref-all", p_setRefAll
,0},
86 {"select", p_select
, 0},
88 {"slice", p_slice
, 0},
89 {"length", p_length
, 0},
91 {"search", p_search
, 0},
92 {"member", p_member
, 0},
93 {"intersect", p_intersect
, 0},
94 {"difference", p_difference
, 0},
95 {"unique", p_unique
, 0},
96 {"assoc", p_assoc
, 0},
97 {"lookup", p_lookup
, 0},
98 {"count", p_count
, 0},
99 {"set-assoc", p_setAssoc
, 0},
100 {"assoc-set", p_assocSet
, 0},
101 {"replace-assoc", p_replaceAssoc
, 0},
102 {"pop-assoc", p_popAssoc
, 0},
103 {"set-nth", p_setNth
, 0},
104 {"replace", p_replace
, 0},
108 {"reverse", p_reverse
, 0},
109 {"rotate", p_rotate
, 0},
113 {"-", p_subtract
, 0},
114 {"*", p_multiply
, 0},
119 {"<=", p_lessEqual
,0},
120 {">=", p_greaterEqual
,0},
122 {"!=", p_notEqual
, 0},
124 /* --------- bit ops --------------- */
125 {"<<", p_shiftLeft
,0},
126 {">>", p_shiftRight
, 0},
132 /* --------- math and float ------- */
133 {"inc", p_increment
, 0},
134 {"dec", p_decrement
, 0},
135 {"add", p_addFloat
, 0},
136 {"sub", p_subFloat
, 0},
137 {"mul", p_mulFloat
, 0},
138 {"div", p_divFloat
, 0},
141 {"floor", p_floor
, 0},
150 {"atan2", p_atan2
, 0},
154 {"asinh", p_asinh
, 0},
155 {"acosh", p_acosh
, 0},
156 {"atanh", p_atanh
, 0},
157 {"round", p_round
, 0},
163 {"random", p_random
, 0},
164 {"normal", p_normal
, 0},
165 {"randomize", p_randomize
,0},
166 {"encrypt", p_encrypt
, 0},
167 {"min", p_minFloat
, 0},
168 {"max", p_maxFloat
, 0},
169 {"pow", p_powFloat
, 0},
170 {"mod", p_modFloat
, 0},
171 {"prob-z", p_probabilityZ
, 0},
172 {"prob-chi2", p_probabilityChi2
, 0},
173 {"crit-chi2", p_criticalChi2
, 0},
174 {"crit-z", p_criticalZ
, 0},
178 {"betai", p_betai
, 0},
179 {"gammaln", p_gammaln
, 0},
180 {"gammai", p_gammai
, 0},
181 {"binomial", p_binomial
, 0},
182 {"factor", p_factor
, 0},
189 {"transpose", p_matTranspose
, 0},
190 {"multiply", p_matMultiply
, 0},
191 {"invert", p_matInvert
, 0},
192 {"det", p_determinant
, 0},
193 {"mat", p_matScalar
, 0},
194 {"array", p_array
, 0},
195 {"array-list", p_arrayList
, 0},
197 {"bayes-train", p_bayesTrain
, 0},
198 {"bayes-query", p_bayesQuery
, 0},
199 {"unify", p_unify
, 0},
204 /* ------------ string ops ------------- */
205 {"eval-string", p_evalString
, 0},
208 {"explode", p_explode
, 0},
211 {"starts-with", p_startsWith
, 0},
212 {"ends-with", p_endsWith
, 0},
213 {"upper-case", p_upper
, 0},
214 {"lower-case", p_lower
, 0},
215 {"title-case", p_title
, 0},
216 {"format", p_format
, 0},
217 {"match", p_match
, 0},
218 {"regex", p_regex
, 0},
219 {"int", p_integer
, 0},
220 {"integer", p_integer
, 0},
221 {"float", p_float
, 0},
222 {"sym", p_symbol
, 0},
223 {"string", p_string
, 0},
224 {"get-float", p_getFloat
, 0},
225 {"get-string", p_getString
, 0},
226 {"get-int", p_getInteger
, 0},
227 {"get-long", p_getLong
, 0},
228 {"get-char", p_getChar
, 0},
229 {"parse", p_parse
, 0},
231 {"parse-date", p_parseDate
, 0},
234 {"unpack", p_unpack
, 0},
235 {"xml-parse", p_XMLparse
, 0},
236 {"xml-error", p_XMLerror
, 0},
237 {"xml-type-tags", p_XMLtypeTags
, 0},
238 {"base64-enc", p_base64Enc
, 0},
239 {"base64-dec", p_base64Dec
, 0},
240 {"crc32", p_crc32
, 0},
241 {"find-all", p_findAll
, 0},
243 {"unicode", p_unicode
, 0},
245 {"utf8len", p_utf8len
, 0},
248 /* -------------- I/O ------------------ */
249 {"command-line", p_commandLine
, 0},
250 {"pretty-print", p_prettyPrint
, 0},
251 {"print", p_print
, 0},
252 {"println", p_println
, 0},
253 {"read-line", p_readLine
, 0},
254 {"write-line", p_writeLine
, 0},
255 {"current-line",p_currentLine
,0},
256 {"device", p_device
, 0},
259 {"source", p_symbolSource
, 0},
261 {"close", p_close
, 0},
262 {"read-char", p_readChar
, 0},
263 {"write-char", p_writeChar
,0},
264 {"read-buffer", p_readBuffer
,0},
265 {"write-buffer",p_writeBuffer
,0},
266 {"write-file", p_writeFile
,0},
267 {"append-file", p_appendFile
, 0},
268 {"read-file", p_readFile
, 0},
269 {"read-key", p_readKey
, 0},
270 {"get-url", p_getUrl
, 0},
271 {"put-url", p_putUrl
, 0},
272 {"post-url", p_postUrl
, 0},
273 {"delete-url", p_deleteUrl
,0},
274 {"destroy", p_destroyProcess
, 0},
276 {"process", p_process
, 0},
280 {"wait-pid", p_waitpid
, 0},
283 {"share", p_share
, 0},
285 {"semaphore", p_semaphore
,0},
291 /* --------- system/predicates --------- */
292 {"set-locale", p_setlocale
, 0},
293 {"for-all", p_forAll
, 0},
294 {"exists", p_exists
, 0},
295 {"nil?", p_isNil
, 0},
296 {"true?", p_isTrue
, 0},
297 {"NaN?", p_isnan
, 0},
298 {"integer?", p_isInteger
, 0},
299 {"float?", p_isFloat
, 0},
300 {"number?", p_isNumber
, 0},
301 {"string?", p_isString
, 0},
302 {"symbol?", p_isSymbol
, 0},
303 {"legal?", p_isLegal
, 0},
304 {"context?", p_isContext
, 0},
305 {"primitive?", p_isPrimitive
, 0},
306 {"atom?", p_isAtom
, 0},
307 {"quote?", p_isQuote
, 0},
308 {"list?", p_isList
, 0},
309 {"lambda?", p_isLambda
, 0},
310 {"macro?", p_isMacro
, 0},
311 {"array?", p_isArray
, 0},
312 {"empty?", p_isEmpty
, 0},
313 {"null?", p_isNull
, 0},
314 {"zero?", p_isZero
, 0},
315 {"file?", p_isFile
, 0},
316 {"directory?", p_isDirectory
, 0},
317 {"global?", p_isGlobal
, 0},
318 {"protected?", p_isProtected
, 0},
319 {"symbols", p_symbols
, 0},
321 {"debug", p_debug
, 0},
322 {"trace", p_trace
, 0},
323 {"trace-highlight", p_traceHighlight
,0},
324 {"reset", p_reset
, 0},
325 {"throw-error", p_throwError
, 0},
326 {"error-event", p_errorEvent
, 0},
327 {"error-number",p_errorNumber
,0},
328 {"error-text", p_errorText
, 0},
329 {"signal", p_signal
, 0},
330 {"sys-info", p_systemInfo
, 0},
331 {"sys-error", p_systemError
, 0},
334 {"file-info", p_fileInfo
, 0},
335 {"copy-file", p_copyFile
, 0},
336 {"rename-file", p_renameFile
, 0},
337 {"delete-file", p_deleteFile
, 0},
338 {"make-dir", p_makeDir
, 0},
339 {"remove-dir", p_removeDir
, 0},
340 {"change-dir", p_changeDir
, 0},
341 {"directory", p_directory
, 0},
342 {"real-path", p_realpath
, 0},
343 {"main-args", p_mainArgs
, 0},
345 {"context", p_context
, 0},
347 {"default", p_default
, 0},
348 {"timer", p_timerEvent
, 0},
350 {"import", p_importLib
, 0},
351 {"callback", p_callback
, 0},
353 {"delete", p_deleteSymbol
, 0},
355 {"def-new", p_defineNew
, 0},
356 {"address", p_address
, 0},
358 {"cpymem", p_copyMemory
, 0},
359 {"sleep", p_sleep
, 0},
361 {"time-of-day", p_timeOfDay
, 0},
363 {"date-value", p_dateValue
, 0},
364 {"$", p_systemSymbol
, 0},
366 /* ------------ net working ------------ */
367 {"net-close", p_netClose
, 0},
368 {"net-service", p_netService
, 0},
369 {"net-connect", p_netConnect
, 0},
370 {"net-accept", p_netAccept
, 0},
371 {"net-local", p_netLocal
, 0},
372 {"net-peer", p_netPeer
, 0},
373 {"net-lookup", p_netLookup
, 0},
374 {"net-receive", p_netReceive
, 0},
375 {"net-receive-from",p_netReceiveFrom
,0},
376 {"net-receive-udp", p_netReceiveUDP
,0},
377 {"net-send", p_netSend
, 0},
378 {"net-send-to", p_netSendTo
, 0},
379 {"net-send-udp", p_netSendUDP
, 0},
380 {"net-listen", p_netListen
, 0},
381 {"net-peek", p_netPeek
, 0},
382 {"net-select", p_netSelect
, 0},
383 {"net-sessions", p_netSessions
, 0},
384 {"net-eval", p_netEval
, 0},
386 {"net-ping", p_netPing
, 0},
388 {"net-error", p_netLastError
, 0},