senlin.yi
2019-7-25 08:24:55

@senlin.yi has joined the channel



pocmatos
2019-7-25 12:53:42

@soegaard2 interesting, never heard of the author though.


pocmatos
2019-7-25 12:55:58

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?


mflatt
2019-7-25 13:00:06

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.


pocmatos
2019-7-25 13:00:57

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.


pocmatos
2019-7-25 13:05:31

@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.


soegaard2
2019-7-25 13:07:37

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


pocmatos
2019-7-25 13:14:24

@soegaard2 thanks


pocmatos
2019-7-25 13:14:58

@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


pocmatos
2019-7-25 13:15:12

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


mflatt
2019-7-25 13:18:53

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


pocmatos
2019-7-25 13:27:19

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.


xinhuang.abc
2019-7-25 15:28:58

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


xinhuang.abc
2019-7-25 15:30:33

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


notjack
2019-7-25 17:02:52

Working on transducers. How does this look?

&gt; (transduce (in-range 1 20)
             (filtering prime?)
             (mapping number-&gt;string)
             #:into (join-into-string ", "))
"2, 3, 5, 7, 11, 13, 17, 19"

soegaard2
2019-7-25 17:14:56

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


notjack
2019-7-25 17:18:09

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.


soegaard2
2019-7-25 17:18:47

It’s very readable though.


notjack
2019-7-25 17:19:55

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.


badkins
2019-7-25 18:43:58

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


badkins
2019-7-25 18:44:26

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


notjack
2019-7-25 18:53:42

@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.


badkins
2019-7-25 18:54:15

gotcha - thx


nyakov13
2019-7-25 23:35:38

@nyakov13 has joined the channel