src/chili-dogs.lisp @ 1d3928ec556d

Fix typo
author Steve Losh <steve@stevelosh.com>
date Sat, 24 Oct 2020 15:55:36 -0400
parents 54ec08936d37
children (none)
(in-package :losh.chili-dogs)

(defmacro defun-inlineable (name &body body)
  "Like `defun-inline`, but declaims `name` to be `notinline` afterword.

  This is useful when you don't want to inline a function everywhere, but *do*
  want to have the ability to inline it on demand with (declare (inline ...)).

  "
  `(progn
     (declaim (inline ,name))
     (defun ,name ,@body)
     (declaim (notinline ,name))
     ',name))

(defmacro defun-inline (name args &body body)
  "Like `defun`, but declaims `name` to be `inline`."
  `(progn
     (declaim (inline ,name))
     (defun ,name ,args ,@body)
     ',name))