Re: [racket-users] Finding bound occurrences

2020-05-07 Thread Hendrik Boom
On Thu, May 07, 2020 at 10:27:53AM -0500, Robby Findler wrote: > Does the file without arrows have a syntax error? > > Robby That was th problem. Not in the file itself, which the main file for the Racket openGL binding, but in a generated file I included. I forgot I had modified the include

Re: [racket-users] trickiness about the order of definitions in GUI code

2020-05-07 Thread James Platt
On May 7, 2020, at 12:44 AM, Philip McGrath wrote: > Rather than designing an ad hoc system of indirection that can handle all of > the complexity,* I suggest using the one that already exists: units, Racket's > original, first-class (rather than first-order) module system, offer support > for

Re: [racket-users] Finding bound occurrences

2020-05-07 Thread Robby Findler
Does the file without arrows have a syntax error? Robby On Thu, May 7, 2020 at 9:55 AM Hendrik Boom wrote: > I have several tabs open in DrRacket. > On two of them, when I mouse over a symbol, it provides very > visible links to binding or bound occurrences > > On the third, it doesn't.

[racket-users] Finding bound occurrences

2020-05-07 Thread Hendrik Boom
I have several tabs open in DrRacket. On two of them, when I mouse over a symbol, it provides very visible links to binding or bound occurrences On the third, it doesn't. There is a right-click mey item to jump to the binding occurrence, but no menu item to find next bound occurrence. One

Re: [racket-users] Quickscript of the day: Extract to function

2020-05-07 Thread Stephen De Gabrielle
Awesome - keep them coming. You should feature one in each Racket-News! Stephen On Thu, 7 May 2020 at 10:33, Laurent wrote: > Have you ever wanted to extract a block of code out of its context and > wrap it in a function? > > Have you ever *not* done it because of the cognitive load(*) of

Re: [racket-users] Quickscript of the day: Extract to function

2020-05-07 Thread Andre Garzia
that is really cool! thanks for sharing! On Thu, 7 May 2020 at 10:33, Laurent wrote: > Have you ever wanted to extract a block of code out of its context and > wrap it in a function? > > Have you ever *not* done it because of the cognitive load(*) of figuring > out the function arguments and

Re: [racket-users] Quickscript of the day: Extract to function

2020-05-07 Thread Dexter Lagan
Nice!! Yay for laziness. On Thu, May 7, 2020 at 11:33 AM Laurent wrote: > Have you ever wanted to extract a block of code out of its context and > wrap it in a function? > > Have you ever *not* done it because of the cognitive load(*) of figuring > out the function arguments and the return

Re: [racket-users] A convenient assertion macro - with one caveat

2020-05-07 Thread Dexter Lagan
Awesome! Thanks. Racket is freaking amazing. Dex > On May 7, 2020, at 11:51 AM, Jens Axel Søgaard wrote: > >  > You can use syntax/loc to give a piece of syntax location information. > > #lang racket > (require (for-syntax syntax/parse)) > > (define-syntax (assert stx) > (syntax-parse stx

Re: [racket-users] A convenient assertion macro - with one caveat

2020-05-07 Thread Jens Axel Søgaard
You can use syntax/loc to give a piece of syntax location information. #lang racket (require (for-syntax syntax/parse)) (define-syntax (assert stx) (syntax-parse stx [(_assert ?a ?b) (quasisyntax/loc stx (module+ test (require rackunit) #,(syntax/loc stx

Re: [racket-users] A convenient assertion macro - with one caveat

2020-05-07 Thread Laurent
Check out `make-check-location` and friends, and maybe `with-check-info*` https://docs.racket-lang.org/rackunit/api.html?q=define-check#%28def._%28%28lib._rackunit%2Fmain..rkt%29._make-check-location%29%29 You may have to combine with the syntax-information extracted from the syntax object `stx`.

[racket-users] Quickscript of the day: Extract to function

2020-05-07 Thread Laurent
Have you ever wanted to extract a block of code out of its context and wrap it in a function? Have you ever *not* done it because of the cognitive load(*) of figuring out the function arguments and the return values? Well, now it's as easy as Ctrl-Shift-X and Ctrl-Shift-Y. Using check-syntax,

[racket-users] A convenient assertion macro - with one caveat

2020-05-07 Thread Dexter Lagan
Hi, I made a simple macro which saves me the trouble of defining a test module, requiring RackUnit and then declaring '(module+ test' after each procedure definition, as I like to keep unit tests close by. The repo : https://github.com/DexterLagan/assert Here's the macro, apologies for the

Re: [racket-users] trickiness about the order of definitions in GUI code

2020-05-07 Thread Dexter Lagan
Hi James, Like others said, Unit is the proper solution, but to add my 2c, I was able to avoid this problem altogether by using these two simple tricks : 1) add the controls in the order of their requirement (defining table3 before info-menu-item), then re-ordering the controls before