
@senlin.yi has joined the channel


@soegaard2 interesting, never heard of the author though.

I can’t remember how to build packages for an old git version of racket. For example, if I get a git sha, build it and do a raco pkg install --auto mongodb
, I get stuck in: Using cached15640584891564058489524 for <git://github.com/racket/typed-racket/?path=source-syntax>
raco pkg install: version mismatch for dependency
for package: typed-racket-lib
mismatch packages:
base (have 7.1.0.2, need 7.3.0.11)
I remember I had problems some time ago and sorted it with some sort of incantation. Does anybody know what I am missing here?

You could try --catalog <https://download.racket-lang.org/releases/7.1/catalog/>
. There just isn’t a more general record of which package checksums were around for a given commit in the main repo.

That’s an annoying problem with bisecting… not insurmountable though but it means that when I bisect automatically, I need to determine the right catalog for the current sha.

@soegaard2 the book is not being sold on http://amazon.de\|amazon.de, not even a mention of it. Strange given it’s a german book.

@pocmatos Found it on http://amazon.com\|amazon.com. It is listed on the books page on http://racket-lang.org\|racket-lang.org

@soegaard2 thanks

@mflatt unfortunately, it doesn’t work. I end up with: raco test: "/root/.racket/7.1.0.2/pkgs/mongodb/db/mongodb/info.rkt"
read (compiled): wrong version for compiled code
compiled version: 7.1
expected version: 7.1.0.2
in: .racket/7.1.0.2/pkgs/scribble-lib/scribble/doc/lang/compiled/reader_rkt.zo

So although installation went find, read
doesn’t like ti.

Not sure why that didn’t get rebuilt in the raco setup
phase. Maybe adding --source
would help, or maybe that creates other problems.

I was doing racket pkg install --auto --no-setup mongodb
and then raco setup -D
, in order to speed up bisect to avoid documentation building. Maybe that affected it.

@philip.mcgrath Thanks! Didn’t see that one.

Please add the example. The FFI documents can use some more examples. It is a little difficult to understand.

Working on transducers. How does this look?
> (transduce (in-range 1 20)
(filtering prime?)
(mapping number->string)
#:into (join-into-string ", "))
"2, 3, 5, 7, 11, 13, 17, 19"

How fast is it compared to (for/list …) ?

Likely slower. transduce
is a regular function and does no special compile-time work to avoid generics dispatch. And performance aside, transducers are meant to be used alongside for loops, not replace them entirely.

It’s very readable though.

Transducers are most appropriate when working with streams that are far too large to keep in memory. Each transducer usually only needs a constant amount of space.

@notjack why filtering
vs. filter
and mapping
vs. map
? Does transduce
require explicit cooperation in this way?

By “explicit”, I mean that transducees need to know they’re being transduced?

@badkins filter
is a good name for a function that takes a sequence and a predicate and returns a sequence. The transduce
function doesn’t work with sequence transforming functions like that though - instead there’s an explicit transducer?
type that you have to construct instances of with make-transducer
. So filtering
is a function that takes a predicate and returns a transducer.
Clojure transducers do some sneaky things with optional arguments to make map
/ filter
/ etc. double as transducer constructors, but I find that more confusing to read. And especially more confusing to document.

gotcha - thx

@nyakov13 has joined the channel