An open API service indexing awesome lists of open source software.

https://github.com/yitzchak/trivial-do

Additional dolist style macros for Common Lisp
https://github.com/yitzchak/trivial-do

common-lisp

Last synced: 3 months ago
JSON representation

Additional dolist style macros for Common Lisp

Awesome Lists containing this project

README

        

# trivial-do

Additional dolist style macros for Common Lisp. Currently provides `doalist`, `dohash`, `dolist*`, `doplist`, `doseq` and `doseq*`.

## doalist

Iterates over the key value pairs of an alist.

```lisp
(doalist (key value alist &optional return-form)
(format t "key: ~A, value: ~A~%" key value))
```

## dohash

Iterates over the key value pairs of a hash table.

```lisp
(dohash (key value hash-table &optional return-form)
(format t "key: ~A, value: ~A~%" key value))
```

## dolist*

Iterates over a list with a position variable tracking the current index.

```lisp
(dolist* (position value list &optional return-form)
(format t "position: ~A, value: ~A~%" position value))
```

## doplist

Iterates over the key value pairs of an plist.

```lisp
(doplist (key value plist &optional return-form)
(format t "key: ~A, value: ~A~%" key value))
```

## doseq

Iterates over the values of a sequence.

```lisp
(doseq (value sequence &optional return-form)
(format t "value: ~A~%" position value))
```

## doseq*

Iterates over a sequence with a position variable tracking the current index.

```lisp
(doseq* (position value sequence &optional return-form)
(format t "position: ~A, value: ~A~%" position value))
```