
How can I enable logging at a certain level with raco test
? I can do racket -W "debug@foo" ...
however this is not available in raco test
. Any suggestions?

@sjaniska has joined the channel

@pocmatos One option is to set PLTSTDERR
: env PLTSTDERR="debug@foo" raco test ....
. Another option is is to run raco test
as racket -W "debug@foo" -l- raco test ....
. The second option is less contagious if the tested program starts new processes, which is good or bad, depending.

@mflatt Thanks. For me it seems the first option is cleaner.


QUESTION
How do I find the path of current the module, regardless of whether it’s being require
d by another module or not?
USE CASE
I’m working on a project in which there’s an executable called from Racket:
.
├── my-executable
├── run-my-executable.rkt
└── directory
└── another-module.rkt
;; run-my-executable.rkt
#lang racket
(system* "my-executable")
;; directory/another-module.rkt
#lang racket
(require "../run-my-executable.rkt")
When I run run-my-executable.rkt
, it find my-executable
and everything works. But when I run directory/another-module.rkt
, it fails to find my-executable
, for it not being in directory
. I wish to solve this problem by modifying run-my-executable.rkt
so that it provides an absolute path to my-executable
, but I believe that requires me to find where run-my-executable.rkt
itself lives.
NON-SOLUTION
The current-directory
parameter gives me the current working directory, which is different if running run-my-executable.rkt
directly or by require
ing it from directory/another-module.rkt
.
WORKAROUND
I found a Stack Overflow answer 1 that mentions the following code:
(variable-reference->module-path-index (#%variable-reference))
This is halfway there, but it seems like overkill for my use case.

@leafac I think you want define-runtime-path

Any objections to merging racket7
to racket
at 1:30pm MST today (= 20:30 GMT)? In case anyone is missing context: https://groups.google.com/d/msg/racket-dev/KXBAIJsfDuE/WztXWZctAgAJ

@mflatt no objections from me

o damn

@mflatt Thank you for your answer, that’s exactly what I needed. I changed run-my-executable.rkt
to the following and it’s working:
;; run-my-executable.rkt
#lang racket
(require racket/runtime-path)
(define-runtime-path my-executable "my-executable")
(system* my-executable)

Throughout the years, i have always been very impressed by the racket team’s ability to keep making major changes to things

when if first started paying attention this was mostly rewriting c++ code in racket

@mflatt: Fine by me.

looking forward to the future

@mflatt sounds good. I probably won’t have my PR ready by then, but I’ll just make it against the main repo.

@mflatt i’m just about to start learning Racket, but i’m thrilled about racket7 —> racket merge! :moneybag:

@leafac If that worked for you would you mind adding it as an answer to the SO question?

(So that there is a (more) permanent archive of that question)

@ryanc Is this adding ??
and ?@
to the syntax
macro?


@leafac Great, thanks.

If you have an existing checkout of the racket
repo: the makefiles aren’t good enough to deal with the change, so you’ll need to either drop the old “racket/src/build” directory or delete “module.o” (probably both of them), “libracket.a”, and “libracket3m.a”

@mflatt COol, thanks for the heads up. Have you pushed?

Yes, 43 minutes ago

thanks

Building. :)

@mflatt other than https://groups.google.com/forum/#!topic/racket-dev/9AhG12ITQII and the comments in the repo itself, is there any additional documentation about linklet
such as papers or reports?

@abmclin There’s a new section in the Reference (14.13), but nothing else so far

ok thanks

Hello, I made a thing I’d like to share.

After some time with Redex, I’ve decided it’s a little too opinionated for some things I want to do, and not quite powerful enough for others.

To help with the former, I’ve ade a little reader extension for $...$
math notation, which is clean enough for me to actually read my research, even if I can’t quite run it (yet).


This is enough to keep me in Scribble instead of reaching for LaTeX while modeling.

I’d like the output to be cleaner, which means a better (than yacc) parser. By “better,” I mean easier to define/understand. Any recommendations?

@dedbox that is super neat and I wonder if turnstile
could benefit from it in some way

the $...$
notation reminds me of some of the Beautiful Racket dsls, did you use that for implementation guidance?

haven’t seen it yet

It’s just the standard LaTeX syntax

The lang
parts are mostly copied and pasted from the Racket Guide and some examples in the racket repo

It’s not compiling on raco setup
yet and I’m not sure why. The scribble
command line works, though.

turnstile looks interesting