Re: static typing





Jeffery Zhang wrote:
I've been learning Lisp since about Februrary, and I've implemeted some small projects (~300 lines) in lisp. I've built up a small library of utility functions and macros so things are going well.

But there is a nagging thought at the back of my head. I miss static typing of languages like SML and Haskell. Specifically I miss things like type inference.. A lot of times I make small mistakes like forgetting the cdr returns a list and not an element. I feel like without static typing I have to keep the defintiions of the datastructures in my head, which is bad since I'm bad at remembering things. For typed languages a lot of editors can offer code completion based on type analysis, and warn when you pass the wrong type in. Sometimes when list structures get complicated I forget how I wrote it, I would like to be able to declare a type like list<integer> and get warned if I pass this to mapcar and some function whose input is not of type integer.

Is there anything that does this?

http://common-lisp.net/project/slime/

Sorry, private joke. Real answer: no, Lisp has different crutches. Your brain will rewire soon enough.

ken

--
Cells: http://common-lisp.net/project/cells/

"I'll say I'm losing my grip, and it feels terrific."
-- Smiling husband to scowling wife, New Yorker cartoon
.



Relevant Pages

  • Re: static typing
    ... utility functions and macros so things are going well. ... For typed languages a lot of editors can offer code completion ... Sometimes when list structures get complicated I forget how I wrote it, ... "A language implemented in Common Lisp that generates efficient type ...
    (comp.lang.lisp)
  • Re: When static typing is worth it
    ... Static typing typically reduces the need ... superior and represent the evolution of Lisp. ... typed languages you have to write a full working program before you can ...
    (comp.lang.lisp)
  • Re: Why should I care about Lisp and Scheme?
    ... > of the great strengths of Lisp? ... In addition to eval, some macro systems, too, treat list structures as ... where one manipulates syntax objects which are _not_ lists but are ...
    (comp.lang.scheme)
  • Re: static typing
    ... For typed languages a lot of editors can offer code completion ... Sometimes when list structures get complicated I forget how I wrote it, ... secure Lisp programs which you can run on any machine." ... I should study macros more to rework the syntax. ...
    (comp.lang.lisp)
  • Re: Unlearning Pattern Matching
    ... I work with mostly numerical algorithms, ... algorithm you worked out with pencil and paper, ... Lisp for a few months, supporters of statically typed languages would ...
    (comp.lang.lisp)