chicken-hackers
[Top][All Lists]
Advanced

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

Re: [Chicken-hackers] testcase -strict-types


From: Jörg F . Wittenberger
Subject: Re: [Chicken-hackers] testcase -strict-types
Date: 25 Mar 2013 10:30:33 +0100

On Mar 25 2013, Moritz Heidkamp wrote:

Jörg F. Wittenberger <address@hidden> writes:
Though in a way the explanation is correct.  -strict-types assumes
'() to be null from the initialization.  Short of a way to declare
the type of foobar as (list-of <whatever>) this fails when it's used
as the initial and correct value of type (list-of <whatever>) with
zero length.

You should be able to use `the' or `assume' for that purpose.

Where would I find "the" respective "assume" to be documented?

(Would the syntax break standard Scheme compatibility?)



What the optimizer should do is to see into the doloop and notice
the ambiguous type null being refined to a list.

Given that the description of -strict-types is "assume variable do not
change their type" I think the behavior is correct.


Find attached two more variants.  strcttps2.scm, which convinces
chicken to do the right thing, ans strcttps2.scm, which fails
the other way around.

Right, here you initialize the variable's type with list (or pair, I
don't know what's detected) and then possible change it to null while
never checking with null? on the whole list but only on the rest. Looks
fine from what I can tell!





reply via email to

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