chicken-janitors
[Top][All Lists]
Advanced

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

#1711: ##sys#read with -keyword-style prefix transforms bare colon into


From: Chicken Trac
Subject: #1711: ##sys#read with -keyword-style prefix transforms bare colon into empty symbol
Date: Wed, 05 Aug 2020 05:50:10 -0000

#1711: ##sys#read with -keyword-style prefix transforms bare colon into empty
symbol
---------------------------------+----------------------------
            Reporter:  alicemaz  |       Type:  defect
              Status:  new       |   Priority:  minor
           Milestone:  someday   |  Component:  core libraries
             Version:  5.2.0     |   Keywords:
Estimated difficulty:  easy      |
---------------------------------+----------------------------
 ##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)
 }}}

-- 
Ticket URL: <https://bugs.call-cc.org/ticket/1711>
CHICKEN Scheme <https://www.call-cc.org/>
CHICKEN Scheme is a compiler for the Scheme programming language.

reply via email to

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