Re: Clojure newbie question regarding compile time type checking.

2009-12-24 Thread Daniel Werner
On Dec 13, 5:24 am, ajay gopalakrishnan wrote: > It tried the following in REPL and got no error. Personally, I feel that I > should get an error because calling square on strings is wrong in both > cases. > > Is there a way out of this in Clojure? I hope you don't mind me bumping this old thread

Re: Clojure newbie question regarding compile time type checking.

2009-12-15 Thread ajay gopalakrishnan
On Tue, Dec 15, 2009 at 9:11 AM, Garth Sheldon-Coulson wrote: > OTOH, when Rich gave a talk at MIT recently he mentioned he wasn't terribly > interested in type systems for Clojure apart from (potentially) a simple > binary type system to distinguish I/O-side-effecty things from > non-I/O-side-ef

Re: Clojure newbie question regarding compile time type checking.

2009-12-15 Thread Luc Préfontaine
If Clojure type checking becomes a frequent request/complaint, please build a lint type tool, not some twisted logic embedded in the compiler :))) C did not have any decent type checking when it came out and we had to use lint to find bad parameter on fn calls and other similar errors. They were n

Re: Clojure newbie question regarding compile time type checking.

2009-12-15 Thread Baishampayan Ghose
On Tuesday 15 December 2009 06:21 PM, ajay gopalakrishnan wrote: > Oh ... I know all that. What I wanted to know is that is there any way > to FORCE compile time checking by providing some flag or the other to > Clojure compiler. If not, I guess a good set of test cases is the only > way to fix it.

Re: Clojure newbie question regarding compile time type checking.

2009-12-15 Thread Tayssir John Gabbour
On Dec 15, 1:23 pm, Baishampayan Ghose wrote: > PS - If you are worried about "compile time type checking", I think it's > prudent to mention now that Clojure is a dynamically typed programming > language where types are checked at run-time and not compile time. Actually, there are Common Lisp co

Re: Clojure newbie question regarding compile time type checking.

2009-12-15 Thread Garth Sheldon-Coulson
OTOH, when Rich gave a talk at MIT recently he mentioned he wasn't terribly interested in type systems for Clojure apart from (potentially) a simple binary type system to distinguish I/O-side-effecty things from non-I/O-side-effecty things. He also mentioned something extremely interesting about wa

Re: Clojure newbie question regarding compile time type checking.

2009-12-15 Thread Laurent PETIT
2009/12/15 ajay gopalakrishnan > Oh ... I know all that. What I wanted to know is that is there any way to > FORCE compile time checking by providing some flag or the other to Clojure > compiler. If not, I guess a good set of test cases is the only way to fix > it. (Good test cases are always rec

Re: Clojure newbie question regarding compile time type checking.

2009-12-15 Thread ajay gopalakrishnan
Oh ... I know all that. What I wanted to know is that is there any way to FORCE compile time checking by providing some flag or the other to Clojure compiler. If not, I guess a good set of test cases is the only way to fix it. (Good test cases are always recommended, it's just that in this case it

Re: Clojure newbie question regarding compile time type checking.

2009-12-15 Thread Baishampayan Ghose
Ajay, > It tried the following in REPL and got no error. Personally, I feel that > I should get an error because calling square on strings is wrong in both > cases. > > Is there a way out of this in Clojure? > > |(defn square[n] (* n n)) > > (if (= 0 0) (println"hello") (map square["a" "b"

Clojure newbie question regarding compile time type checking.

2009-12-13 Thread ajay gopalakrishnan
It tried the following in REPL and got no error. Personally, I feel that I should get an error because calling square on strings is wrong in both cases. Is there a way out of this in Clojure? (defn square [n] (* n n)) (if (= 0 0) (println "hello") (map square ["a" "b"])) The following gives erro