I've always wished that CL had at least an option for compile time type checking. Maybe one of the commercial implementations have something.
Chris
secondly, give me an example of "a new source of abstractions." Again, keep it simple. I'm a below average engineer, not a theorist, remember.
findinglisp wrote:Whenever I read anything about type systems on Lambda the Ultimate or other more theoretically-oriented sites, my eyes just glaze over and and I start drooling.
metageek wrote:findinglisp wrote:Whenever I read anything about type systems on Lambda the Ultimate or other more theoretically-oriented sites, my eyes just glaze over and and I start drooling.
Well, yeah. That's because LtU people are off in the future, working on type systems that have powerful capabilities, but haven't yet been reduced a form that one can use and understand without learning category theory first. If you want a feel for what a more advanced type system can do for you, go play with some form of ML. It's not as far along as dependent types and the other drooligens you see on LtU, but it's much nicer than the sorts of things you see in more mainstream languages.
cperkins wrote:I've always wished that CL had at least an option for compile time type checking. Maybe one of the commercial implementations have something.
CL-USER> (defun foo (x) (declare (string x)) (setf x (list x)))
; in: LAMBDA NIL
; (SETF X (LIST X))
; --> SETQ
; ==>
; (THE #<SB-KERNEL:UNION-TYPE STRING> (LIST X))
;
; caught WARNING:
; Asserted type STRING conflicts with derived type (VALUES CONS &OPTIONAL).
; See also:
; The SBCL Manual, Node "Handling of Types"
;
; compilation unit finished
; caught 1 WARNING condition
FOO
CL-USER> (defun bar (x) (car (- x)))
; in: LAMBDA NIL
; (CAR (- X))
;
; note: deleting unreachable code
;
; caught WARNING:
; Asserted type LIST conflicts with derived type (VALUES NUMBER &OPTIONAL).
; See also:
; The SBCL Manual, Node "Handling of Types"
;
; compilation unit finished
; caught 1 WARNING condition
; printed 1 note
BARUsers browsing this forum: No registered users and 0 guests