https://github.com/stylewarning/template
https://github.com/stylewarning/template
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/stylewarning/template
- Owner: stylewarning
- License: bsd-3-clause
- Created: 2023-04-09T22:09:40.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-04-09T22:14:27.000Z (about 3 years ago)
- Last Synced: 2025-03-25T23:34:12.187Z (over 1 year ago)
- Language: Common Lisp
- Size: 3.91 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.txt
- License: LICENSE.txt
Awesome Lists containing this project
README
TEMPLATE
========
By Robert Smith
TEMPLATE is a package for templates and template functions, similar to
C++ templates.
Example:
;;; Define the templated function.
(define-templated-function add (type) (x y)
`(locally (declare (type ,type x y))
(the ,type (+ x y))))
;;; Instantiate it with a few types.
(instantiate-templated-function add fixnum)
(instantiate-templated-function add single-float)
;;; Call it.
(add '(fixnum) 1 2)
(add '(single-float) 1.0 2.0)