chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] can't get 'the' to work


From: Moritz Heidkamp
Subject: Re: [Chicken-users] can't get 'the' to work
Date: Mon, 25 Mar 2013 13:46:32 +0100

Jörg F. Wittenberger <address@hidden> writes:
>  (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 :-) Better follow Peter's advice of getting
rid of the mutation.

Moritz



reply via email to

[Prev in Thread] Current Thread [Next in Thread]