News for hackers. Stuff that matters.
Re:Lisp and Haskell (2017) by ernst_klim on Sunday July 15, 2018 @02:22PM (#17536346)

  (defun sum (lst)
    (let ((acc 0))
      (dolist (x lst)
        (setq acc (+ x acc)))
      acc))

  (sum '("a" "b" "c"))
gives me a runtime error. Does sbcl support parametric polymorphism?
Re:Lisp and Haskell (2017) by YouAreGreat on Sunday July 15, 2018 @04:18PM (#17536841)
The problem as I see it is the type for lst.

Common Lisp has a (CONS α β) type for cons cells with member types α and β, but its LIST type is defined as (OR (CONS T T) NULL), basically more of a binary tree type, where T is the Common Lisp "any" union of all types.

A useable (LIST α) type would be something like μβ.(OR (CONS α β) NULL), but that's not expressible within standard Common Lisp. I expect it to very hard to infer too, especially with CONS cells being mutable.