On Mar 25 2013, Moritz Heidkamp wrote:
(let ((foobar (the (or null (list-of number)) '())))
Warning: in toplevel procedure `foo#bar':
expression returns a result of type `null', but is declared to return
(list-of number)', which is not a subtype
It seems you can trick the compiler by using something like this:
(the (list-of number) (apply list '()))
I'm not sure whether that's how THE BOSS intended the -strict-types
option to be (ab)used though :-)
Thanks for this idea!
Better follow Peter's advice of getting
rid of the mutation.
Hm, the example is stripped down from some argument parsing.
Given N many bindings, wouldn't it be it a bit expensive to
unroll the simple case-dispatch into N eq?-Tests? Let alone
that the code would become quite unreadable. (Though this
could eventually be handled by macro expansion.)
So I'd better resort to some compiler-trickery to get the
explicit "the" declaration to work.
Thanks again
/Jörg
........
_______________________________________________
Chicken-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/chicken-users