burtonsamograd / typed-cl Goto Github PK
View Code? Open in Web Editor NEWEasier type declerations for for Common Lisp.
Easier type declerations for for Common Lisp.
Typed CL -------- Typed CL is an extension to Common Lisp which allows for the typed decleration of functions and variables. Under the hood, it takes the type information and writes the declerations for you, making your code not only easier to read and safer (due to compiler type checks), but it also gives the compiler more information for optimization and (should) make your code run faster. Some might say that dynamic typing is one of the best features of Common Lisp. The point of this project is twofold: during initial writing and during editing/optimization. You can hack with no types and add them in later, or you can write them in during inital coding. I find the syntax simpler and clearer than adding your own type declerations by themselves. Usage ----- Typed CL comes with an asdf package that can be loaded or required as needed. I will look into adding it to quicklisp in the future. Examples -------- A simple example: (def number square ((number x)) (* x x)) def is exactly like defun except for including the return type and function parameter types. A helper type 'list-of' is included to show how you can create programmably verified types for your parameters: (def integer sum (((list-of integer) l)) (vars ((integer sum 0)) (dolist (n l) (setf sum (+ sum n))) sum)) The above example also shows how to use the vars/vars* macros. ldef is the analog of labels with type information and follows the same convention/syntax as def. Essentially, adding type information just means to wrap your parameters/variables with an extra set of parens, and put the type of before the name and the default value after. The real benefit is with safety > 0. At least with SBCL it will give plenty of warnings when the types do not match what is defined in the signatures and declerations. Care has been taken to provide decent warning/error messages on invalid syntax but it's not perfect. Sometimes the messages are a bit hard to decipher. -- Burton Samograd <[email protected]>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.