Re:Shen more strongly typed than Haskell?
by tizoc on Tuesday September 09, 2014 @10:15AM
(#8290205)
In Scheme asking for the car or cdr of an empty list is an error, and in Common Lisp it isn't (the result is the empty list itself).
In Shen you have "hd" and "tl" which use whatever the platform provides (in Scheme it is going to fail, in Common Lisp it is going to return the empty list), and "head" and "tail" which work the same on all platforms (it is an error to pass an empty list to them, just like in Scheme).
> If I manage to get Shen working (under Chibi) it will be even more interesting to see what it does.
What problems are you experiencing? Please submit an issue on Github and I will look into it.
Translating, the original problem was:
So: And: It appears (mytl) emits a type error in this instance.This is obviously a run-time error, and without specific effort I don't think it would be known at compile-time in the Scheme implementations I'm familiar with.
Since the Scheme expression appears to embody the semantics of the original problem, I'm inclined to think it shows an underlying difference in the handling of the null list between CL and Scheme implementation I used.
If I'm completely wrong, and I can't rule out that possibility, I hope someone will point in the right direction.