3 ms·
i have a personal opinion that any sufficiently large project written in a untyped language will become unreadable to anyone external to that project
by dgan 4y ago
i have a personal opinion that any sufficiently large project written in a untyped language will become unreadable to anyone external to that project
- brabel 4y agoYou can type Common Lisp.
- ogogmad 4y agoYou can do anything* in Common Lisp. But will you? * - almost anything
- brabel 4y agoAdding types in CL is pretty trivial [1] to do. So, yes, I will, and I do. [1] https://lispcookbook.github.io/cl-cookbook/type.html#compile-time-type-checking https://lispcookbook.github.io/cl-cookbook/type.html#compile...
- lispm 4y agoCommon Lisp is not untyped. It is dynamically typed. Common Lisp is also object-oriented with classes, generic functions and methods. CL-USER 6 > (defclass foo () ((bar :type number :initform 0))) #<STANDARD-CLASS FOO 82200CF0DB> CL-USER 7 > (defmethod add-number ((object foo) (n number)) (incf (slot-value object 'bar) n)) #<STANDARD-METHOD ADD-NUMBER NIL (FOO NUMBER) 80100E116B> CL-USER 8 > (let ((foo1 (make-instance 'foo))) (add-number foo1 10) foo1) #<FOO 80100E185B> CL-USER 9 > (describe *) #<FOO 80100E185B> is a FOO BAR 10 Thus the source code will contain lots of class definitions, lots of methods with multiple argument dispatching over classes. Thus the source code will contain all the usual class and method declarations. Common Lisp may also contain optional type declarations. For above example the slot BAR of the class FOO has a type NUMBER.
- dgan 4y agoalright, taking my stone back to my yard! I didn't know CL was typed