Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/guicho271828/trivialib.typevar

Typevar library for fast, non-CLOS standard structures
https://github.com/guicho271828/trivialib.typevar

Last synced: 29 days ago
JSON representation

Typevar library for fast, non-CLOS standard structures

Awesome Lists containing this project

README

        

* Trivialib.Typevar

** Usage

#+BEGIN_SRC lisp
(defclass kons ()
((kar :type a)
(kdr :type b))
(:metaclass polymorphic-class)
(:typevars a b))

(kons 2 3)
; Instantiating a grounded standard structure KONS/FIXNUM/FIXNUM
#S(KONS/FIXNUM/FIXNUM :KAR 2 :KDR 3)

(kons 0.0 1)
; Instantiating a grounded standard structure KONS/SINGLE-FLOAT/BIT
#S(KONS/SINGLE-FLOAT/BIT :KAR 0.0 :KDR 1)

(defclass kons2 ()
((kar :type a)
(kdr :type a))
(:metaclass polymorphic-class)
(:typevars a))
#

(kons2 0 0)
; STYLE-WARNING: redefining TRIVIALIB.TYPEVAR.TEST::KONS2 in DEFUN
; Instantiating a grounded standard structure KONS2/BIT
#S(KONS2/BIT :KAR 0 :KDR 0)

(kons2 0 0.0)
; Evaluation aborted on #.

#+END_SRC

TODO: integration with FTYPE interface

** Dependencies

This library is at least tested on implementation listed below:

+ SBCL 1.2.8 on X86-64 Linux 3.13.0-46-generic (author's environment)

Also, it depends on the following libraries:

+ alexandria by ::
Alexandria is a collection of portable public domain utilities.

+ trivia by Masataro Asai ::
NON-optimized pattern matcher compatible with OPTIMA, with extensible optimizer interface and clean codebase

** Installation

** Author

+ Masataro Asai ([email protected])

* Copyright

Copyright (c) 2015 Masataro Asai ([email protected])

* License

Licensed under the LLGPL License.