
is there an API for raco setup --clean
?

@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

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?

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

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

+1 for a raco setup --clean

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

right, sorry for the noise :smile:

Got it

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

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)))

those contracts both say that they accept any number of arguments

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

you might want unconstrained-domain

unonstrained-doman->
will do. Thanks!

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

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

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

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

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

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.

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

Ok thanks.

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

That might be why its not working.

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

This is a very exciting project!

@pocmatos Yes it is stable.

IIRC, @soegaard2’s urlang uses it.

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

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

Yes. Urlang uses nanopass.

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


thanks for the refs @leif @soegaard2 @githree

@leif racket compiler? +1

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.