Discussion:
[Chicken-users] C5 Type declaration issue
Jörg F. Wittenberger
2018-08-17 17:54:02 UTC
Permalink
This is an instance of an error I'm getting frequently:

/home/u/c5/bin/csc -setup-mode -static -I /home/u/traces/srfi-128
-emit-link-file /home/u/traces/srfi-128/srfi-128.link -host -D
compiling-extension -c -unit srfi-128 -D compiling-static-extension -C
-I/home/u/traces/srfi-128 -O3 -d2 /home/u/traces/srfi-128/srfi-128.scm -o
/home/u/traces/srfi-128/srfi-128.static.o

Warning: at toplevel:
assignment of value of type `(procedure srfi-128#make-comparator (* * *
*) (struct srfi-128#comparator))' to toplevel variable
`srfi-128#make-comparator' does not match declared type `(procedure
srfi-128#make-comparator ((or true (procedure :type-test: (*) boolean)) (or
true (procedure :comparison-test: (* *) boolean)) (or false (procedure
:comparison-test: (* *) boolean)) (or false (procedure :hash-function: (*)
fixnum))) (struct comparator))'

The relevant code excerpt from https://github.com/0-8-15/srfi-128
file comperators/comperators.scm:

(define-type :comparator: (struct comparator))
(define-type :type-test: (procedure (*) boolean))
(define-type :comparison-test: (procedure (* *) boolean))
(define-type :hash-code: fixnum)
(define-type :hash-function: (procedure (*) :hash-code:))

(: make-comparator
((or true :type-test:)
(or true :comparison-test:)
(or false :comparison-test:)
(or false :hash-function:)
--> :comparator:))

(define (make-comparator type-test equality ordering hash)
...

How to deal with this?

Thanks

/Jörg
Evan Hanson
2018-08-24 17:35:09 UTC
Permalink
Hi Jörg,

Thanks for reporting this problem. You might have already noticed, but
this will be fixed in RC 2.

Best,

Evan

Loading...