Giter Club home page Giter Club logo

template-function's Introduction

Template Function - When Code is a Function of Type

In many application domains it is common to implement algorithms that are defined for instances of the common lisp array, sequence and/or number classes. The abstract nature of these classes makes it difficult for compilers to simultaneously satisfy user demands on run-time performance whilst maintaining generality. Unsurprisingly, developers typically sacrifice generality by specializing the implementation to one or more subclasses. This decision introduces issues concerning maintainability, portability and reuse.

The template function system avoids this sacrifice by providing functionality which allows users to request an implementation which is specialized to a set of types. The generated specialization is then associated with a template function object and is automatically selected at runtime or at compile time according to type information found in the function application.

The system provides support for template functions composed of other template functions, recursive template functions, inlined templated functions and template functions accepting optional, rest and keyword arguments. Associated with this functionality is a meta-object protocol consisting of object, glue and syntax layers.

Users should be aware that the interface provided by the template function system is subject to change.

Documentation and tutorials for this project are provided in the project wiki.

Installation

The template function system has the following dependencies:

  1. Alexandria
  2. Introspect Environment
  3. Specialization Store
  4. FiveAM (test framework)

The template function system has been tested using SBCL and Clozure Common Lisp.

Great effort has been spent on implementing this system such that it is portable to all implementations. The compile time dispatch functionality makes extensive use of compiler macros and the CLTL2 environment API.

The template function system can be loaded in to your lisp environment by evaluating the following ASDF forms

(asdf:load-system "template-function")

The template function system includes a large suite of tests. These tests can be executed by evaluating the following forms

(asdf:test-system "specialization-store")
(asdf:test-system "template-function")

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.