
DrRacket / Quickscript competition. @spdegabrielle
To learn quickscript, i started with this example from the quickscript docs (https://docs.racket-lang.org/quickscript/index.html)
(define-script reverse
#:label "Reverse"
(λ (selection)
(list->string (reverse (string->list selection)))))
After selecting some text and choosing the script, DrRacket gives me the following error in a message box.
Error in script file "/Users/X/Library/Preferences/quickscript/user-scripts/reverse.rkt":
string->list: contract violation
expected: string?
given: '(#\q #\u #\i #\c #\k #\s #\c #\r #\i #\p #\t)
In the REPL everything works fine.
> (list->string (reverse (string->list "quickscript")))
"tpircskciuq"
Can please someone check, if it is a bug?
(DrRacket 7.7, macOS Catalina)

Use (define-script reverse-selection
instead of (define-script reverse

Its a bug in the docs, it has been fixed but this will appear in the next version. The problem is that reverse
is a reserved word of course :)

I see. :-) Thank you for the hint.

Thanks for the tips. I checked out hub
it looks promising,

They have a new command line tool called gh
but it’s less of a straight git replacement

tcp-connect: connection failed;
host not found
address: <http://www.reddit.com\|www.reddit.com>
port number: 443
system error: Name or service not known; gai_err=-2
anyone can help me with this error I can curl and ping reddit just fine

I get the following error when I try to build CS on Windows (nmake win32-cs
):
error: format string requires 0 arguments, given 1; arguments were: '\|{meta-parse-Rhs unique95301}\| "unrecognized pattern or template" '#s((\|{syntax-object bdehkef6almh6ypb-a}\| #(0 1)) (mref ,%sp ,%zero 4) ((#f . #0=(...
context...:
{meta-parse-Effect unique95497}
{chi-macro unique21740}
{syntax-type unique21739}
{parse unique23441}
{chi-body unique24044}
{chi-frobs unique22556}
{chi-body unique24044}
C:\Users\User\Source\Repos\racket\racket\collects\racket\private\map.rkt:40:19: loop
{chi-expr unique23225}
{chi-frobs unique22556}
{chi-body unique24044}
{chi-frobs unique22556}
{chi-body unique24044}
{maplr unique23178}
[repeats 176 more times]
{chi-frobs unique22556}
...
(this is on one of Microsoft’s Developer VMs running Windows 10, with the latest VS 2019, though I don’t think that matters in this case)

BC builds just fine and I can build the CS version on macOS from the same commit.

Looks like a DNS resolution issue. What happens if you run dig <http://www.reddit.com\|www.reddit.com>
from the command line?

This gets printed right after
Load <http://cpcommonize.ss\|cpcommonize.ss>
Load <http://cpnanopass.ss\|cpnanopass.ss>

Ah, I didn’t notice your note about curl the first time. I believe this can also happen when the process runs out of file descriptors.

(for/list ([i (in-range 100000)])
(define-values (in out)
(tcp-connect "<http://www.reddit.com\|www.reddit.com>" 443))
(displayln i)
(list in out))
This reproduces the failure on my machine and it fails right around the 250th iteration. On macOS, the default limit for open FDs is 256.

I don’t have a good guess, yet. What commits do you have for your racket
checkout and racket/racket/src/build/ChezScheme
checkout?

The latest one from racket/racket
is 497bb25917
and for ChezScheme
it’s 0f3ff69d4247ec695087953892839d680ed32fff
.

ok thanks I’ve restarted Dr.Racket to see if that changes anything

You’re probably going to have to make sure your code closes any ports it’s done with or, if you’re writing a crawler and you want to be able to crawl many pages concurrently, you might want to adjust the limit to some higher value (assuming you are on macOS, I think the limits on Linux are higher by default).

And this is 64-bit Windows?

Yes

I see that error when I try to build 32-bit Windows, so I can fix it. Meanwhile, maybe you’ve accidentally selected the 32-bit compiler on Windows when you wanted the 64-bit compiler?

It’s definitely possible. Let me check

Yep, it looks like I’ve been running the x86 version of nmake
all along, which I assume means my env vars are set up to point to the 32 bit versions of everything.

Yup. I hadn’t run mscvprep.bat x86_amd64
so it must’ve defaulted to the vars for x86
.

Now fixed for 32-bit Windows. Thanks for the report!

Thanks! Also, it looks like msvcprep
doesn’t work in Power Shell because vcvarsall
doesn’t work in PS. Should I add a note to the README in worksp
about that?

Sure, unless you know a reasonably simple way of making it work.

This is a weird one. On DrRacket 7.7(BC) Windows 10, open the “Package Manager”, click on “Currently Installed”, scroll down with the scroll wheel stops scrolling about 1/5 through the list. Manually moving the scroll control and you can continue to scroll with the scroll wheel, but if you scroll all the way back to the top it won’t let you use the wheel to scroll down again. Anyone seen this behavior before?