lambda shortcut: add ^ just a short synonym for lambda

This commit is contained in:
vindarel 2024-04-22 13:42:18 +02:00 committed by vindarel
parent 4e980abac7
commit 1a783277a9
3 changed files with 22 additions and 1 deletions

View file

@ -217,6 +217,16 @@ We use [pythonic-string-reader](https://github.com/smithzvk/pythonic-string-read
too, even only internally. It happens with the Jonathan library.
## Lambda shortcut
`^` is a synonym macro for `lambda`.
```lisp
(^ (x) (+ x 10))
=>
(lambda (x) (+ x 10))
```
Pattern matching
----------------

View file

@ -305,6 +305,16 @@ We currently only try this with serapeum. See *deps/serapeum/sequences-hashtable
`(declaim (ftype (--> ,args ,values) ,function)))
;; from Bard.
(defmacro ^ (&rest forms)
"^ is a synonym macro for lambda.
(^ (x) (+ x 10))
=>
(lambda (x) (+ x 10))"
`(lambda ,@forms))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun symbol-documentation (symbol &key (stream t))

View file

@ -15,7 +15,8 @@
(:routes :easy-routes))
(:export #:enable-shell-passthrough
#:disable-shell-passthrough
#:-->))
#:-->
#:^))
(uiop:define-package ciel-user
(:use :cl :ciel)