samdphillips
2019-10-2 18:26:39

What is the reason why https://github.com/racket/racket/blob/master/racket/collects/pkg/private/new.rkt doesn’t use #lang at-exp racket/base ?


notjack
2019-10-2 20:02:09

@samdphillips are you asking because of that “Because I wish I had @-expressions” comment? https://github.com/racket/racket/blob/master/racket/collects/pkg/private/new.rkt#L42


samdphillips
2019-10-2 20:13:51

That and there is a lot of inline text in the file.


notjack
2019-10-2 20:19:59

Maybe it’s so it will work in minimal racket?


samdphillips
2019-10-2 21:25:05

I thought it may be for some bootstrapping reason, but that makes even more sense.


mflatt
2019-10-2 21:30:03

Right: at-exp is in a package right now, and nothing in “collects” can depend on a package.


capfredf
2019-10-3 00:26:16

Hi, All. Is there a mutable version of for/hash?


capfredf
2019-10-3 00:28:06

Sorry, I didn’t make myself clear.


sorawee
2019-10-3 00:28:32

There’s one called for/hash! in someone’s package


notjack
2019-10-3 00:28:44

As in, something like for/mutable-hash that does the same thing as for/hash but returns a mutable hash?



sorawee
2019-10-3 00:29:04

But no, there’s no built-in for/hash!


capfredf
2019-10-3 00:29:15

I mean what is the equivalent to for/hash that returns mutable hash tables?


notjack
2019-10-3 00:29:55

There isn’t an equivalent built-in to racket. You can make your own for/xxx forms using a library I wrote though.


jaz
2019-10-3 00:29:56

for/fold with a mutable hash accumulator


sorawee
2019-10-3 00:30:24

I mean, do you really need an accumulator?


sorawee
2019-10-3 00:30:35

You can just use for.


jaz
2019-10-3 00:30:37

Or just for


jaz
2019-10-3 00:30:41

Yup


notjack
2019-10-3 00:34:03

this was a fun exercise: (require rebellion/collection/entry rebellion/streaming/reducer) (define (hash-set-entry! h e) (hash-set! h (entry-key e) (entry-value e)) h) (define into-mutable-hash (make-effectful-fold-reducer make-hash hash-set-entry! values)) (define-syntaxes (for/mutable-hash for*/mutable-hash) (make-reducer-based-for-comprehensions #'into-mutable-hash)) (for/mutable-hash ([...]) ...)


notjack
2019-10-3 00:34:42

note: requires the for loop to return an (entry k v) struct in the loop body rather than (values k v)


sorawee
2019-10-3 00:35:35

That’s so much better, actually. I think for should support splicing out, and that really should be implemented by values


sorawee
2019-10-3 00:36:18
(for/list ([i 5]) (values i (add1 1)))

produces

'(0 1 1 2 2 3 3 4 4 5)

sorawee
2019-10-3 00:36:44

But with the way values is used right now (e.g., for for/hash), it’s not possible to do that


notjack
2019-10-3 00:37:14

@sorawee oh that’s a neat idea, I hadn’t thought of using values like that


notjack
2019-10-3 00:37:46

would it only be for values or would it be for arbitrary sequences?


sorawee
2019-10-3 00:37:58

I’d say only values


sorawee
2019-10-3 00:38:07

because you might want to produce a list of list of stuff


notjack
2019-10-3 00:38:08

arbitrary sequences would mean it would be ambiguous if you mean (list a a b b) or (list (a a) (b b)) I think


sorawee
2019-10-3 00:38:14

Yes


notjack
2019-10-3 00:38:41

would it be acceptable if instead of this being built into for or for*, you had to use a variant of for?


notjack
2019-10-3 00:38:54

because I think you could do this with for/reducer


sorawee
2019-10-3 00:39:35

Wow, that’s cool


sorawee
2019-10-3 00:39:45

I still wish for a built-in support tho


notjack
2019-10-3 00:39:47

thanks :D it was very fun to make


notjack
2019-10-3 00:39:49

me too


stephen
2019-10-3 01:38:34

Hi. Does anyone know if the Racket package server is having issues? It keeps saying “This package has been modified since the package index was last rebuilt. The next index refresh is scheduled for _____”, but the scheduled time keeps moving forward.


winny
2019-10-3 05:16:36

Last time I tried to make sense of when builds actually occur, I had given up because it was hours, maybe tens of hours, between a detected change on my package (git push) until the changes were available on the catalog. I wasn’t able to establish a pattern. So I am also interested how this works. :)


laurent.orseau
2019-10-3 06:47:03

@stephen does it still update anyway? Maybe it’s just that you’re triggering a new refresh each time you look it up?


popa.bogdanp
2019-10-3 06:48:16

I’ve noticed this as well. No changes to any of my packages have been picked up by the package index in the last couple of days. The last-updated build information for some of the packages is out of sync with the build server, also.

For example, the index says deta-test has failing tests:

https://pkgd.racket-lang.org/pkgn/package/deta-test

but pkg-build reports no test failures:

https://pkg-build.racket-lang.org/server/built/test-success/deta-test.txt


popa.bogdanp
2019-10-3 06:48:55

I think the internal state of the index is currently messed up.


popa.bogdanp
2019-10-3 06:50:39

@winny the package index refreshes every 5 minutes and detects modified packages. Package builds run once a day and they entail rebuilding any modified packages up to that point. Package builds can take a long time because there are usually quite a few packages that need building.


popa.bogdanp
2019-10-3 06:51:21

cc @jeapostrophe