ben
2018-5-1 15:26:25

is there an API for raco setup --clean?


lexi.lambda
2018-5-1 15:27:50

@ben there’s setup from setup/setup, which has a #:clean? keyword argument http://docs.racket-lang.org/raco/setup-plt-plt.html#%28def._%28%28lib._setup%2Fsetup..rkt%29._setup%29%29


dedbox
2018-5-1 16:44:53

I have a simple reader extension that wraps a !-prefixed datum in an esc call. For example, !5 becomes (esc 5) and !(+ 1 !2) becomes (esc (+ 1 (esc 2))). Can I make the reader extension active only inside a particular macro?


lexi.lambda
2018-5-1 16:45:48

Not directly. The reader runs prior to macroexpansion, so it knows nothing about which macros are which.


lexi.lambda
2018-5-1 16:46:21

What you could do is make the reader produce code that only has meaning within a particular macro.


laurent.orseau
2018-5-1 16:46:29

+1 for a raco setup --clean


lexi.lambda
2018-5-1 16:46:53

@laurent.orseau There is a raco setup --clean. @ben was just asking if there was an API to it.


laurent.orseau
2018-5-1 16:47:03

right, sorry for the noise :smile:


dedbox
2018-5-1 16:47:41

Got it


leif
2018-5-1 17:43:19

If you need an example you can check out my #editor to #%editor reader extension.


dedbox
2018-5-1 19:03:10

I have a function (define (bind f . Vs) (replace-evt (bind-args Vs) f)) How do I write a contract for f? The contracts (-> any/c ... evt?) and (->* () #:rest any/c evt?) give me this error: bind: contract violation expected: a procedure that accepts 0 non-keyword arguments and arbitrarily many more given: #<procedure> accepts: 2 arguments on input (sync (bind (λ (x y) (pure (+ x y))) (pure 1) (pure 2)))


samth
2018-5-1 19:04:55

those contracts both say that they accept any number of arguments


samth
2018-5-1 19:05:14

whereas (lambda (x y) ...) accepts exactly 2


samth
2018-5-1 19:05:27

you might want unconstrained-domain


dedbox
2018-5-1 19:06:20

unonstrained-doman-> will do. Thanks!


dedbox
2018-5-1 19:06:49

I’d really like to say f takes as many arguments as there are elements of Vs


lexi.lambda
2018-5-1 19:07:52

you could probably do that with dynamic->* and i->, but it might be pretty slow


dedbox
2018-5-1 19:12:22

dynamic->* seems capable of exactly what I’d like. How might performance be affected?


dedbox
2018-5-1 19:14:15

I guess I’m just wondering if it’s fundamentally XX-times slower than ->*and not worth the trouble


lexi.lambda
2018-5-1 19:14:48

I don’t know. The docs are pretty handwavy about performance, so you probably can’t really know without profiling.


lexi.lambda
2018-5-1 19:15:24

It doesn’t seem fundamentally super slow, though, given that the docs state: > For many uses, dynamic->*’s result is slower than ->* (or ->), but for some it has comparable speed.


lexi.lambda
2018-5-1 19:16:18

->i contracts also tend to be expensive, though, so who knows.


dedbox
2018-5-1 19:17:17

Ok thanks.


leif
2018-5-1 19:37:21

@samth Odd. So it looks like gracket (on ubuntu 16.04) sets the application-file-handler parameter to void.


leif
2018-5-1 19:37:30

That might be why its not working.


pocmatos
2018-5-1 21:24:26

@leif just noticed you are/were involved with the port of the nanopass framework for Racket. What’s the status? Is this stable? Do you know of any project that has used the racket port?


pocmatos
2018-5-1 21:24:40

This is a very exciting project!


leif
2018-5-1 21:24:56

@pocmatos Yes it is stable.


leif
2018-5-1 21:25:11

IIRC, @soegaard2’s urlang uses it.


leif
2018-5-1 21:25:56

I was working on a racket compiler for a while, but I haven’t touched it for two years or so now.


leif
2018-5-1 21:26:16

There are also many scheme to c toy compilers you can look at for examples.


soegaard2
2018-5-1 21:29:18

Yes. Urlang uses nanopass.


githree
2018-5-1 21:58:47

@pocmatos another project using nanopass is css-expr: https://docs.racket-lang.org/css-expr/


githree
2018-5-1 21:58:53

pocmatos
2018-5-2 06:21:21

thanks for the refs @leif @soegaard2 @githree


pocmatos
2018-5-2 06:21:28

@leif racket compiler? +1


pocmatos
2018-5-2 06:51:27

With raco pkg config --set catalogs I can set the catalogs but how can I check which ones are set? I initially expected something like raco pkg config --get catalogs but --get does not exist.