Re: [racket-users] #:kind (list ... ) in defthing and defproc
Ah, sorry! I missed that `content?` was okay. Thanks, Matthew! Robby On Wed, Oct 7, 2020 at 8:40 AM Matthew Flatt wrote: > A recent commit added a contract on `defthing` and `defproc` to enforce > the documented constraint that `#:kind` should be a string. But the > implementation is happy with content in the sense of `content?`. > > Since it's easy to adjust the contract and documentation to restore > this capability, I'll do that, and then this example works again. > > Matthew > > At Sat, 26 Sep 2020 21:06:20 +0200, Jos Koot wrote: > > The following works well in DrRacket, version 7.8 [3m] > > > > #lang scribble/manual > > @deftogether[ > > (@defthing[#:kind "constant false/on/high" F trit? #:value '0] > > @defthing[#:kind (list "constant true/off/low" (hspace 1)) T trit? > #:value > > '1] > > @defthing[#:kind "constant indeterminate" ? trit? #:value '?] > > @defthing[#:kind (list "constant" (hspace 13)) trits (list/c trit? trit? > > trit?) #:value (list F T ?)] > > @defthing[#:kind (list "constant" (hspace 13)) in-trits sequence? > #:value > > (in-list trits)] > > @defproc[#:kind (list "predicate" (hspace 12)) (trit? (obj any/c)) > > boolean?] > > @defproc[#:kind (list "predicate" (hspace 12)) (F? (obj any/c)) > boolean?] > > @defproc[#:kind (list "predicate" (hspace 12)) (T? (obj any/c)) > boolean?] > > @defproc[#:kind (list "predicate" (hspace 12)) (?? (obj any/c)) > > boolean?])]{} > > > > I use hspace for alignment of the kinds. > > > > But in version 7.8.0.10--2020-09-25(515012525c/a) [3m] I get: > > > > . . C:\Program Files\Racket-7.8.0.10\collects\syntax\contract.rkt:101:21: > > defthing: contract violation > > expected: (or/c string? #f) > > given: ("constant true/off/low" #(struct:element hspace (" "))) > > in: (or/c string? #f) > > macro argument contract on #:kind argument > > contract from: > > (lib scribble/private/manual-proc.rkt) > > blaming: E:\circuits\circuit-manual.scrbl > >(assuming the contract is correct) > > at: E:\circuits\circuit-manual.scrbl:416.18 > > > > Because I don't know whether or not this is a known issue, I post it on > > this list. > > If this is a known issue or an intentional change, then ignore this > email, > > please. > > If not I can post it as a racket issue. > > Let me know, please. > > Thanks, Jos > > > > -- > > You received this message because you are subscribed to the Google > Groups > > "Racket Users" group. > > To unsubscribe from this group and stop receiving emails from it, send > an > > email to racket-users+unsubscr...@googlegroups.com. > > To view this discussion on the web visit > > > https://groups.google.com/d/msgid/racket-users/CAL6KNi3P251G%2BBMQqDbo2qt6K22Gw > > _OOgjjnHDboLLuC3qKrGg%40mail.gmail.com. > > -- > You received this message because you are subscribed to the Google Groups > "Racket Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to racket-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/racket-users/20201007074018.1a7%40sirmail.smtps.cs.utah.edu > . > -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/CAL3TdONrEQoOmJaQqTyftX_QONjhp5TK-RnSzN9%3Dqx1K9uhrxQ%40mail.gmail.com.
RE: [racket-users] #:kind (list ... ) in defthing and defproc
Thanks Matthew, that’s great.Jos From: Matthew FlattSent: miércoles, 7 de octubre de 2020 15:40To: Jos KootCc: Racket UsersSubject: Re: [racket-users] #:kind (list ... ) in defthing and defproc A recent commit added a contract on `defthing` and `defproc` to enforcethe documented constraint that `#:kind` should be a string. But theimplementation is happy with content in the sense of `content?`. Since it's easy to adjust the contract and documentation to restorethis capability, I'll do that, and then this example works again. Matthew -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/EE56067B-3201-410E-B1F7-66C8C0DCC059%40hxcore.ol.
Re: [racket-users] #:kind (list ... ) in defthing and defproc
A recent commit added a contract on `defthing` and `defproc` to enforce the documented constraint that `#:kind` should be a string. But the implementation is happy with content in the sense of `content?`. Since it's easy to adjust the contract and documentation to restore this capability, I'll do that, and then this example works again. Matthew At Sat, 26 Sep 2020 21:06:20 +0200, Jos Koot wrote: > The following works well in DrRacket, version 7.8 [3m] > > #lang scribble/manual > @deftogether[ > (@defthing[#:kind "constant false/on/high" F trit? #:value '0] > @defthing[#:kind (list "constant true/off/low" (hspace 1)) T trit? #:value > '1] > @defthing[#:kind "constant indeterminate" ? trit? #:value '?] > @defthing[#:kind (list "constant" (hspace 13)) trits (list/c trit? trit? > trit?) #:value (list F T ?)] > @defthing[#:kind (list "constant" (hspace 13)) in-trits sequence? #:value > (in-list trits)] > @defproc[#:kind (list "predicate" (hspace 12)) (trit? (obj any/c)) > boolean?] > @defproc[#:kind (list "predicate" (hspace 12)) (F? (obj any/c)) boolean?] > @defproc[#:kind (list "predicate" (hspace 12)) (T? (obj any/c)) boolean?] > @defproc[#:kind (list "predicate" (hspace 12)) (?? (obj any/c)) > boolean?])]{} > > I use hspace for alignment of the kinds. > > But in version 7.8.0.10--2020-09-25(515012525c/a) [3m] I get: > > . . C:\Program Files\Racket-7.8.0.10\collects\syntax\contract.rkt:101:21: > defthing: contract violation > expected: (or/c string? #f) > given: ("constant true/off/low" #(struct:element hspace (" "))) > in: (or/c string? #f) > macro argument contract on #:kind argument > contract from: > (lib scribble/private/manual-proc.rkt) > blaming: E:\circuits\circuit-manual.scrbl >(assuming the contract is correct) > at: E:\circuits\circuit-manual.scrbl:416.18 > > Because I don't know whether or not this is a known issue, I post it on > this list. > If this is a known issue or an intentional change, then ignore this email, > please. > If not I can post it as a racket issue. > Let me know, please. > Thanks, Jos > > -- > You received this message because you are subscribed to the Google Groups > "Racket Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to racket-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/racket-users/CAL6KNi3P251G%2BBMQqDbo2qt6K22Gw > _OOgjjnHDboLLuC3qKrGg%40mail.gmail.com. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/20201007074018.1a7%40sirmail.smtps.cs.utah.edu.
[racket-users] #:kind (list ... ) in defthing and defproc
The following works well in DrRacket, version 7.8 [3m] #lang scribble/manual @deftogether[ (@defthing[#:kind "constant false/on/high" F trit? #:value '0] @defthing[#:kind (list "constant true/off/low" (hspace 1)) T trit? #:value '1] @defthing[#:kind "constant indeterminate" ? trit? #:value '?] @defthing[#:kind (list "constant" (hspace 13)) trits (list/c trit? trit? trit?) #:value (list F T ?)] @defthing[#:kind (list "constant" (hspace 13)) in-trits sequence? #:value (in-list trits)] @defproc[#:kind (list "predicate" (hspace 12)) (trit? (obj any/c)) boolean?] @defproc[#:kind (list "predicate" (hspace 12)) (F? (obj any/c)) boolean?] @defproc[#:kind (list "predicate" (hspace 12)) (T? (obj any/c)) boolean?] @defproc[#:kind (list "predicate" (hspace 12)) (?? (obj any/c)) boolean?])]{} I use hspace for alignment of the kinds. But in version 7.8.0.10--2020-09-25(515012525c/a) [3m] I get: . . C:\Program Files\Racket-7.8.0.10\collects\syntax\contract.rkt:101:21: defthing: contract violation expected: (or/c string? #f) given: ("constant true/off/low" #(struct:element hspace (" "))) in: (or/c string? #f) macro argument contract on #:kind argument contract from: (lib scribble/private/manual-proc.rkt) blaming: E:\circuits\circuit-manual.scrbl (assuming the contract is correct) at: E:\circuits\circuit-manual.scrbl:416.18 Because I don't know whether or not this is a known issue, I post it on this list. If this is a known issue or an intentional change, then ignore this email, please. If not I can post it as a racket issue. Let me know, please. Thanks, Jos -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/CAL6KNi3P251G%2BBMQqDbo2qt6K22Gw_OOgjjnHDboLLuC3qKrGg%40mail.gmail.com.