-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> It was not a syntax error.  Your expression just had the wrong
> return value.  I don't see how an IDE could help here.
> 
> 

by type inference. i don't know how far an ide could track the types
in clojure since it's completely lacking any type annotations, but in
scala it works really well (although it stops at method declarations,
there you have to add type annotations) and such an error (returning
the wrong type in a situation where it's clear what is expected) would
have been highlighted at coding time (even before compilation)

the ideal situation would be something like

(def x [foo] (+ 5 foo))

here, the ide could look into "+" and check which types could be put
into "+" without making it crash ;). that information must provided
somehow (hard coded into ide, provided as parsable documentation,
whatever) at all basic functions. this would enable the ide to
recursively traverse the call tree and figure out what can be applied
to which function.

in my example, it would be
"x" is called with a parameter "foo".
"foo" is given to "+" as the second parameter of a 2 parameter list.
let's look into "+". oh i see, it has to be a java.lang.Number. is it?
yes -> k. no -> highlight "(x param)" as an error.






-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJOZi28AAoJENRtux+h35aGtQMQAKAemGLyIRP+6h9KaL3ix3U+
qOgupgqNGNtkDZ2ibYlYRfunJKRm8KLwVnh/0jiTBukY8ppOJTgTuUde6abcl10G
pYomKWPNZBxTRAYI4nRtTKk9cEj0yx3CLYislbk4buxgmLCLNSBOLBmWBD7F8Rxz
fR++KLiJJR7JJ/HszrGPr54Vo7AnI1Rfk1+FcX19UJnmIj1qdfLWq8wTSA6oy063
ZinLUBl+3OfATDJlxUMPJdPOjHMDfQ13MlksUVJq4696rhKjvVdMpIpb9REOmg/Y
+ZxKVLBKr+8RruzDcUJwoiVrJOi6f1pXIMzqsKDhaqhDJwr0iHhY98SjkQBAyozI
tLPQmnudMEB6gS7F2/aW2idZ9WD+XiUyoCt2FwplVJqBveBWTAUAXWdpeAl0rmVG
Qjh5hiUgHs4W8X7qmlTzsZPFlwJ+rYZoHzqaw6HcWnGX9H6gv2ExM1+ELJ25dTHh
0AJZl26WLZ7eXZNAeO62FDET64RR3Oib6tVDTzP41IdLzjUx+zwFjfQFOVlEE/Cx
m5azpk8d11zytG2nlcC58Yg8SBz0ZGyTtv4JJ139JqJdVzpYeol7QXZbkrgY5w3/
DQ5+bW7QjqxmD4FbjTcIDcxWcyg+SXda5p4O1ZqxQSWhNa6EzLrWPLufFBfsNyQa
kUjdYxBTJkgtbhl8jxLb
=6RyY
-----END PGP SIGNATURE-----

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to