pocmatos
2018-2-26 08:40:09

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
2018-2-26 10:31:59

@sjaniska has joined the channel


mflatt
2018-2-26 12:43:02

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


pocmatos
2018-2-26 14:10:03

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



leafac
2018-2-26 16:25:39

QUESTION

How do I find the path of current the module, regardless of whether it’s being required 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 requireing 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.


mflatt
2018-2-26 16:26:59

@leafac I think you want define-runtime-path


mflatt
2018-2-26 16:29:16

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


abmclin
2018-2-26 16:29:41

@mflatt no objections from me


joelmccracken
2018-2-26 16:30:31

o damn


leafac
2018-2-26 16:33:22

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

joelmccracken
2018-2-26 16:35:37

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


joelmccracken
2018-2-26 16:36:01

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


stamourv
2018-2-26 16:36:24

@mflatt: Fine by me.


gknauth
2018-2-26 16:36:35

looking forward to the future


ryanc
2018-2-26 16:44:00

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


sjaniska
2018-2-26 18:17:15

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


leif
2018-2-26 18:47:42

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


leif
2018-2-26 18:47:54

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


leif
2018-2-26 18:49:09

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



leif
2018-2-26 20:18:11

@leafac Great, thanks.


mflatt
2018-2-26 20:31:27

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”


leif
2018-2-26 21:13:05

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


mflatt
2018-2-26 21:13:22

Yes, 43 minutes ago


leif
2018-2-26 21:13:53

thanks


stamourv
2018-2-26 21:15:53

Building. :)


abmclin
2018-2-26 21:22:39

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


mflatt
2018-2-26 21:39:47

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


abmclin
2018-2-26 21:40:20

ok thanks


dedbox
2018-2-26 22:54:51

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


dedbox
2018-2-26 22:55:12

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.


dedbox
2018-2-26 22:55:47

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



dedbox
2018-2-26 22:56:23

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


dedbox
2018-2-26 22:58:09

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?


notjack
2018-2-27 05:47:26

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


notjack
2018-2-27 05:49:02

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


dedbox
2018-2-27 06:20:42

haven’t seen it yet


dedbox
2018-2-27 06:21:07

It’s just the standard LaTeX syntax


dedbox
2018-2-27 06:22:33

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


dedbox
2018-2-27 06:23:45

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


dedbox
2018-2-27 06:27:37

turnstile looks interesting