Assorted syntactic sugar for Lisp
Find a file
2025-04-15 12:07:39 -04:00
control-flow.lisp String interpolation 2025-04-14 15:36:00 -04:00
exports.lisp Control flow macros 2024-06-13 18:50:15 -04:00
fun-utils.lisp String interpolation 2025-04-14 15:36:00 -04:00
README.md Bugfix for backslash-c, use name-char instead of cl-unicode 2025-04-15 12:07:39 -04:00
strings.lisp Bugfix for backslash-c, use name-char instead of cl-unicode 2025-04-15 12:07:39 -04:00
superfluous-parentheses.el Initial commit 2024-05-29 10:28:38 -04:00
syrup.asd Bugfix for backslash-c, use name-char instead of cl-unicode 2025-04-15 12:07:39 -04:00
syrup.lisp String interpolation 2025-04-14 15:36:00 -04:00

syrup: assorted syntactic sugar for Lisp

Syrup is a simple package providing syntax enhancements to Common Lisp.

Right now it doesn't do much, but I'll add new features as I think of them.

  • #^sym to export a symbol inline
    • Multi-file projects using this syntax should probably also use (syrup:defpackage*)
  • [] and {} can be used in place of normal parentheses
  • #"" strings for escape sequences and interpolation
    • \~3,'0D(expr): formatted interpolated value (the ~3,'0D part can be any valid (format) directive)
    • \n, \t, \r, \f, \b, \a, and \e
    • \777: octal character codes
    • \xFF, \x{10FFFF}, \U+10FFFF: hex character codes
    • \N{greek small letter phi}: named characters
    • \<Newline> to skip a chunk of whitespace
    • \cX for control codes (e.g. \cA = Start of Heading)
  • (syrup:if*) macro for easier-to-read conditional statements
    (if* (< x 5)
      (format t "x is less than 5!~%")
      (:else-if (< x 20)
        (format t "x is at least 5, but less than 20~%"))
      (:else
        (format t "x is 20 or more~%")))
    
  • (syrup:curry) to create partially-specified functions
    (curry (subseq * 2 *)) ; => (lambda (a b) (subseq a 2 b))