mirror of
https://gitlab.com/vindarel/ciel.git
synced 2026-04-27 07:11:10 -07:00
lambda shortcut: add ^ just a short synonym for lambda
This commit is contained in:
parent
4e980abac7
commit
1a783277a9
3 changed files with 22 additions and 1 deletions
|
|
@ -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
|
||||
----------------
|
||||
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
|
|
|||
|
|
@ -15,7 +15,8 @@
|
|||
(:routes :easy-routes))
|
||||
(:export #:enable-shell-passthrough
|
||||
#:disable-shell-passthrough
|
||||
#:-->))
|
||||
#:-->
|
||||
#:^))
|
||||
|
||||
(uiop:define-package ciel-user
|
||||
(:use :cl :ciel)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue