mccoybecker
2021-9-5 15:24:27

@mccoybecker has joined the channel


mccoybecker
2021-9-5 15:25:50

I’m having some issues with my scribblings setup in a package I’m working on. Specifically, scribblings/microKanren.scrbl:2:20: collection not found for module path: microKanren collection: "microKanren" in collection directories: /home/mccoy/.local/share/racket/8.2/collects /home/mccoy/racket/collects/ ... [176 additional linked and package directories] location...: scribblings/microKanren.scrbl:2:20 context...: /home/mccoy/racket/share/pkgs/compiler-lib/compiler/commands/test.rkt:383:27 /home/mccoy/racket/share/pkgs/compiler-lib/compiler/commands/test.rkt:385:0: call-with-summary when I run raco test . — despite the fact that my info.rkt registers the package name: #lang info (define collection "microKanren") (define deps '("base")) (define build-deps '("scribble-lib" "racket-doc" "rackunit-lib")) (define scribblings '(("scribblings/microKanren.scrbl" ()))) (define pkg-desc "A Racket implementation of microKanren.") (define version "0.0.1") (define pkg-authors '(femtomc)) can anyone easily see what’s up here?

Re — even if I make a blank project blarg , it seems like things are not quite setup correctly. ~/Dev/blarg ❯ raco test . Dev/blarg raco test: "./info.rkt" raco test: (submod "./main.rkt" test) scribblings/blarg.scrbl:2:20: collection not found for module path: blarg collection: "blarg" in collection directories: /home/mccoy/.local/share/racket/8.2/collects /home/mccoy/racket/collects/ ... [176 additional linked and package directories] location...: scribblings/blarg.scrbl:2:20 context...: /home/mccoy/racket/share/pkgs/compiler-lib/compiler/commands/test.rkt:383:27 /home/mccoy/racket/share/pkgs/compiler-lib/compiler/commands/test.rkt:385:0: call-with-summary .../private/map.rkt:40:19: loop /home/mccoy/racket/share/pkgs/compiler-lib/compiler/commands/test.rkt:385:0: call-with-summary .../private/map.rkt:40:19: loop [repeats 7 more times] /home/mccoy/racket/share/pkgs/compiler-lib/compiler/commands/test.rkt:385:0: call-with-summary .../private/map.rkt:40:19: loop /home/mccoy/racket/share/pkgs/compiler-lib/compiler/commands/test.rkt:1113:1: test body of "/home/mccoy/racket/share/pkgs/compiler-lib/compiler/commands/test.rkt" /home/mccoy/racket/collects/raco/raco.rkt:41:0 body of "/home/mccoy/racket/collects/raco/raco.rkt" body of "/home/mccoy/racket/collects/raco/main.rkt"


sorawee
2021-9-5 15:46:48

Have you installed it? — raco pkg install


mccoybecker
2021-9-5 17:07:27

No! did not think you needed to do this to test it locally


badkins
2021-9-5 17:08:06

I’m encountering surprising behavior when attempting to display the results of syntax->list. For example, the following seems to spin forever (once I add the syntax->list related code): #lang racket/base (require (for-syntax racket/base)) (define-syntax (my-mac stx) (syntax-case stx () [(_ a b) (with-syntax ([ line (syntax-line stx) ] [ col (syntax-column stx) ] [ pos (syntax-position stx) ] [ src (syntax-source stx) ] [ lst (syntax->list stx) ]) #'(begin (printf "Source ~a\n" src) (printf "Line ~a. Column ~a. Position ~a\n" line col pos) (printf "List ~a\n" lst)))])) (my-mac 4 5) However, when I type the following directly into the REPL (DrRacket), it works fine: (printf "List ~a\n" (syntax->list #`(my-mac 4 5))) Thoughts?


soegaard2
2021-9-5 17:10:03

Try: #lang racket/base (require (for-syntax racket/base)) (define-syntax (my-mac stx) (syntax-case stx () [(_ a b) (with-syntax ([ line (syntax-line stx) ] [ col (syntax-column stx) ] [ pos (syntax-position stx) ] [ src (syntax-source stx) ] [ lst (syntax->list stx) ]) (begin (printf "Source ~a\n" src) (printf "Line ~a. Column ~a. Position ~a\n" line col pos) (printf "List ~a\n" lst) #'42))])) instead.


soegaard2
2021-9-5 17:11:03

The problem is that #'(begin (printf "List ~a\n" lst)) expands to (begin (printf "List ~a\n" (my-mac 4 5))) which invokes the same macro again.


badkins
2021-9-5 17:11:05

…and trying the macro stepper seems to have killed DrRacket


soegaard2
2021-9-5 17:11:38

Alternatively: Use 'lst not lst.


soegaard2
2021-9-5 17:11:56

That is: #lang racket/base (require (for-syntax racket/base)) (define-syntax (my-mac stx) (syntax-case stx () [(_ a b) (with-syntax ([ line (syntax-line stx) ] [ col (syntax-column stx) ] [ pos (syntax-position stx) ] [ src (syntax-source stx) ] [ lst (syntax->list stx) ]) #'(begin (printf "Source ~a\n" src) (printf "Line ~a. Column ~a. Position ~a\n" line col pos) (printf "List ~a\n" 'lst)))])) (my-mac 4 5)


badkins
2021-9-5 17:12:08

Hmm…. thanks


soegaard2
2021-9-5 17:13:10

I think, there is a setting in the macro stepper for the maximum number of steps to examine.


notjack
2021-9-5 21:06:22

I wish there was a setting to just macro expand a particular expression and leave the rest of the file appearing unexpanded


spdegabrielle
2021-9-5 21:54:29

Like a breakpoint in a debugger?


notjack
2021-9-5 21:57:40

I was thinking more like being able to just click on an expression in the macro stepper, making it the “selected” expression, and then the Step button should just show you the next macro expansion step that occurs within that expression and it should pretend that no changes to any other expressions happened


sorawee
2021-9-5 21:58:26

The macro stepper supports macro hiding, though it only works with module-level macro invocation IIRC


notjack
2021-9-5 21:59:19

yeah I don’t think this would be technically hard, it’s just a UI improvement I really want


sorawee
2021-9-5 22:01:04

Oh, I just tried it and it seems to work with non module-level macro invocation too. Maybe I remembered it wrong


spdegabrielle
2021-9-5 22:02:20

It is a good idea. You should log an issue describing it. So it isn’t forgotten


strika
2021-9-6 04:53:56

@sorawee, this is the minimal example of the potential bug - https://github.com/hackberrydev/demod-test. I included the list of commands in the README. I’m still not sure if I’m doing something wrong or if it’s indeed a bug. What do you think? Thanks.


sorawee
2021-9-6 05:40:43

It is a bug, I think. @mflatt would be able to confirm.

The problem seems to be due to gregor. require-ing other libs doesn’t seem to cause the problem.


strika
2021-9-6 06:45:56

Interesting. Thanks. I’ll file a bug. Just wanted to be sure I’m not doing anything obviously wrong.