Re: [racket-users] Why is struct/contract so much faster than a guard?

2020-09-03 Thread Christopher Lemmer Webber
Cool! Thanks for sharing :) -- 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. To view this discussion on the web visit

Re: [racket-users] Re: provide-if-not-defined

2020-09-03 Thread Sorawee Porncharoenwase
I want to propose another interface: (my-provide #:default + - * #:override [my-+ +]) which expands to: (provide - *) (provide (rename-out [my-+ +])) and checks that + must be in the #:default section (because we are overriding it, it’d better already exist). More generally:

Re: [racket-users] Re: provide-if-not-defined

2020-09-03 Thread Shriram Krishnamurthi
Ah, I see, that's a nice idea! One problem is have well over a dozen of these that I want to pass-through, but I suppose I could write a (rename-prefix ...) that turns into a bunch of define's. I'd have to be careful to not miss any. Another issue is that I have to redefine some of the

[racket-users] Re: provide-if-not-defined

2020-09-03 Thread Greg Hendershott
What if you instead rename the lang's imports (e.g. with prefix-in), and rely on the fact that your definitions override those supplied by the lang? That way you could write the exact same provide for all the files: "provide-if-not-defined" is simply provide. However, you would need to

Re: [racket-users] Why is struct/contract so much faster than a guard?

2020-09-03 Thread David Storrs
For the record, a self-plug: #lang racket (require struct-plus-plus) (struct foo-guard (bar baz) #:guard (struct-guard/c any/c list?)) (struct/contract foo-contract ([bar any/c] [baz list?])) (struct++ foo-spp ([bar any/c] [baz list?]))

Re: [racket-users] provide-if-not-defined

2020-09-03 Thread Shriram Krishnamurthi
Thank you both. What I want is something closer to what Oak wrote, but that addresses only *checking*, whereas I also want the convenience of defining the module. So to use Oak's example, I want to be able to write #lang racket/base (provide-if-not-defined + - *) at the top of *all

Re: [racket-users] Re: (chaperone RacketCon) 2020

2020-09-03 Thread Andrew Gwozdziewycz
Jay, I was expecting this to be like PLDI, and that came with an amazing song: “This is Still PLDI” — https://youtu.be/hVMCl64Uhe8 Does Racket Con have an official song? Thanks, Andrew P.S. — yes, I am being a troll. However, I would genuinely love to see a Racket Con song. I have no

Re: [racket-users] Create C functions for embedded Racket CS

2020-09-03 Thread Matthew Flatt
At Wed, 2 Sep 2020 14:05:11 -0700 (PDT), dotoscat wrote: > There are a function such scheme_make_prim_w_arity > _arity%29> > for the CS version? The idea is to use Racket > as a scripting language for a C program.

[racket-users] Re: (chaperone RacketCon) 2020

2020-09-03 Thread Jay McCarthy
The site is up with speakers and times: https://con.racket-lang.org/ Please get pumped and put the dates in your calendars. And stay tuned for details about how technically the conference will work. Thanks everyone! <3 Jay -- Jay McCarthy Associate Professor @ CS @ UMass Lowell

Re: [racket-users] difference in struct printing from default #:transparent versus make-constructor-style-printer

2020-09-03 Thread Jeremy Siek
Thanks Ryan! On Thursday, September 3, 2020 at 5:47:50 AM UTC-4 rmculp...@gmail.com wrote: > The Racket printer uses a separate property to determine whether a struct > is quotable. If you add > > #:property prop:custom-print-quotable 'never > > to the declarations of Int2 and Prim2, your

Re: [racket-users] difference in struct printing from default #:transparent versus make-constructor-style-printer

2020-09-03 Thread Ryan Culpepper
The Racket printer uses a separate property to determine whether a struct is quotable. If you add #:property prop:custom-print-quotable 'never to the declarations of Int2 and Prim2, your program should produce the output you expect. I'll add a note to the docs for