[racket-users] hash->list with try-order? (like hash-map)

2021-10-12 Thread unlimitedscolobb
Hi,

I wrote myself this little function:

(define (hash->ordered-list h)
  (hash-map h cons #t))

which uses the try-order? argument of hash-map.

Is there a reason for hash->list not have an optional argument try-order?  
Or perhaps having such a standalone function would be better?

I was planning to submit a patch, but then I thought I may be missing 
something.

-
Sergiu

-- 
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 
https://groups.google.com/d/msgid/racket-users/06052379-819d-45e1-8ea8-5dcced59d557n%40googlegroups.com.


Re: [racket-users] rename-out not working as expected

2021-10-12 Thread David Storrs
Okay, good.  Thanks for the library recommendation; I'll probably use that
in the future where I need to rename/provide multiple things, but given
that there's only one I did this instead in order to avoid having another
dependency:

(provide do-it)
(define do-it (procedure-rename do-something 'do-i))

I suspect I'm reinventing the wheel and that's what static-rename compiles
down to.


On Tue, Oct 12, 2021 at 3:14 PM 'William J. Bowman' via Racket Users <
racket-users@googlegroups.com> wrote:

> I think this is the expected behaviour of `rename-out`; you might want
> this library to change the dynamic displayed name:
>   https://docs.racket-lang.org/static-rename/index.html
>
> --
> William J. Bowman
>
> On Tue, Oct 12, 2021 at 03:07:13PM -0400, David Storrs wrote:
> > ---
> > ; test.rkt
> > #lang racket
> > (define (do-something) "ok")
> > (provide do-something)
> >
> > ; test2.rkt
> > #lang racket
> > (require "test.rkt")
> > (provide (rename-out [do-something do-it]))
> >
> > #lang racket
> > (require "test2.rkt")
> > do-it
> > ---
> >
> > The printed value is # although I was expecting
> > #.  Have I done something wrong or simply misunderstood
> > how rename-out works?
> >
> > --
> > 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
> https://groups.google.com/d/msgid/racket-users/CAE8gKodiRBWPK5MfgYnOi_V%2B%3DwwFzBxtQK1qV2Mj-zPuHEXn9g%40mail.gmail.com
> .
>
> --
> 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
> https://groups.google.com/d/msgid/racket-users/YWXekUFzaEkaitiB%40williamjbowman.com
> .
>

-- 
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 
https://groups.google.com/d/msgid/racket-users/CAE8gKodCGGStB5LW-sw8DNDCeR-G4Zt9UxMsbcCs6mAZUiH%3DMw%40mail.gmail.com.


Re: [racket-users] rename-out not working as expected

2021-10-12 Thread 'William J. Bowman' via Racket Users
I think this is the expected behaviour of `rename-out`; you might want this 
library to change the dynamic displayed name:
  https://docs.racket-lang.org/static-rename/index.html

--
William J. Bowman

On Tue, Oct 12, 2021 at 03:07:13PM -0400, David Storrs wrote:
> ---
> ; test.rkt
> #lang racket
> (define (do-something) "ok")
> (provide do-something)
> 
> ; test2.rkt
> #lang racket
> (require "test.rkt")
> (provide (rename-out [do-something do-it]))
> 
> #lang racket
> (require "test2.rkt")
> do-it
> ---
> 
> The printed value is # although I was expecting
> #.  Have I done something wrong or simply misunderstood
> how rename-out works?
> 
> -- 
> 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 
> https://groups.google.com/d/msgid/racket-users/CAE8gKodiRBWPK5MfgYnOi_V%2B%3DwwFzBxtQK1qV2Mj-zPuHEXn9g%40mail.gmail.com.

-- 
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 
https://groups.google.com/d/msgid/racket-users/YWXekUFzaEkaitiB%40williamjbowman.com.


[racket-users] rename-out not working as expected

2021-10-12 Thread David Storrs
---
; test.rkt
#lang racket
(define (do-something) "ok")
(provide do-something)

; test2.rkt
#lang racket
(require "test.rkt")
(provide (rename-out [do-something do-it]))

#lang racket
(require "test2.rkt")
do-it
---

The printed value is # although I was expecting
#.  Have I done something wrong or simply misunderstood
how rename-out works?

-- 
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 
https://groups.google.com/d/msgid/racket-users/CAE8gKodiRBWPK5MfgYnOi_V%2B%3DwwFzBxtQK1qV2Mj-zPuHEXn9g%40mail.gmail.com.