kellysmith12.21
2020-10-15 11:19:59

I’m writing documentation for a module, and Scribble is throwing long warnings about WARNING: collected information for key multiple times: ... . Oddly, the warning only appears if there is more than one defproc in the file.


soegaard2
2020-10-15 11:22:35

I think it means you defproc the same function twice.


kellysmith12.21
2020-10-15 11:29:34

Oh, I see what the problem is: I defproc a predicate that was implicitly covered by defstruct*.


soegaard2
2020-10-15 11:31:54

I have a similar problem. I wonder whether Unless link-target?-expr is specified and produces #f, the id is indexed, and it also registered so that racket-typeset uses of the identifier (with the same for-label binding) are hyperlinked to this documentation. means that using #:link-target? _#f_ avoids the problem?


kellysmith12.21
2020-10-15 11:59:39

In my case, yes, using #:link-target? #f fixes it.


anything
2020-10-15 14:14:57

Quick check. BC means “Before Chez [Scheme]”, right?


laurent.orseau
2020-10-15 14:18:06

This question should be in some FAQ :wink: @spdegabrielle


laurent.orseau
2020-10-15 14:18:08

yes


anything
2020-10-15 14:22:12

First I considered for/fold because I was going to build a string, but then I didn’t know how to tell for/fold to scan an input string two characters at a time. So I went for a named let and this is the result. Feel free to educate me or make any comments. Thank you! (The procedure decodes a hex-string produced by a cloudflare Javascript library for e-mail address obfuscation. They key to do the decoding is the first byte of the string.)

(define (cloudflare-email-decode hex-string) (define k (string-&gt;number (substring hex-string 0 2) 16)) (define (loop hx-str decoded-str) (cond [(empty-string? hx-str) decoded-str] [else (define b (string-&gt;number (substring hx-str 0 2) 16)) (define d (string (integer-&gt;char (bitwise-xor k b)))) (loop (substring hx-str 2) (string-append decoded-str d))])) (loop (substring hex-string 2) "")) racket@zip.rkt&gt; (cloudflare-email-decode "d8b0beb0b3bbb7b098bbbdb6acadaaa1b4b1b6b3f6b6bdac") "<mailto:hfhkcoh@centurylink.net\|hfhkcoh@centurylink.net>" (~Is it only me or this block code in Slack could use a better font?~ That looks better. Thanks, Laurent!)


spdegabrielle
2020-10-15 14:25:48

@laurent.orseau @anything I’ve added it to the FAQ, with a link to the relevant page in the Racket Guide (Performance>VM implementations): https://github.com/racket/racket/wiki/Frequently-Asked-Questions


laurent.orseau
2020-10-15 14:26:45

How about a link to the FAQ and the guide/reference in the topic of this channel?


laurent.orseau
2020-10-15 14:34:22

if you want syntax coloring + evaluation, you can use http://pasterack.org\|pasterack.org. This is a paste of your code above: http://pasterack.org/pastes/3106


spdegabrielle
2020-10-15 14:40:53

@spdegabrielle set the channel topic: A good place to ask questions https://github.com/racket/racket/wiki/Frequently-Asked-Questions


spdegabrielle
2020-10-15 14:41:24

spdegabrielle
2020-10-15 14:42:30

good idea, done free tier of slack so will go in a month or two


laurent.orseau
2020-10-15 14:48:37

oh, annoying


spdegabrielle
2020-10-15 14:49:15

I think I’m wrong actually - the quickscript announce is still pinned to #general


spdegabrielle
2020-10-15 14:49:40

have you looked at the FAQ?


laurent.orseau
2020-10-15 14:49:57

@laurent.orseau set the channel topic: A good place to ask questions FAQ


laurent.orseau
2020-10-15 14:50:21

@laurent.orseau set the channel topic: A good place to ask questions. FAQ: https://github.com/racket/racket/wiki/Frequently-Asked-Questions


laurent.orseau
2020-10-15 14:50:42

I had


spdegabrielle
2020-10-15 14:51:22

good- I trust you would tell me if I made any mistakes :)


laurent.orseau
2020-10-15 14:51:27

Glad to be featured ^^


spdegabrielle
2020-10-15 14:52:21

ahh the gui builder question!


laurent.orseau
2020-10-15 14:52:33

Looks good. Though the link to Fast Racket doesn’t really answer the question “how fast is racket?”


spdegabrielle
2020-10-15 14:52:39

I also need to put a bit about quickscript about it


laurent.orseau
2020-10-15 14:52:54

do you?


spdegabrielle
2020-10-15 14:53:17

racketeers


laurent.orseau
2020-10-15 14:53:49

I mean, is a bit on quickscript needed in the FAQ?


spdegabrielle
2020-10-15 14:58:15

yes- racketeers know about it. but new people who need a FAQ don’t know about it


spdegabrielle
2020-10-15 14:58:41

It has a brief mention in the problematic DrRacket guide


samdphillips
2020-10-15 15:37:22

This was my first go at it: (define (cloudflare-email-decode hex-string) (define (decode-hex i) (string-&gt;number (substring hex-string i (+ i 2)) 16)) (define len (string-length hex-string)) (define key (decode-hex 0)) (list-&gt;string (for/list ([i (in-range 2 len 2)]) (integer-&gt;char (bitwise-xor key (decode-hex i))))))


samdphillips
2020-10-15 15:38:06

Here’s a version hiding the indexing bits inside a sequence: (define (in-char-pairs s [offset 0]) (define len (string-length s)) (sequence-map (lambda (i) (substring s i (+ i 2))) (in-range offset len 2))) (define (cloudflare-email-decode hex-string) (define (decode-hex s) (string-&gt;number s 16)) (define key (decode-hex (substring hex-string 0 2))) (list-&gt;string (for/list ([s (in-char-pairs hex-string 2)]) (integer-&gt;char (bitwise-xor key (decode-hex s))))))


samth
2020-10-15 16:25:49

Also byte code


samth
2020-10-15 16:29:51

Note that for/string exists


joshibharathiramana
2020-10-15 23:58:02

how can I enable module name completion while using enter! in the repl? For instance, if I only have maybe.rkt in the current directory, I want (enter! "&lt;TAB&gt;) to complete to (enter! "maybe.rkt") . Thanks!


anything
2020-10-16 00:27:13

Very interesting versions there too, @samdphillips. Thanks for sharing!


anything
2020-10-16 00:29:48

Must I import 2htdp/abstraction to use for/string? I expected it to be in racket/base along with for/fold, for/list.


samth
2020-10-16 00:46:10

Oh odd, I thought it was in racket/base