Nyquist / XLISP 2.0 - Contents | Tutorials | Examples | Reference

# XLISP Examples

Nyquist/XLISP

- Lists

- print-cons - print lists as dotted conses
- dolist* - a dolist version that can iterate dotted lists

- Arrays

- make-array* - create multi-dimensional arrays
- aref* - access multi-dimensional arrays

- Circular Access

- c-nth - circular list accessor
- c-aref - circular array accessor

- Hash Tables

- make-hash-table - create a hash-table
- puthash - store a key/value pair in a hash-table
- gethash - get a value from a hash-table by using a key
- remhash - remove a key/value pair from a hash-table
- clrhash - remove all key/value pairs from a hash-table
- hash-table-p - is this a hash-table?
- hash-table-size - get the number of buckets
- hash-table count - get the number of key/value pairs
- hash-table-test - get the :test argument given to to make-hash-table
- print-hash-table - print a hash-table in human-readable form

- Strings and Characters

- string* - make a string out of everything
- POSIX Character Classes

- Sequences - lists, strings, and arrays
- Predicates and Comparison
- Files and Directories
- Numbers

- Non-decimal Number Formats

- Binary Integer Numbers
- Octal Integer Numbers
- Hexadecimal Integer Numbers

- divide-float - divide numbers as floating-point numbers
- ceiling - truncate a number toward positive infinity
- floor - truncate a number toward negative infinity
- ash - arithmetic bit-shift left or right
- bsh - binary bit-shift left or right
- csh - circular bit-shift left or right

- Reader

- read-from-string
- *readtable*

- print-readtable - print the XLISP *readtable* in human-readable form
- get-macro-character
- set-macro-character

- Apropos
- Macro Programming
- Evaluation
- Environment
- Advanced XLISP Objects

- XLISP Reader

Common Lisp - written in Nyquist/XLISP

- Where is the Nyquist Common Lisp Library?

- Data and Control Flow

- Comparison

- eq - [Function] - test if arguments are identical
- eql - [Function] - test if arguments are identical or same integer value
- equal - [Function] - test if arguments are structurally equivalent
- cl:equalp - [Function] - test arguments with 'equality' functions

- Multiple Values

- XLISP helpers

- cl:*multiple-values* - [Variable] - signals if a function has returned multiple values
- cl:debug:mv - [Function] - debug multiple value expressions

- Returning Multiple Values

- cl:values - [Function] - return results from evaluated arguments as multiple values
- cl:values-list - [Function] - return multiple values from a list unevaluated

- Working with Multiple Values

- cl:multiple-value-list - [Macro] - evaluate an expression and return all values in a list
- cl:multiple-value-bind - [Macro] - bind multiple values to multiple let variables
- cl:multiple-value-setq - [Macro] - assign multiple values to multiple variables using setq
- cl:multiple-value-prog1 - [Macro] - eveluate multiple expressions, return the values of the first expression
- cl:multiple-value-call - [Macro] - apply a function to multiple values collected in a list

- Numbers

- Rounding and Truncation

- cl:round - round towards the next integer
- cl:truncate - truncate towards zero
- cl:ceiling - truncate towards positive infinity
- cl:floor - truncate towards negative infinity

- Remainder and Modulus

- cl:rem
- cl:mod

- Exponentiation, Logarithms, and Roots

- cl:exp - compute 'e' to the power of 'x'
- cl:expt - compute 'x' to the power of 'y'
- cl:log - logarithms of arbitrary base
- cl:sqrt - sqare root or arbitrary numbers

- Conses

- List Membership

- cl:member - [Function] - test for membership in lists and sub-elements
- cl:member-if - [Function] - search for the first element matching a predicate
- cl:member-if-not - [Function] - search for the first element not matching a predicate

- Non-destructive Removal

- cl:remove
- cl:remove-if
- cl:remove-if-not

- Destructive Removal = Deletion

- cl:delete
- cl:delete-if
- cl:delete-if-not

- Lists as Sets

- cl:pushnew - [Macro] -
- cl:union - [Function]
- cl:intersection - [Function]
- cl:set-difference - [Function]
- cl:set-exclusive-or - [Function]
- cl:subsetp - [Function]

- Sequences

- Subsequences

- cl:subseq - subsequences of lists, strings, or arrays

- Properties of elements in sequences:

- cl:find
- cl:count
- cl:position

- Predicates for testing sequences:

- cl:every
- cl:some
- cl:notevery
- cl:notany

- Functions to modify sequences:

- cl:map