Re: [racket-users] Error location in test submodules

2019-04-04 Thread zeRusski
> If you want your tests to catch exceptions you need to wrap them in > exception handlers, which you could write a macro to do for you; as Eric > noted though you need to be careful to preserve source locations. > This gave me an idea, so I've been reading *rackunit* docs finally. I'm about

[racket-users] Re: Racket News - Issue 5

2019-04-04 Thread Juan Carlos Olivo
Thanks Paulo, I like seeing these additional resources regarding Racket and computer science, as I'm at an intermediate level on both. On Monday, April 1, 2019 at 4:05:27 PM UTC-5, Paulo Matos wrote: > > Issue 5 is here. > > https://racket-news.com/2019/04/racket-news-issue-5.html > > Come on

[racket-users] Pattern: reusing the same name in macro-generated definitions

2019-04-04 Thread zeRusski
While reading *rackunit* source I stumbled on a pattern that I can't figure out. Why the heck does it work? Condensed to its essence it amounts to introducing indirection with a macro-generated define: #lang racket > (require (for-syntax syntax/parse) > syntax/parse/define) >

Re: [racket-users] Pattern: reusing the same name in macro-generated definitions

2019-04-04 Thread Ben Greenman
Racket's macros are hygienic. They'll gensym for you. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more

Re: [racket-users] Error location in test submodules

2019-04-04 Thread Greg Hendershott
> Are you using emacs racket-mode? I have experience this issue only in that > mode since it does not (to my knowledge) implement all the error anchoring > features of DrRacket. It might just be that you have DrRacket set to user a higher errortrace level than racket-mode? That is, in DrR,

Re: [racket-users] Pattern: reusing the same name in macro-generated definitions

2019-04-04 Thread zeRusski
I know in principle but on occasion I fail to understand the implications. Let me think aloud. I don't have to be perfectly accurate, maybe just about right. Hygiene here means that every symbol there e.g. arguments my macro receives carry their "environment" with them. There exists some

Re: [racket-users] Pattern: reusing the same name in macro-generated definitions

2019-04-04 Thread Greg Hendershott
If I understand correctly, the fourth paragraph here is relevant? https://docs.racket-lang.org/reference/syntax-model.html#%28part._transformer-model%29 So, `foo-impl` is a binding introduced by the macro and gets that macro invocation's fresh macro-introduction scope. Whereas for example

Re: [racket-users] Help with pretty printing

2019-04-04 Thread Stephen Foster
Thanks, John. Actually, when you distinguished between the line breaks and the indentation, that helped me come up with the following algorithm. It basically, 1) lets pretty-print do its thing (inserting more line breaks than I need), 2) uses a regex to scrub out all line breaks after a

Re: [racket-users] Help with pretty printing

2019-04-04 Thread 'John Clements' via Racket Users
I’m glad to hear it! I think that it may not fail in nice ways for deeply nested s-expressions, but that not be an issue for you. I do think that there should be a nicer way than using a text%. John > On Apr 4, 2019, at 11:14 AM, Stephen Foster wrote: > > Thanks, John. Actually, when you