Applicable sets and hashes?

34 views
Skip to first unread message

Maciek Godek

unread,
Sep 8, 2019, 5:51:58 AM9/8/19
to Racket Users
Hi,
is it possible to take Racket's hash tables and sets, and make them applicable (like in Clojure)?

So that, for example

(#hash((a . 1) (b . 2)) 'a)

would be equivalent to

(hash-ref #hash((a . 1) (b . 2)) 'a)

and 

((set 1 2 3) 1)

would be equivalent to

(set-member? (set 1 2 3) 1)


Ricardo Herdt

unread,
Sep 8, 2019, 5:57:47 AM9/8/19
to Racket Users
Hi Maciek,

yes, it is. Take a look at rackjure:

https://docs.racket-lang.org/rackjure/index.html#(part._dict-app)

Regards,

Ricardo
> --
> 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...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/879ae299-8f3f-4b9a-b13e-16727f347cb8%40googlegroups.com
> [1].
>
>
> Links:
> ------
> [1]
> https://groups.google.com/d/msgid/racket-users/879ae299-8f3f-4b9a-b13e-16727f347cb8%40googlegroups.com?utm_medium=email&utm_source=footer

Maciek Godek

unread,
Sep 8, 2019, 3:34:37 PM9/8/19
to Racket Users
Great, thanks!


W dniu niedziela, 8 września 2019 11:57:47 UTC+2 użytkownik ricardo.g.herdt napisał:
Hi Maciek,

yes, it is. Take a look at rackjure:

https://docs.racket-lang.org/rackjure/index.html#(part._dict-app)

Regards,

Ricardo


Am 08.09.2019 11:51 schrieb Maciek Godek:
> Hi,
> is it possible to take Racket's hash tables and sets, and make them
> applicable (like in Clojure)?
>
> So that, for example
>
> (#hash((a . 1) (b . 2)) 'a)
>
> would be equivalent to
>
> (hash-ref #hash((a . 1) (b . 2)) 'a)
>
> and
>
> ((set 1 2 3) 1)
>
> would be equivalent to
>
> (set-member? (set 1 2 3) 1)
>
>  --
>  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...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages