Custom Query (1630 matches)
Results (31 - 33 of 1630)
Ticket | Resolution | Summary | Owner | Reporter |
---|---|---|---|---|
#847 | fixed | ##sys#foreign-pointer-argument is declared to accept a pointer only, but is possibly invoked with a boolean | ||
Description |
When you use let-location or define-foreign-variable and declare a pointer type, you can set it to a NULL value by setting it to #f in Scheme and this works correctly. However, the scrutinizer thinks that's bad: $ cat test.scm (define-foreign-variable bar c-pointer) (set! bar #f) (let-location ((x c-pointer #f)) ((foreign-lambda void "printf" c-string c-pointer) "%p\n" x)) $ csc -scrutinize test.scm Warning: at toplevel: (test.scm:3) in procedure call to `##sys#foreign-pointer-argument', expected argument #1 of type `pointer', but was given an argument of type `boolean' Warning: at toplevel: (test.scm:5) in procedure call to `##sys#foreign-pointer-argument', expected argument #1 of type `pointer', but was given an argument of type `boolean'
The underlying problem is that We could do a few things here:
1) Add a I don't know which option I like most (or dislike least). 7 is definitely the most "thorough" option, similar to the special handling of null, pair and list(-of) types, but it raises the complexity of the scrutinizer another notch. Other acceptable solutions would probably either be 3 or 6, which both basically come down to the same thing. I think whatever we do, we should probably postpone it until after the next release unless someone comes up with a clever, noninvasive alternative of course :) |
|||
#1711 | fixed | ##sys#read with -keyword-style prefix transforms bare colon into empty symbol | ||
Description |
##sys#read recognizes prefix keywords by ignoring the leading colon and suffix keywords by consuming the trailing colon and then dropping it upon confirming it's the last token in an identifier. I added another case that adds the colon back in the prefix case if no tokens follow the main purpose of this is to allow : from chicken.type to be used in prefix mode. presently it is a syntax error also I fix a silly case where multiple colons would be dropped for prefix keywords, matching the suffix behavior where one is semantically meaningful and the rest go on the identifier tested on PLATFORM=linux. code block below shows 5.2.0 behavior with prefix, patched behavior with prefix, and suffix behavior for comparison (which is unchanged between versions) alice@bellona:~/work/misc/typetest % cat src/typetest.scm (define prefix :pre) (define suffix suf:) (define canonical #:can) (define blank :) (define qpre :|qpre|) (define qsuf |qsuf|:) (define qpreblank :||) (define qsufblank ||:) (define triplepre :::tp) (define triplesuf ts:::) (: typesig fixnum) (define typesig 1) alice@bellona:~/work/misc/typetest % ( chicken src/typetest.scm -keyword-style prefix -check-syntax -debug 1 | grep -v '^$' > /dev/tty ) > & /dev/null [source] (define prefix #:pre) (define suffix |suf:|) (define canonical #:can) (define blank ||) (define qpre #:qpre) (define qsuf |qsuf:|) (define qpreblank #:||) (define qsufblank :) (define triplepre #:tp) (define triplesuf |ts:::|) (|| typesig fixnum) (define typesig 1) alice@bellona:~/work/misc/typetest % ( dev-chicken src/typetest.scm -keyword-style prefix -check-syntax -debug 1 | grep -v '^$' > /dev/tty ) > & /dev/null [source] (define prefix #:pre) (define suffix |suf:|) (define canonical #:can) (define blank :) (define qpre #:qpre) (define qsuf |qsuf:|) (define qpreblank #:||) (define qsufblank :) (define triplepre #:|::tp|) (define triplesuf |ts:::|) (: typesig fixnum) (define typesig 1) alice@bellona:~/work/misc/typetest % ( dev-chicken src/typetest.scm -keyword-style suffix -check-syntax -debug 1 | grep -v '^$' > /dev/tty ) > & /dev/null [source] (define prefix |:pre|) (define suffix #:suf) (define canonical #:can) (define blank :) (define qpre |:qpre|) (define qsuf #:qsuf) (define qpreblank :) (define qsufblank #:||) (define triplepre |:::tp|) (define triplesuf #:|ts::|) (: typesig fixnum) (define typesig 1) |
|||
#674 | fixed | ##sys#string->number gets called without prefixes in the reader | ||
Description |
Chicken core's reader calls ##sys#string->number on the number without the radix&exactness prefix. This causes issues when for example you're reading something like the following: "#e1e500". The reader passes on "1.0e500" and then converts it to an exact number using inexact->exact, but that fails because flonums can't represent a number that large. I know it's probably a bit of an edge case, but this is more convenient input syntax than typing a 1 followed by 500 zeroes, which AFAIK is the only other way to enter an exact number like that. Another approach would be to do like I now do in numbers trunk itself; string->number first analyses the prefix like Chicken core does, and then passes the radix *and* an extra argument indicating whether to force exactness (or inexactness?) to the procedure that handles the actual number parsing. This would be an easier fix, but I think this can't be done in a backwards-compatible way. |