Re:I finally understand why I'm not allowed to use Lisp
by mquander on Saturday February 19, 2011 @09:48PM
(#2240797)
That's a very optimistic error message!
error: conversion from std::_Rb_tree_const_iterator<std::pair<
const std::basic_string<char, std::char_traits<char>, std::allocator<char> >,
std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >
to non-scalar type std::_Rb_tree_iterator<std::pair<
const std::basic_string<char, std::char_traits<char>, std::allocator<char> >,
std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >
requested
Re:I finally understand why I'm not allowed to use Lisp
by shadowfox on Saturday February 19, 2011 @11:59PM
(#2241089)
Interestingly enough, the sort of error messages that you mention in OCaml occurs partly due to the inference itself. Because inference is essentially a unification between implicit constraints, once it finds an anomaly, the engine can't always predict correctly which among the conflicting constraints is the actual error from a user point of view.
Anyway just an aside
This is made doubly painful by the incredibly obtuse error messages spat out by some compilers, like:
or even more baroque and confusing monstrosities.Programming in OCaml made me feel like I'd need to take years of type theory classes in order to feel really comfortable in the language.
In comparison, programming in Lisp is a joy, and very easy.
But, in defense of the modern statically typed languages like OCaml and Haskell, I'll have to admit that once you've finished wrestling with the type system and actually gotten your program to compile, you've probably eliminated whole classes of bugs that might still exist in a similar dynamically typed language program. Not to mention that it will save you the writing a ton of unit tests.