greg
2018-1-22 14:18:34

Whenever I haven’t used x-exprs for a long time, I re-make that mistake at least once. ¯_(ツ)_/¯


greg
2018-1-22 14:21:26

" ’ “Quoting is hard”, he said’, he said."


abmclin
2018-1-22 20:35:13

I’ve gotten my raco tool into a bad state due to a malformed raco-commands definition in my package. As a result I’m now unable to invoke any of raco’s commands due to errors raised when it attempts to read or parse its list of available raco commands. I’m guessing the best way to get out of this situation is to manually remove the bad command from raco’s list but where to find that list?


mflatt
2018-1-22 20:52:41

@abmclin You can run racket -l setup to do the same thing as raco setup, including un-registering any raco commands that you disable by editing the “info.rkt” file


leif
2018-1-22 20:53:29

So, in the following code, I (understandably) get an unbound identifier error: https://gist.github.com/LeifAndersen/ab54e9ede832d94b6e4fc49dcb39e008


leif
2018-1-22 20:53:30

leif
2018-1-22 20:54:10

Because macro M expands to a (post)submodule, and tries to use the N macro.


leif
2018-1-22 20:55:17

Here is the problem I’m having, is there any way I could have macro M also require its source module in the one it expands to?


leif
2018-1-22 20:55:36

(So that N can be used inside M)


leif
2018-1-22 20:55:48

Ideally I would like to do this without having to install this as a collection.


mflatt
2018-1-22 20:59:01

Does this work? (define-syntax (M stx) (syntax-parse stx [(_ body ...) #:with racket/base (format-id stx "racket/base") #:with req (datum->syntax stx '(require (submod ".."))) #`(module* foo racket/base req body ...)]))


abmclin
2018-1-22 20:59:11

@mflatt thank you, those steps repaired the bad state and everything is back in working order.


leif
2018-1-22 21:01:18

That only works if I define and use M in the same module.


leif
2018-1-22 21:01:43

If I want to use M in a different module I can’t really just require that submod.


leif
2018-1-22 21:01:51

err. that module path (submod "..")


leif
2018-1-22 21:04:14

Like in say: (provide M N) (module* bar racket/base (require (submod "..")) (M (N)))


mflatt
2018-1-22 21:10:35

I see that you’re already trying syntax/location… How about this? #:with req (datum->syntax stx `(#%require ,(quote-module-path))) The use of #%require there to allow a literal path is not obvious. Probably require should allow a literal path, too.


spall
2018-1-22 21:11:55

Does anybody know the how to “clean” a racket build, so that when I do ‘make’ everything is built again?


spall
2018-1-22 21:12:33

I recall @samth telling me that just deleting the ‘build’ directories wasn’t sufficient


ben
2018-1-22 21:13:40

raco setup --clean ?


leif
2018-1-22 21:23:56

@mflatt Oh, and it looks like even if I do put a path there, Racket complains about a cycle:

#lang racket

(define foo 42)
(provide foo)

(module* foo racket
  (require "atest.rkt")
  ;(require (submod ".."))
  foo)

leif
2018-1-22 21:24:10

(As shown by this file if saved as "atest.rkt".


leif
2018-1-22 21:24:26

Changing the req to (submod "..") causes it to load just fine. :confused:


abmclin
2018-1-22 21:26:40

I think @spall meant compiling racket itself, git clean may do what you need, though be warned, it will remove any untracked files


abmclin
2018-1-22 21:27:23

think I’ve seen a clean rule somewhere in the Makefile but don’t know if that’s sufficient.


spall
2018-1-22 21:28:15

Yes, I did mean racket itself.


leif
2018-1-22 21:28:41

@spall Do git clean -fxd


leif
2018-1-22 21:28:54

It will delete EVERYTHING in your git repo that is not committed.


leif
2018-1-22 21:29:03

As if you just made a fresh checkout.


leif
2018-1-22 21:29:06

Then, you can just make.


leif
2018-1-22 21:29:14

I end up having to do it every so often.


leif
2018-1-22 21:29:40

(Used to be once a week three years ago, now I can get away with doing it only once every 3–6 months or so.)


spall
2018-1-22 21:30:14

ok thanks, i will try that!


abmclin
2018-1-22 21:34:28

does anyone know of a good example of a package implementing subcommands in a straightforward manner for a raco command? I tried using pkg as a working example for my own efforts to add some subcommands but I’m finding it to be really complex so am hoping for a more friendly example.


samth
2018-1-22 22:52:02


leif
2018-1-22 23:07:10

(Also, I get the same thing when doing the #%require method you suggested.)


spdegabrielle
2018-1-23 01:11:35